Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error when using -DCMAKE_CXX_COMPILER #337

Open
stoecker opened this issue Dec 19, 2021 · 1 comment
Open

Compilation error when using -DCMAKE_CXX_COMPILER #337

stoecker opened this issue Dec 19, 2021 · 1 comment

Comments

@stoecker
Copy link

LibreSprite version

1.0

Describe the bug

libduktape.a is compiled with a different compiler than the rest of the software:

...
BUILD/LibreSprite-1.0/build/src/script && /usr/bin/cc -DHAVE_CONFIG_H -DNDEBUG -DSCRIPT_ENGINE_LUA=1 -DUSE_SDL2_BACKEND -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/lua5.3 -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/third_party/simpleini -I/usr/include/SDL2 -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/. -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/.. -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/../third_party -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/observable -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/build/src/base -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/third_party/duktape -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -DNDEBUG -O2 -g -DNDEBUG -MD -MT src/script/CMakeFiles/duktape.dir/__/__/third_party/duktape/duktape.c.o -MF CMakeFiles/duktape.dir/__/__/third_party/duktape/duktape.c.o.d -o CMakeFiles/duktape.dir/__/__/third_party/duktape/duktape.c.o -c /home/abuild/rpmbuild/BUILD/LibreSprite-1.0/third_party/duktape/duktape.c
[ 21%] Building CXX object src/css/CMakeFiles/css-lib.dir/sheet.cpp.o
cd /home/abuild/rpmbuild/BUILD/LibreSprite-1.0/build/src/css && /usr/bin/g++-10 -DHAVE_CONFIG_H -DNDEBUG -DSCRIPT_ENGINE_LUA=1 -DUSE_SDL2_BACKEND -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/lua5.3 -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/third_party/simpleini -I/usr/include/SDL2 -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/. -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/.. -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/../third_party -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/src/observable -I/home/abuild/rpmbuild/BUILD/LibreSprite-1.0/build/src/base -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -DNDEBUG -std=c++14 -Wall -Wno-switch -std=gnu++11 -O2 -g -DNDEBUG -MD -MT src/css/CMakeFiles/css-lib.dir/sheet.cpp.o -MF CMakeFiles/css-lib.dir/sheet.cpp.o.d -o CMakeFiles/css-lib.dir/sheet.cpp.o -c /home/abuild/rpmbuild/BUILD

First uses /usr/bin/cc (gcc11), second one as specified gcc10

Results in:

lto1: fatal error: bytecode stream in file '../lib/libduktape.a' generated with LTO version 11.2 instead of the expected 9.4
To Reproduce

Compile with recent gcc10-10.3.1 use option -DCMAKE_CXX_COMPILER=g++-10

OS/Hardware

Linux openSUSE Tumbleweed i586 or x86_64

Additional context

Complete build log (will change when package is updated!):
https://build.opensuse.org/package/live_build_log/games:tools/libresprite/openSUSE_Tumbleweed/i586

P.S.

For packaging it's recommended NOT to use embedded version, but rather the packaged ones of the OS.

@stoecker
Copy link
Author

Note - the live build log soon no longer shows the resulting build failure, as the option is now only used for openSUSE <= 15.4 where gcc7 and gcc10 are used which luckily have the same LTO bytecode stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant