Created attachment 90705 [details] Build.log Hello, I can't compile Mesa library 10.0.1 with LTO enabled gcc-4.9-20131208 snapshot. It seems that header file is (are?) missing in source code files and so maybe the library at link time (could it be /src/glsl/ralloc.h?). First error reported in build, this one for 32 bit ABI (-m32): -cut- libtool: link: ranlib .libs/libglsl.a libtool: link: rm -fr .libs/libglsl.lax libtool: link: ( cd ".libs" && rm -f "libglsl.la" && ln -s "../libglsl.la" "libglsl.la" ) /bin/sh ../../libtool --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -m32 -fvisibility=hidden -O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin -Wall -fno-strict-aliasing -fno-builtin-memcmp -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin -o glsl_compiler hash_table.o imports.o prog_hash_table.o symbol_table.o standalone_scaffolding.o main.o libglsl.la libtool: link: x86_64-pc-linux-gnu-g++ -m32 -fvisibility=hidden -O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin -Wall -fno-strict-aliasing -fno-builtin-memcmp -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -O2 -ggdb -pipe -march=native -mtune=native -flto=4 -fuse-linker-plugin -o glsl_compiler hash_table.o imports.o prog_hash_table.o symbol_table.o standalone_scaffolding.o main.o -Wl,--as-needed ./.libs/libglsl.a /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `_mesa_new_shader': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/standalone_scaffolding.cpp:76: undefined reference to `rzalloc_size' /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `main': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:337: undefined reference to `rzalloc_size' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:339: undefined reference to `ralloc_strdup' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:343: undefined reference to `reralloc_array_size' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:347: undefined reference to `rzalloc_size' /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `load_text_file': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:216: undefined reference to `ralloc_size' /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `operator new': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/glsl_parser_extras.h:80: undefined reference to `ralloc_size' /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `compile_shader': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:279: undefined reference to `_mesa_glsl_parse_state::_mesa_glsl_parse_state(gl_context*, unsigned int, void*)' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:281: undefined reference to `_mesa_glsl_compile_shader' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:285: undefined reference to `_mesa_print_ir' /var/tmp/portage/media-libs/mesa-10.0.1/temp/cc0tEQQs.ltrans0.ltrans.o: In function `main': /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:392: undefined reference to `ralloc_free' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:392: undefined reference to `ralloc_free' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:392: undefined reference to `ralloc_free' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:394: undefined reference to `ralloc_free' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:395: undefined reference to `_mesa_glsl_release_types' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:396: undefined reference to `_mesa_glsl_release_builtin_functions()' /var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl/../../src/glsl/main.cpp:384: undefined reference to `link_shaders(gl_context*, gl_shader_program*)' collect2: error: ld returned 1 exit status Makefile:1136: recipe for target 'glsl_compiler' failed gmake[3]: *** [glsl_compiler] Error 1 gmake[3]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl' Makefile:1057: recipe for target 'all' failed gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src/glsl' Makefile:529: recipe for target 'all-recursive' failed gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory '/var/tmp/portage/media-libs/mesa-10.0.1/work/Mesa-10.0.1-x86/src' Makefile:580: recipe for target 'all-recursive' failed Could you please look at it? Thank you in advance.
With the same compiler and CFLAGS but without LTO it compiles fine.
Can you try with a released version of gcc? I can build src/glsl with gcc-4.8.2 -flto=4 here.
Thank you. You are right. I had the lto commented out long time for mesa, I had no "suspect", that gcc-4.8.2 can be working. I am sorry. I opened a case in Gcc Bugzilla now: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59505
I got this information in GCC Bugzilla from Markus Trippelsdorf 2013-12-14 08:55:40 UTC Gcc now uses slim-LTO-objects by default. Therefore you need to run binutils (ar, nm, ranlib) that use the linker plugin. You can use gcc-ar, etc. for this purpose. And it solved my issue. I will try 2.24.51.0.2 binutils too. Could you please close this my report as invalid? Thank you. Best wishes, David.
Thanks for the info!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.