This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

link errors with -flto and -Wl,-soname,f.o


With GCC 4.9 (built from svn r209238 on Linux x86-64) I'm getting these errors:

$ echo "void f() {}" > f.c
$ gcc -flto -c f.c
$ gcc -flto -o f.so -shared -Wl,-soname,f.o f.o
f.c:1:6: error: 'f' has already been defined
 void f() {}
      ^
f.c:1:6: note: previously defined here
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: /home/jay/gcc/local/bin/gcc returned 1 exit status
collect2: error: lto-wrapper returned 1 exit status

I realise that setting the soname to f.o (instead of f.so) is an odd
thing to do, but I don't see why it should provoke these errors.

I don't see the errors with GCC 4.8.1 (at least the version of it
supplied with Ubuntu 13.10).

Thanks,
Jay.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]