https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64812
Michael Stahl <mstahl at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caolanm at redhat dot com, | |mstahl at redhat dot com, | |sbergman at redhat dot com --- Comment #5 from Michael Stahl <mstahl at redhat dot com> --- the problem is that with -Os, the inline method WindowListenerMultiplexer::acquire() results in an undefined symbol, whereas with -O2 weak symbols are emitted into the object. can reproduce this with: gcc (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1) the command line parameters for compilation in the build system were: g++ -m32 -fvisibility=hidden -fmessage-length=0 -fno-common -fvisibility-inlines-hidden -fstack-protector-strong -fPIC -std=gnu++11 -ggdb2 -fexceptions -fno-enforce-eh-specs -Os -c /tmp/fmgridif.ii -o /tmp/fmgridif.o the minimal command line parameters to trigger the bug: > g++ -m32 -std=gnu++11 -Os -c /tmp/fmgridif.ii -o /tmp/fmgridif.o > nm --demangle /tmp/fmgridif.o | grep WindowListenerMultiplexer U non-virtual thunk to WindowListenerMultiplexer::acquire() the minimal command line parameters to avoid the bug: > g++ -m32 -std=gnu++11 -O2 -c /tmp/fmgridif.ii -o /tmp/fmgridif.o > nm --demangle /tmp/fmgridif.o | grep WindowListenerMultiplexer 00000000 W WindowListenerMultiplexer::acquire() 00000020 W non-virtual thunk to WindowListenerMultiplexer::acquire()