ladybird: Build failures in Fedora 41 x86_64
Summary
Building on Fedora 41 on an x86_64 machine is currently running into a patchelf related build failure.
Reported upstream here at vcpkg: https://github.com/microsoft/vcpkg/issues/41576
And here at nixos/patchelf: https://github.com/NixOS/patchelf/issues/568
The issue can be worked around by the following steps:
rm -rf Build/vcpkgrm -rf Build/release(and any other Build/<preset> directories)- Apply the following patch to Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake
diff --git a/Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake b/Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake
index a43a4493d6..caa2ee7a1e 100644
--- a/Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake
+++ b/Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake
@@ -8,4 +8,6 @@ if (NOT "${CMAKE_CXX_COMPILER}" STREQUAL "")
string(APPEND EXTRA_VCPKG_VARIABLES "set(ENV{CXX} ${CMAKE_CXX_COMPILER})\n")
endif()
+string(APPEND EXTRA_VCPKG_VARIABLES "set(ENV{LDFLAGS} -Wl,-z,noseparate-code)\n")
+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/build-vcpkg-variables.cmake" "${EXTRA_VCPKG_VARIABLES}")
- Rebuild via
./Meta/ladybird.sh run
Operating system
Linux
Steps to reproduce
- Upgrade to Fedora 41
- Build ladybird via ./Meta/ladybird.sh
Expected behavior
Successful build
Actual behavior
A build failure similar to the following:
CMake Error at /home/jmansfield/src/github/serenityos/ladybird/Build/ladybird/vcpkg_installed/x64-linux/share/vcpkg-pkgconfig-get-modules/x_vcpkg_pkgconfig_get_modules.cmake:31 (execute_process):
execute_process failed command indexes:
1: "Abnormal exit with child return code: Segmentation fault"
Call Stack (most recent call first):
buildtrees/versioning_/versions/skia/76a242d24e0e810ad8c78e3deaef69d4b634e8fc/skia-functions.cmake:92 (x_vcpkg_pkgconfig_get_modules)
buildtrees/versioning_/versions/skia/76a242d24e0e810ad8c78e3deaef69d4b634e8fc/skia-functions.cmake:73 (third_party_from_pkgconfig)
buildtrees/versioning_/versions/skia/76a242d24e0e810ad8c78e3deaef69d4b634e8fc/portfile.cmake:242 (get_externals)
scripts/ports.cmake:192 (include)
error: building skia:x64-linux failed with: BUILD_FAILED
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 11
- Comments: 15 (5 by maintainers)
A user on discord was able to get the build working with none of the above steps, and only
edit: the patch here is now the steps in the top comment, I’ve edited it
Looking at some upstream fedora issues, this linker flag was a suggested workaround from a binutils developer.
A patched version of binutils to avoid the problem should be available in rawhide as the
-7release. https://bugzilla.redhat.com/show_bug.cgi?id=2321588#c41Though I’m not sure if they intend to backport that to 41, or still wait on the patchelf developers to make their tool work with the new default linker layout in fedora x86_64.
That last fix works for me! 🎉
@Michsior14 With
CC=clang CXX=clang++it still doesn’t build for me, but at least I get a different error! 🤷♂What I’m getting is a similar, but indeed different error. Still a
Segmentation fault(invcpkg, I assume), but while compilingffmpeg, notskia::thonk: The workaround isn’t working for me. So far I’ve tried:
sudo dnf install patchelfNot sure what else to try.