aras-p / glsl-optimizer

GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.
Other
1.73k stars 422 forks source link

Compiling on Gentoo #92

Open iegor opened 9 years ago

iegor commented 9 years ago

Hi there,

I have trouble with compiling on Gentoo, I will probably do a fork and just fix this but also want to share.

[ 98%] Building CXX object CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DNDEBUG -O2 -pipe -march=corei7-avx -fno-omit-frame-pointer -Os -DNDEBUG -I/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/include -I/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/src/mesa -I/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/src/mapi -I/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/src/glsl -I/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/src -o CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o -c /tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999/src/glsl/main.cpp Linking CXX executable glsl_compiler /usr/bin/cmake -E cmake_link_script CMakeFiles/glsl_compiler.dir/link.txt --verbose=1 /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -march=corei7-avx -fno-omit-frame-pointer -Os -DNDEBUG CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o -o glsl_compiler -rdynamic libglsl_optimizer.a libglcpp-library.a libmesa.a libglsl_optimizer.a(standalone_scaffolding.cpp.o): In function _mesa_error_no_memory': standalone_scaffolding.cpp:(.text+0xf): multiple definition of_mesa_error_no_memory' CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o:main.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: * [glsl_compiler] Error 1 make[2]: Leaving directory `/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999_build' make[1]: * [CMakeFiles/glsl_compiler.dir/all] Error 2 make[1]: Leaving directory`/tmp/portage/gfx-tools/glsl-optimizer-9999/work/glsl-optimizer-9999_build' make: *\ [all] Error 2

Looks like the _mesa_error_no_memory function is defined in src/glsl/main.cpp and in src/glsl/standalone_scaffolding.cpp and that causes an error while linking.

Regards, Iegor

zet4 commented 9 years ago

Same issue on Arch x64.

ghost commented 9 years ago

same error under ubuntu 14 64bit: [ 98%] Building CXX object CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o Linking CXX executable glsl_compiler libglsl_optimizer.a(standalone_scaffolding.cpp.o): dans la fonction « _mesa_error_no_memory »: standalone_scaffolding.cpp:(.text+0x5): définitions multiples de « _mesa_error_no_memory » CMakeFiles/glsl_compiler.dir/src/glsl/main.cpp.o:main.cpp:(.text+0x0): défini pour la première fois ici collect2: error: ld returned 1 exit status make[2]: * [glsl_compiler] Erreur 1 make[1]: * [CMakeFiles/glsl_compiler.dir/all] Erreur 2 make: *\ [all] Erreur 2

ShreiderWalter commented 9 years ago

Same stuff Arch x64

bkaradzic commented 9 years ago

@ShreiderWalter Try this: https://github.com/bkaradzic/bgfx/issues/304#issuecomment-92420314

tschw commented 9 years ago

See commit e480701dc39d88eff2aaa5ae03ae1941793a80a1 of open PR #91.

And / or see diff in this issue on the zz85 fork (omit the hacks in glsl_optimizer.cpp) for this and another linux build issue and merge #104 to resolve segfaults / hangs in release builds.