Only happens with USE="jpeg" /usr/bin/gcc -Os -pipe -march=native -mtune=native -mfpmath=sse -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -Wno-erro r=implicit-function-declaration -Wimplicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -W -Wall -Wno-unused-parameter -Wdeclaration-after-statement -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl, -fuse-ld=gold -lpthread -lgomp -rdynamic CMakeFiles/pat2dat.dir/pat2dat.c.o -o pat2dat -Wl,-rpath,/var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2/lib: ../lib/libaldat.a ../lib/libjpgalleg.so.4.4.2 ../lib/liballeg.so.4.4. 2 -ldl -lm -lrt -lSM -lICE -lX11 -lXext -lXcursor -lXpm -lXxf86vm -ldl ../lib/libjpgalleg.so.4.4.2: error: undefined reference to 'get_value' collect2: error: ld returned 1 exit status make[2]: *** [tools/CMakeFiles/pat2dat.dir/build.make:96: tools/pat2dat] Error 1 make[2]: Leaving directory '/var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2' make[1]: *** [CMakeFiles/Makefile2:868: tools/CMakeFiles/pat2dat.dir/all] Error 2 [100%] Linking C executable grabber cd /var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2/tools && /usr/bin/cmake -E cmake_link_script CMakeFiles/grabber.dir/link.txt --verbose=1 /usr/bin/gcc -Os -pipe -march=native -mtune=native -mfpmath=sse -fopenmp -pthread -fno-unroll-all-loops -fno-unroll-loops -fno-peel-loops -Wformat -Wformat-security -Warray-bounds -Wclobbered -Wvolatile-register-var -Wdate-time -Wno-erro r=implicit-function-declaration -Wimplicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=gold -lpthread -lgomp -W -Wall -Wno-unused-parameter -Wdeclaration-after-statement -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl, -fuse-ld=gold -lpthread -lgomp -rdynamic CMakeFiles/grabber.dir/grabber.c.o -o grabber -Wl,-rpath,/var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2/lib: ../lib/libaldat.a ../lib/libjpgalleg.so.4.4.2 ../lib/liballeg.so.4.4. 2 -ldl -lm -lrt -lSM -lICE -lX11 -lXext -lXcursor -lXpm -lXxf86vm -ldl ../lib/libjpgalleg.so.4.4.2: error: undefined reference to 'get_value' collect2: error: ld returned 1 exit status make[2]: *** [tools/CMakeFiles/grabber.dir/build.make:96: tools/grabber] Error 1 make[2]: Leaving directory '/var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2' make[1]: *** [CMakeFiles/Makefile2:646: tools/CMakeFiles/grabber.dir/all] Error 2 make[1]: Leaving directory '/var/tmp/portage/media-libs/allegro-4.4.2-r2/work/allegro-4.4.2' make: *** [Makefile:130: all] Error 2 * ERROR: media-libs/allegro-4.4.2-r2::gentoo failed (compile phase): * emake failed
Created attachment 591542 [details] allegro-4.4.2-r2:20191001-222337.log buildlog
Created attachment 591544 [details] info emerge --info
I am unable to reproduce this. Please try without the ridiculous CFLAGS before reporting bugs.
I've managed to reproduce this with no flags at all. -O1 and -O2 work but -O0 and -Os do not. I've tried narrowing down the flag with "g++ -Q --help=optimizer" but no luck.
Patch, untested https://sourceforge.net/p/alleg/bugs/398/attachment/50_fix_get_value_gcc_5.patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=361616ee4d919fd2c898f673cb50ea0ee2d8ba7c commit 361616ee4d919fd2c898f673cb50ea0ee2d8ba7c Author: James Le Cuirot <chewi@gentoo.org> AuthorDate: 2019-10-03 20:47:19 +0000 Commit: James Le Cuirot <chewi@gentoo.org> CommitDate: 2019-10-03 20:48:00 +0000 media-libs/allegro: Patch against undefined ref to get_value in 4.4.2 Closes: https://bugs.gentoo.org/696034 Package-Manager: Portage-2.3.76, Repoman-2.3.17 Signed-off-by: James Le Cuirot <chewi@gentoo.org> media-libs/allegro/allegro-4.4.2-r2.ebuild | 1 + media-libs/allegro/files/allegro-4.4.2-static-func.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+)