Re: fPIC error hard to diagnose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mathieu Lacage <mathieu.lacage@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux