diasurgical / devilutionX

Diablo build for modern operating systems
Other
8.1k stars 796 forks source link

./build.sh rg350 fails on Ubuntu 20.04.2 - lto1: fatal error: bytecode stream in file ‘libsmacker.a’ generated with GCC compiler older than 10.0 #2102

Closed john-parton closed 3 years ago

john-parton commented 3 years ago

I'm on commit 608c231f467b855ff5ac81315e0e6b66e63d5226 (master)

Deleted my old buildroot and ran ./build.sh rg350

Got the following error

john@---:~/Code/projects/devilutionX/Packaging/OpenDingux$ ./build.sh rg350
Building for target rg350 in build-rg350
+ [[ -n /home/john/devilutionx-buildroots/rg350 ]]
+ prepare_buildroot
+ [[ -d /home/john/devilutionx-buildroots/rg350 ]]
+ return
+ make_buildroot
+ cd /home/john/devilutionx-buildroots/rg350
+ BR2_JLEVEL=0
+ make toolchain libzip sdl sdl_ttf
make[1]: Nothing to be done for 'libzip'.
make[1]: Nothing to be done for 'sdl'.
make[1]: Nothing to be done for 'sdl_ttf'.
+ cd -
/home/john/Code/projects/devilutionX
+ build
+ rm -f build-rg350/CMakeCache.txt
+ build_release
+ cmake_configure -DCMAKE_BUILD_TYPE=Release
+ cmake -S. -Bbuild-rg350 -DTARGET_PLATFORM=rg350 -DCMAKE_TOOLCHAIN_FILE=/home/john/devilutionx-buildroots/rg350/output/host/usr/share/buildroot/toolchainfile.cmake -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: /home/john/devilutionx-buildroots/rg350/output/host/usr/bin/mipsel-gcw0-linux-uclibc-gcc
-- Check for working C compiler: /home/john/devilutionx-buildroots/rg350/output/host/usr/bin/mipsel-gcw0-linux-uclibc-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: /home/john/devilutionx-buildroots/rg350/output/host/usr/bin/mipsel-gcw0-linux-uclibc-g++
-- Check for working CXX compiler: /home/john/devilutionx-buildroots/rg350/output/host/usr/bin/mipsel-gcw0-linux-uclibc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /home/john/devilutionx-buildroots/rg350/output/host/usr/bin/pkg-config (found version "1.6.3") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found SDL: /home/john/devilutionx-buildroots/rg350/output/host/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/libSDLmain.a;/home/john/devilutionx-buildroots/rg350/output/host/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/libSDL.so (found version "1.2.16") 
-- Performing Test HAVE_STD_CLAMP
-- Performing Test HAVE_STD_CLAMP - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Suitable system fmt package not found, will use fmt from source
-- Version: TRUE7.1.3
-- Build type: Release
-- CXX_STANDARD: 17
-- Performing Test has_std_17_flag
-- Performing Test has_std_17_flag - Success
-- Performing Test has_std_1z_flag
-- Performing Test has_std_1z_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Looking for strtod_l
-- Looking for strtod_l - not found
-- Found SDL_ttf: /home/john/devilutionx-buildroots/rg350/output/host/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/libSDL_ttf.so (found version "2.0.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/john/Code/projects/devilutionX/build-rg350
+ cmake_build
++ getconf _NPROCESSORS_ONLN
+ cmake --build build-rg350 -j 8
Scanning dependencies of target PKWare
Scanning dependencies of target StormLib
Scanning dependencies of target smacker
[  1%] Built target PKWare
[  9%] Built target SDL_audiolib
[ 10%] Built target fmt
[ 17%] Built target StormLib
[ 20%] Built target smacker
Scanning dependencies of target libdevilutionx
[ 98%] Built target libdevilutionx
Scanning dependencies of target devilutionx
[ 99%] Linking CXX executable devilutionx
lto1: fatal error: bytecode stream in file ‘libsmacker.a’ generated with GCC compiler older than 10.0
compilation terminated.
lto-wrapper: fatal error: /home/john/devilutionx-buildroots/rg350/output/host/bin/mipsel-gcw0-linux-uclibc-g++.br_real returned 1 exit status
compilation terminated.
/home/john/devilutionx-buildroots/rg350/output/host/lib/gcc/mipsel-gcw0-linux-uclibc/10.2.0/../../../../mipsel-gcw0-linux-uclibc/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/devilutionx.dir/build.make:361: devilutionx] Error 1
make[1]: *** [CMakeFiles/Makefile2:182: CMakeFiles/devilutionx.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
john-parton commented 3 years ago

Okay, I was having some other issues with my system that I couldn't explain, so I did a fresh install of my OS, this time Ubuntu 21.04, and the build appears to have worked.

Maybe an issue specific to Ubuntu 20.04, or maybe just my system.

EDIT

Built with current master works correctly on my RG350M