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

Compiling 1.0.0-qt6 results in linking errors #69

Open
HurricanePootis opened this issue Aug 19, 2024 · 1 comment
Open

Compiling 1.0.0-qt6 results in linking errors #69

HurricanePootis opened this issue Aug 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@HurricanePootis
Copy link

System Information

Arch Linux
glibc 2.40+r16+gaa533d58ff
clang 18.1.8
binutils 2.43+r4+g7999dae6961

CXXFLAGS=-march=znver3 -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -flto=thin
CFLAGS=-march=znver3 -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=thin
LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs
cmake -B build -S mcpelauncher-ui-manifest \
 -DCMAKE_C_COMPILER=clang \    
  -DCMAKE_CXX_COMPILER=clang++ \    
  -DCMAKE_INSTALL_PREFIX=/usr \    
  -DCMAKE_BUILD_TYPE=None \
  -DENABLE_DEV_PATHS=OFF \
  -Wno-dev

Bug

Whenever compiling v1.0.0-qt6, the following error is printed towards the end:

[ 95%] Linking CXX executable gplayver
[ 96%] Building CXX object mcpelauncher-ui-qt/CMakeFiles/mcpelauncher-ui-qt.dir/encryption.cpp.o
[ 97%] Building CXX object mcpelauncher-ui-qt/CMakeFiles/mcpelauncher-ui-qt.dir/mcpelauncher-ui-qt_autogen/EJRQKI7XPS/qrc_translations.cpp.o
/usr/bin/ld: /usr/lib/libprotobuf.so: undefined reference to symbol '_ZN4absl12lts_2024072212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc'
/usr/bin/ld: /usr/lib/libabsl_log_internal_check_op.so.2407.0.0: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [google-play-api/CMakeFiles/gplaydl.dir/build.make:133: google-play-api/gplaydl] Error 1
make[1]: *** [CMakeFiles/Makefile2:483: google-play-api/CMakeFiles/gplaydl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /usr/lib/libprotobuf.so: undefined reference to symbol '_ZN4absl12lts_2024072212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc'
/usr/bin/ld: /usr/lib/libabsl_log_internal_check_op.so.2407.0.0: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [google-play-api/CMakeFiles/gplayver.dir/build.make:133: google-play-api/gplayver] Error 1
make[1]: *** [CMakeFiles/Makefile2:509: google-play-api/CMakeFiles/gplayver.dir/all] Error 2
[ 98%] Linking CXX executable mcpelauncher-ui-qt
/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../lib64/libprotobuf.so: undefined reference to symbol '_ZN4absl12lts_2024072212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc'
/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../lib64/libabsl_log_internal_check_op.so.2407.0.0: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [mcpelauncher-ui-qt/CMakeFiles/mcpelauncher-ui-qt.dir/build.make:792: mcpelauncher-ui-qt/mcpelauncher-ui-qt] Error 1
make[1]: *** [CMakeFiles/Makefile2:703: mcpelauncher-ui-qt/CMakeFiles/mcpelauncher-ui-qt.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Attempted fixes

  1. Building without LTO
  2. Building without -Wp,-D_FORTIFY_SOURCE=3
  3. Building with no flags at all
@HurricanePootis HurricanePootis added the bug Something isn't working label Aug 19, 2024
@HurricanePootis
Copy link
Author

I fixed it with the following:

-DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries

Looks like for some reason, these options fixes the issue. Still gonna keep this open cause I still don't know why this is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant