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]

Re: fPIC error hard to diagnose


Mathieu Lacage <mathieu.lacage@gmail.com> writes:

> I tried to build gcc trunk to test -flto but I keep getting the same
> error during link:
> /usr/bin/ld: /tmp/cclQrpIm.lto.o: relocation R_X86_64_PC32 against
> symbol `_ZN3ns316g_logTi
> mePrinterE' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
>
> So, I added -fPIC instead of -fpic to my build lines but still get the
> error which means that I probably forgot one file somewhere but I am
> stuck while trying to figure out which of them I forgot:
> /tmp/cclQrpIm.lto.o does not exist anymore when gcc returns so, I
> can't just go and look at it to figure which source file it
> corresponds to. Would someone know of a nice gcc option which can make
> it report a more useful error (or which can make it leave the file in
> place) ?

You could try using the --save-temps option.

The '.lto.o' in the name suggests that you are using LTO, which
suggests that -fpic may not be carrying through LTO somehow.

Ian


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