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

Build failure: Linking error with libdart_ffi.so (relocation R_X86_64_32S) #3898

Open
ntorresalberto opened this issue Jan 24, 2025 · 0 comments

Comments

@ntorresalberto
Copy link

While building Multipass, the build process fails during the linking stage with the following error:

[ 56%] Linking CXX static library libcommands.a
[ 56%] Built target commands
[ 56%] Building CXX object src/client/cli/formatter/CMakeFiles/formatter.dir/csv_formatter.cpp.o
[ 56%] Building CXX object src/client/cli/formatter/CMakeFiles/formatter.dir/format_utils.cpp.o
[ 56%] Building CXX object src/client/cli/formatter/CMakeFiles/formatter.dir/json_formatter.cpp.o
[ 57%] Building CXX object src/client/cli/formatter/CMakeFiles/formatter.dir/table_formatter.cpp.o
[ 57%] Building CXX object src/client/cli/formatter/CMakeFiles/formatter.dir/yaml_formatter.cpp.o
[ 57%] Linking CXX static library libformatter.a
[ 57%] Built target formatter
[ 57%] Building CXX object src/client/cli/CMakeFiles/client.dir/argparser.cpp.o
[ 58%] Building CXX object src/client/cli/CMakeFiles/client.dir/client.cpp.o
[ 58%] Linking CXX static library libclient.a
[ 58%] Built target client
[ 58%] Building CXX object src/client/cli/CMakeFiles/multipass.dir/main.cpp.o
[ 58%] Linking CXX executable ../../../bin/multipass
[ 58%] Built target multipass
[ 58%] Building CXX object src/client/gui/CMakeFiles/dart_ffi.dir/ffi/dart_ffi.cpp.o
[ 58%] Linking CXX shared library ../../../lib/libdart_ffi.so
/usr/bin/ld: ../../../3rd-party/xz-decoder/libxz-embedded.a(xz_crc32.c.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/client/gui/CMakeFiles/dart_ffi.dir/build.make:216: lib/libdart_ffi.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:2349: src/client/gui/CMakeFiles/dart_ffi.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Environment

OS: Fedora 41
Compiler: Clang 19.1.5
CMake Version: 3.30.5
Multipass Version: main

Solution

I can provide a seemingly harmless one-line PR to add the -fPIC flag when compiling libxz-embedded, which should resolve this issue without impacting other parts of the build. Let me know if that would be helpful

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

No branches or pull requests

1 participant