Created attachment 524230 [details] build.log [ 34%] Linking CXX executable mysqlshow cd /var/tmp/portage/dev-db/mariadb-10.3.5_rc/work/mariadb-10.3.5_rc_build/client && /usr/bin/cmake -E cmake_link_script CMakeFiles/mysqlshow.dir/link.txt --verbose=1 /usr/bin/x86_64-pc-linux-gnu-g++ -march=atom -mcx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -fstack-protector -felide-constructors -fno-strict-aliasing -pie -fPIC -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -fno-rtti -DNDEBUG -DDBUG_OFF -Wl,-O1 -Wl,--as-needed CMakeFiles/mysqlshow.dir/mysqlshow.c.o -o mysqlshow -lpthread ../libmariadb/libmariadb/libmariadbclient.a ../mysys/libmysys.a -lpthread ../dbug/libdbug.a ../mysys_ssl/libmysys_ssl.a ../mysys/libmysys.a ../dbug/libdbug.a ../mysys_ssl/libmysys_ssl.a -lz -lm -lbfd -ldl -lssl -lcrypto ../strings/libstrings.a -lpthread CMakeFiles/innochecksum.dir/innochecksum.cc.o: In function `ut_allocate_trace_dontdump(void*, unsigned long, bool, ut_new_pfx_t*, char const*)': innochecksum.cc:(.text+0x138): undefined reference to `ib::warn::~warn()' innochecksum.cc:(.text+0x167): undefined reference to `ib::warn::~warn()' CMakeFiles/innochecksum.dir/innochecksum.cc.o: In function `ut_dodump(void*, unsigned long)': innochecksum.cc:(.text+0x2bb): undefined reference to `ib::warn::~warn()' innochecksum.cc:(.text+0x2cf): undefined reference to `ib::warn::~warn()' CMakeFiles/innochecksum.dir/__/storage/innobase/buf/buf0checksum.cc.o: In function `ut_allocate_trace_dontdump(void*, unsigned long, bool, ut_new_pfx_t*, char const*)': buf0checksum.cc:(.text+0x138): undefined reference to `ib::warn::~warn()' CMakeFiles/innochecksum.dir/__/storage/innobase/buf/buf0checksum.cc.o:buf0checksum.cc:(.text+0x167): more undefined references to `ib::warn::~warn()' follow collect2: error: ld returned 1 exit status make[2]: *** [extra/CMakeFiles/innochecksum.dir/build.make:261: extra/innochecksum] Error 1 mariadb-10.2.13 compiles fine
Created attachment 524232 [details] emerge --info
*** Bug 650866 has been marked as a duplicate of this bug. ***
I can confirm this. I was able to compile this version earlier this month, but not anymore. Not sure if it's relevant, but I changed my CFLAGS to "-O0 -march=i686 -pipe -ggdb".
Some further testing showed that when compiling innochecksum, the definition of the destructor is excluded (with an #ifndef UNIV_INNOCHECKSUM) while the declaration is still present. For some reason on my system with -O0 this leads to an undefined reference, while -O2 optimizes it away. However I see that Sven is using -O2. In any case, I think it should be solved by bringing #ifndef placement in ut0ut.h inline with #ifndef placement in ut0ut.cc.
Seeing the same error here. USE flags for dev-db/mariadb (from the build log): abi_x86_64 amd64 backup elibc_glibc extraengine kernel_linux pam perl server userland_GNU xml C Flags (also from the log file): -march=native -fno-strict-aliasing -pie -fPIC -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4
(In reply to Maurice van der Pot from comment #4) > For some reason on my system with -O0 this leads to an undefined reference, > while -O2 optimizes it away. However I see that Sven is using -O2. I have to add, that I didn't use -O2 in my CFLags. Just forgot it to add, when I extracted the march=native flags. While it worked for several years, in the last months the number of failed packages have increased. And like you mentioned, the error passed away, when I added -O2 to my CFlags. So, it has to be decided, if the code should compile without a optimization flag too.