Re: ODR violation warning when compiling with -flto -fno-semantic-interposition -fPIC

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

 



> I can't reproduce it on x86_64-linux-gnu.  What is your architecture?

Ups, I forgot to mention one more flag "-O" which is important here.

So building instructions should be like this with the same code:

$ g++ -c 1.cpp -O -flto -fno-semantic-interposition -fPIC
$ g++ -c 2.cpp -O -flto -fno-semantic-interposition -fPIC
$ g++ 1.o 2.o

I tried this on two PCs, both x86_64-linux-gnu (Ubuntu and NixOS), on
both of them it produces the warning.

I also just found out that it compiles fine on gcc5 (5.4.1 20160904).



[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