sjnewbury / gentoo-gpu

Bleeding-edge GPU support for Gentoo - OpenCL, GLVND, Vulkan
17 stars 6 forks source link

dev-util/shaderc-9999: fails building (against upstream spirv-tools) #22

Closed haasn closed 6 years ago

haasn commented 6 years ago

For the past few months, shaderc has failed to build for me via your ebuild. Checking out the google shaderc repository and building it in there works fine.

I'm using spirv-tools-9999, spirv-headers-9999 and glslang-9999 all built from the regular gentoo repository. That said, it's possible the issue is in one of those three places rather than your shaderc ebuild, since the upstream shaderc build guide involves checking out those three tools locally (into third_party), rather than using the system-wide versions.

Build log:

 * checking ebuild checksums ;-) ...                                     [ ok ]
>>> Unpacking source...
 * Fetching https://github.com/google/shaderc.git ...
git fetch https://github.com/google/shaderc.git +HEAD:refs/git-r3/HEAD
git symbolic-ref refs/git-r3/dev-util/shaderc/0/__main__ refs/git-r3/HEAD
 * Checking out https://github.com/google/shaderc.git to /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 ...
git checkout --quiet refs/git-r3/HEAD
GIT update -->
   repository:               https://github.com/google/shaderc.git
   at the commit:            be8e0879750303a1de09385465d6b20ecb8b380d
>>> Source unpacked in /var/tmp/portage/dev-util/shaderc-9999/work
>>> Preparing source in /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 ...
grep: /usr/share/doc/SPIRV-Tools-*/CHANGES: No such file or directory
grep: /usr/include/spirv-tools/spirv_tools_commit_id.h: No such file or directory
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64"
cmake -C /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_RPATH=True -DSHADERC_SKIP_TESTS=True -DCMAKE_C_FLAGS=-march=native -O2 -g -DCMAKE_CXX_FLAGS=-march=native -O2 -g -DCMAKE_LD_FLAGS=-Wl,-O1 -Wl,--as-needed -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/gentoo_rules.cmake -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/gentoo_toolchain.cmake  /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999
loading initial cache file /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/gentoo_common_config.cmake
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Shaderc: build type is "Gentoo".
-- Configuring Shaderc to avoid building tests.
-- nosetests was not found - python code will not be tested
-- asciidoctor was not found - no documentation will be generated
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- <<< Gentoo configuration >>>
Build type      Gentoo
Install path    /usr
Compiler flags:
C               -march=native -O2 -g
C++             -march=native -O2 -g
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

-- Configuring done
CMake Warning (dev) at glslc/CMakeLists.txt:29 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "build-version" of target "glslc_exe" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_LD_FLAGS

-- Build files have been written to: /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_compile
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64"
make -j32 -l32 VERBOSE=1 
/usr/bin/cmake -H/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 -B/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f CMakeFiles/check-copyright.dir/build.make CMakeFiles/check-copyright.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/check-copyright.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/check-copyright.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/check-copyright.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/CMakeFiles/check-copyright.dir/depend.internal".
Scanning dependencies of target check-copyright
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f CMakeFiles/check-copyright.dir/build.make CMakeFiles/check-copyright.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[  3%] Check copyright
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 && /usr/bin/python /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/utils/add_copyright.py --check
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[  3%] Built target check-copyright
make -f libshaderc_util/CMakeFiles/shaderc_util.dir/build.make libshaderc_util/CMakeFiles/shaderc_util.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util/CMakeFiles/shaderc_util.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util/CMakeFiles/shaderc_util.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util/CMakeFiles/shaderc_util.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util/CMakeFiles/shaderc_util.dir/depend.internal".
Scanning dependencies of target shaderc_util
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f libshaderc_util/CMakeFiles/shaderc_util.dir/build.make libshaderc_util/CMakeFiles/shaderc_util.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[  7%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/compiler.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/compiler.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/compiler.cc
[ 11%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/version_profile.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/version_profile.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/version_profile.cc
[ 15%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/spirv_tools_wrapper.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/spirv_tools_wrapper.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/spirv_tools_wrapper.cc
[ 19%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/shader_stage.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/shader_stage.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/shader_stage.cc
[ 23%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/resources.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/resources.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/resources.cc
[ 26%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/message.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/message.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/message.cc
[ 30%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/io.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/io.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/io.cc
[ 34%] Building CXX object libshaderc_util/CMakeFiles/shaderc_util.dir/src/file_finder.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_util.dir/src/file_finder.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/src/file_finder.cc
[ 38%] Linking CXX static library libshaderc_util.a
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/cmake -P CMakeFiles/shaderc_util.dir/cmake_clean_target.cmake
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc_util && /usr/bin/cmake -E cmake_link_script CMakeFiles/shaderc_util.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-ar qc libshaderc_util.a  CMakeFiles/shaderc_util.dir/src/compiler.cc.o CMakeFiles/shaderc_util.dir/src/file_finder.cc.o CMakeFiles/shaderc_util.dir/src/io.cc.o CMakeFiles/shaderc_util.dir/src/message.cc.o CMakeFiles/shaderc_util.dir/src/resources.cc.o CMakeFiles/shaderc_util.dir/src/shader_stage.cc.o CMakeFiles/shaderc_util.dir/src/spirv_tools_wrapper.cc.o CMakeFiles/shaderc_util.dir/src/version_profile.cc.o
/usr/bin/x86_64-pc-linux-gnu-ranlib libshaderc_util.a
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 38%] Built target shaderc_util
make -f libshaderc/CMakeFiles/shaderc_shared.dir/build.make libshaderc/CMakeFiles/shaderc_shared.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_shared.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_shared.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_shared.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_shared.dir/depend.internal".
Scanning dependencies of target shaderc_shared
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f libshaderc/CMakeFiles/shaderc_shared.dir/build.make libshaderc/CMakeFiles/shaderc_shared.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 42%] Building CXX object libshaderc/CMakeFiles/shaderc_shared.dir/src/shaderc.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/x86_64-pc-linux-gnu-g++ -DSHADERC_IMPLEMENTATION -DSHADERC_SHAREDLIB -Dshaderc_shared_EXPORTS -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc/include -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g -fPIC   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc_shared.dir/src/shaderc.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc/src/shaderc.cc
[ 46%] Linking CXX shared library libshaderc_shared.so
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/cmake -E cmake_link_script CMakeFiles/shaderc_shared.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -march=native -O2 -g -Wl,-O1 -Wl,--as-needed -shared -Wl,-soname,libshaderc_shared.so -o libshaderc_shared.so CMakeFiles/shaderc_shared.dir/src/shaderc.cc.o -lglslang -lOSDependent -lOGLCompiler -lglslang -lpthread ../libshaderc_util/libshaderc_util.a -lSPIRV -lSPIRV-Tools -lHLSL -lglslang -lOSDependent -lOGLCompiler -lglslang -lOSDependent -lOGLCompiler -lSPIRV -lSPIRV-Tools-opt -lpthread 
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 46%] Built target shaderc_shared
make -f libshaderc/CMakeFiles/shaderc.dir/build.make libshaderc/CMakeFiles/shaderc.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc.dir/depend.internal".
Scanning dependencies of target shaderc
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f libshaderc/CMakeFiles/shaderc.dir/build.make libshaderc/CMakeFiles/shaderc.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 50%] Building CXX object libshaderc/CMakeFiles/shaderc.dir/src/shaderc.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc/include -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc_util/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc.dir/src/shaderc.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc/src/shaderc.cc
[ 53%] Linking CXX static library libshaderc.a
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/cmake -P CMakeFiles/shaderc.dir/cmake_clean_target.cmake
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/cmake -E cmake_link_script CMakeFiles/shaderc.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-ar qc libshaderc.a  CMakeFiles/shaderc.dir/src/shaderc.cc.o
/usr/bin/x86_64-pc-linux-gnu-ranlib libshaderc.a
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 53%] Built target shaderc
make -f libshaderc/CMakeFiles/shaderc_combined_genfile.dir/build.make libshaderc/CMakeFiles/shaderc_combined_genfile.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/depend.internal".
Scanning dependencies of target shaderc_combined_genfile
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f libshaderc/CMakeFiles/shaderc_combined_genfile.dir/build.make libshaderc/CMakeFiles/shaderc_combined_genfile.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 57%] Generating libshaderc_combined.a
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/libshaderc && /usr/bin/x86_64-pc-linux-gnu-ar -M < shaderc_combined.ar
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 57%] Built target shaderc_combined_genfile
make -f examples/online-compile/CMakeFiles/shaderc-online-compile.dir/build.make examples/online-compile/CMakeFiles/shaderc-online-compile.dir/depend
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/examples/online-compile /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64 /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile/CMakeFiles/shaderc-online-compile.dir/DependInfo.cmake
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile/CMakeFiles/shaderc-online-compile.dir/DependInfo.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile/CMakeFiles/shaderc-online-compile.dir/depend.internal".
Dependee "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile/CMakeFiles/shaderc-online-compile.dir/depend.internal".
Scanning dependencies of target shaderc-online-compile
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make -f examples/online-compile/CMakeFiles/shaderc-online-compile.dir/build.make examples/online-compile/CMakeFiles/shaderc-online-compile.dir/build
make[2]: Entering directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
[ 61%] Building CXX object examples/online-compile/CMakeFiles/shaderc-online-compile.dir/main.cc.o
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile && /usr/bin/x86_64-pc-linux-gnu-g++  -I/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/libshaderc/include   -DNDEBUG -march=native -O2 -g   -Wall -Werror -fvisibility=hidden -fPIC -std=c++11 -o CMakeFiles/shaderc-online-compile.dir/main.cc.o -c /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999/examples/online-compile/main.cc
[ 65%] Linking CXX executable shaderc-online-compile
cd /var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64/examples/online-compile && /usr/bin/cmake -E cmake_link_script CMakeFiles/shaderc-online-compile.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++  -march=native -O2 -g  -Wl,-O1 -Wl,--as-needed -rdynamic CMakeFiles/shaderc-online-compile.dir/main.cc.o  -o shaderc-online-compile ../../libshaderc/libshaderc.a ../../libshaderc_util/libshaderc_util.a -lHLSL -lglslang -lOSDependent -lOGLCompiler -lglslang -lOSDependent -lOGLCompiler -lSPIRV-Tools-opt -lpthread -lSPIRV -lSPIRV-Tools 
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../lib64/libglslang.a(ShaderLang.cpp.o): In function `(anonymous namespace)::CreateBuiltInParseables(TInfoSink&, glslang::EShSource)':
/var/tmp/portage/dev-util/glslang-9999/work/glslang-9999/glslang/MachineIndependent/ShaderLang.cpp:84: undefined reference to `glslang::TBuiltInParseablesHlsl::TBuiltInParseablesHlsl()'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../lib64/libglslang.a(ShaderLang.cpp.o): In function `ShInitialize':
/var/tmp/portage/dev-util/glslang-9999/work/glslang-9999/glslang/MachineIndependent/ShaderLang.cpp:1210: undefined reference to `glslang::HlslScanContext::fillInKeywordMap()'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../lib64/libglslang.a(ShaderLang.cpp.o): In function `ShFinalize':
/var/tmp/portage/dev-util/glslang-9999/work/glslang-9999/glslang/MachineIndependent/ShaderLang.cpp:1312: undefined reference to `glslang::HlslScanContext::deleteKeywordMap()'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/../../../../lib64/libglslang.a(ShaderLang.cpp.o): In function `(anonymous namespace)::CreateParseContext(glslang::TSymbolTable&, glslang::TIntermediate&, int, EProfile, glslang::EShSource, EShLanguage, TInfoSink&, glslang::SpvVersion, bool, EShMessages, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/var/tmp/portage/dev-util/glslang-9999/work/glslang-9999/glslang/MachineIndependent/ShaderLang.cpp:111: undefined reference to `glslang::HlslParseContext::HlslParseContext(glslang::TSymbolTable&, glslang::TIntermediate&, bool, int, EProfile, glslang::SpvVersion const&, EShLanguage, TInfoSink&, std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char> >, bool, EShMessages)'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/online-compile/CMakeFiles/shaderc-online-compile.dir/build.make:86: examples/online-compile/shaderc-online-compile] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make[1]: *** [CMakeFiles/Makefile2:513: examples/online-compile/CMakeFiles/shaderc-online-compile.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
make: *** [Makefile:141: all] Error 2
 * ERROR: dev-util/shaderc-9999::gentoo-gpu failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-util/shaderc-9999::gentoo-gpu'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/shaderc-9999::gentoo-gpu'`.
 * The complete build log is located at '/var/tmp/portage/dev-util/shaderc-9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/shaderc-9999/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999-abi_x86_64.amd64'
 * S: '/var/tmp/portage/dev-util/shaderc-9999/work/shaderc-9999'
haasn commented 6 years ago

For starters, it appears that some changes are needed to deal with the difference in the naming of your SPIRV-Tools and gentoo's official spirv-tools ebuilds. Specifically, this .diff seems to fix the generation of build-version.inc:

diff --git a/dev-util/shaderc/Manifest b/dev-util/shaderc/Manifest
index 3ea4abb..a6ee97f 100644
--- a/dev-util/shaderc/Manifest
+++ b/dev-util/shaderc/Manifest
@@ -1 +1 @@
-EBUILD shaderc-9999.ebuild 1593 SHA256 b5a40bce7c2f6256d10e7150f9b94d100e6bf04573b10623d04d7c577b767932 SHA512 54f17db57f178582d909588812bcafed2b8228d1eb1a5a791ce96556b53f62d1cc054d0a56fe8ddf1ad6faea8a91ff4a056c0edf39476335acb9d54aa5228944 WHIRLPOOL 098dc8057c6a35b5819c3529b248906659f3b9d788a286d505a7063bce63aca8eba14c41f052a2bb176594658606068aa0f29192aa5dbe2baf74334448b25ca1
+EBUILD shaderc-9999.ebuild 1596 BLAKE2B 6864824111ff9730f12dc9f41dd2c9c2aced77b97b868cdf90724f5d6293eff5d3a7716aaf2481c49715f26fdc9612ed998526af3d9ec4507834b92fd841d3bc SHA512 71706bf3d48d589d0b22cef84f1ca93f2819b96911868845a842b4fdd7ddcce9a1e468cbcbc784a243af8929a2a463a9cbf63935fc846d63f92476ee81f003a7
diff --git a/dev-util/shaderc/shaderc-9999.ebuild b/dev-util/shaderc/shaderc-9999.ebuild
index 939a862..6c2a33d 100644
--- a/dev-util/shaderc/shaderc-9999.ebuild
+++ b/dev-util/shaderc/shaderc-9999.ebuild
@@ -25,7 +25,7 @@ IUSE=""
 RDEPEND=""
 DEPEND="${PYTHON_DEPS}
    dev-util/glslang:=
-   dev-util/SPIRV-Tools:=[${MULTILIB_USEDEP}]"
+   dev-util/spirv-tools:=[${MULTILIB_USEDEP}]"

 src_prepare() {
    cmake-utils_src_prepare
@@ -35,10 +35,10 @@ src_prepare() {
        CMakeLists.txt || die sed failed

    # Create build-version.inc since we want to use our packaged
-   # SPIRV-Tools and glslang
+   # spirv-tools and glslang
    echo \"shaderc $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\?' CHANGES) $(git describe)\" \
        > glslc/src/build-version.inc
-   echo \"spirv-tools $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\?' /usr/share/doc/SPIRV-Tools-*/CHANGES) $(grep -o '[[:xdigit:]]\{40\}' /usr/include/spirv-tools/spirv_tools_commit_id.h)\" \
+   echo \"spirv-tools $(bzgrep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\?' /usr/share/doc/spirv-tools-*/CHANGES.bz2) $(grep -o '[[:xdigit:]]\{40\}' /usr/include/spirv-tools/spirv-tools-commit.h)\" \
        >> glslc/src/build-version.inc
    echo \"glslang \'\'\" >> glslc/src/build-version.inc

This alone does not appear to be sufficient to solve the build error, however.

haasn commented 6 years ago

Digging into this issue a bit further: While poking around the various .a's installed by dev-util/glslang, I noticed that libglslang.a doesn't provide the relevant symbols (they're undefined) - instead, they're provided by libHLSL.a. This is true for both the libglslang.a built from third_party as well as the one available system-wide. But comparing the linker command run for the third_party version and your version reveals the following difference:

 /usr/bin/c++  -O2 -g -DNDEBUG  -rdynamic examples/online-compile/CMakeFiles/shaderc-online-compile.dir/main.cc.o  -o examples/online-compile/shaderc-online-compile  libshaderc/libshaderc.a libshaderc_util/libshaderc_util.a -lHLSL -lglslang -lOSDependent -lOGLCompiler -lglslang -lOSDependent -lOGLCompiler -lSPIRV-Tools-opt -lpthread -lSPIRV -lSPIRV-Tools

versus

 /usr/bin/c++  -O2 -g -DNDEBUG  -rdynamic examples/online-compile/CMakeFiles/shaderc-online-compile.dir/main.cc.o  -o examples/online-compile/shaderc-online-compile  libshaderc/libshaderc.a libshaderc_util/libshaderc_util.a -lpthread third_party/glslang/SPIRV/libSPIRV.a third_party/glslang/glslang/libglslang.a third_party/glslang/glslang/OSDependent/Unix/libOSDependent.a third_party/glslang/OGLCompilersDLL/libOGLCompiler.a third_party/glslang/hlsl/libHLSL.a third_party/spirv-tools/source/opt/libSPIRV-Tools-opt.a third_party/spirv-tools/source/libSPIRV-Tools.a

The order is different. In particular, libHLSL is specified much later in the one based on third_party. This is why it works.

I've found a work-around, which is to apply the following diff onto the source tree:

commit 40cea483d9a1c20f01e677222e572ae46881c6c9
Author: Niklas Haas <git@haasn.xyz>
Date:   Tue May 29 07:34:00 2018 +0200

    Fix the link order of libglslang and libHLSL

    libglslang depends on libHLSL, so the latter needs to be specified last.
    This fixes an issue when trying to build shaderc against system-wide
    versions of libglslang/libHLSL, rather than the in-tree versions from
    third_party.

diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
index acf6fb0..0f5d888 100644
--- a/glslc/CMakeLists.txt
+++ b/glslc/CMakeLists.txt
@@ -18,7 +18,7 @@ add_library(glslc STATIC
 shaderc_default_compile_options(glslc)
 target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
 target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
+  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
 target_link_libraries(glslc PRIVATE shaderc_util shaderc)

 add_executable(glslc_exe src/main.cc)
diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
index 873540a..f4aaddc 100644
--- a/libshaderc_util/CMakeLists.txt
+++ b/libshaderc_util/CMakeLists.txt
@@ -34,7 +34,7 @@ endif(SHADERC_ENABLE_INSTALL)

 find_package(Threads)
 target_link_libraries(shaderc_util PRIVATE
-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
+  glslang OSDependent OGLCompiler glslang HLSL SPIRV
   SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})

 shaderc_add_tests(

I guess I'll attempt to get this upstreamed in the meantime.

haasn commented 6 years ago

cf. https://github.com/google/shaderc/pull/463

haasn commented 6 years ago

Hmm, seems we are not done here. That diff makes it build, but trying to link against the resulting .so still fails with unresolved symbols from libSPIRV-Tools.a, which is particularly odd because my /usr/lib/libSPIRV-Tools.a definitely provides the symbols it's complaining about.

haasn commented 6 years ago

It gets worse: I went back to SPIRV-Tools and glslang from your gentoo-gpu overlay (rather than the upstream ones from portage), and I ran into the exact same issue; both needing the patch to build at all as well as running into link errors when trying to use the resulting .so.

I also tried going back to an older commit (from the same date when shaderc was last built successfully for me) but I ran into the same issue. So now I'm at my wit's end, and I have no idea how I ever managed to build shaderc at all; unless it's related to some unrelated third party dependncy (e.g. gcc version)?

haasn commented 6 years ago

The only good news here is that building shaderc against the included third_party libraries does still work successfully. So whatever the issue is, it's surely still somehow connected to that.

haasn commented 6 years ago

Okay, I found a work-around by examining the link order some more. This is the final diff that fixes all of the linking issues for me:

commit 21c8be385b3fab5edcb934a6d99f69fd389c4e67
Author: Niklas Haas <git@haasn.xyz>
Date:   Tue May 29 07:34:00 2018 +0200

    Fix the link order of libglslang and libHLSL

    libglslang depends on libHLSL, so the latter needs to be specified last.
    This fixes an issue when trying to build shaderc against system-wide
    versions of libglslang/libHLSL, rather than the in-tree versions from
    third_party.

    Additionally, libshaderc_util also depends on SPIRV-Tools

diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
index acf6fb0..0f5d888 100644
--- a/glslc/CMakeLists.txt
+++ b/glslc/CMakeLists.txt
@@ -18,7 +18,7 @@ add_library(glslc STATIC
 shaderc_default_compile_options(glslc)
 target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
 target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
+  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
 target_link_libraries(glslc PRIVATE shaderc_util shaderc)

 add_executable(glslc_exe src/main.cc)
diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
index 873540a..6d0c465 100644
--- a/libshaderc_util/CMakeLists.txt
+++ b/libshaderc_util/CMakeLists.txt
@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)

 find_package(Threads)
 target_link_libraries(shaderc_util PRIVATE
-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
+  glslang OSDependent OGLCompiler glslang HLSL SPIRV
+  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})

 shaderc_add_tests(
   TEST_PREFIX shaderc_util
sjnewbury commented 6 years ago

@haasn Awesome work tracking that down. I feel the need to apologise for my absence, I took too many things on and got a little burnt out with package maintenance. I've been fixing things up, and dropping old obsolete packages and going through my message backlog.

haasn commented 6 years ago

@sjnewbury No apologies needed. It the meantime it seems gentoo has included shaderc in their main repositories, so I personally don't need to use gentoo-gpu for these anymore. And it looks as though they incorporated my fix already.

sjnewbury commented 6 years ago

I guess I have a few more obsolete packages to drop. It's not really a bad thing! :-) I saw they're even looking to get glvnd supported in the main tree. I think there's still a few useful features in my overlay to make it worth updating and maintaining a while longer, but hopefully it won't be needed eventually.