mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
d932886d6e
The build was failing with the following error: ``` [18950/51180] SOLINK ./libvk_swiftshader.sotls_transport_interface/dtls_transport_interface.omputils.o[K.otch.oos.oKx/unbundle:default)fault)ault) FAILED: libvk_swiftshader.so libvk_swiftshader.so.TOC python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libvk_swiftshader.so" --tocfile="./libvk_swiftshader.so.TOC" --output="./libvk_swiftshader.so" -- clang++ -shared -Wl,-soname="libvk_swiftshader.so" -Wl,-Bsymbolic -Wl,--version-script=../../third_party/swiftshader/src/Vulkan/vk_swiftshader.lds -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -fsanitize=cfi-vcall -fsanitize=cfi-icall -o "./libvk_swiftshader.so" @"./libvk_swiftshader.so.rsp" ld.lld: error: unable to find library -l:libffi_pic.a clang++: error: linker command failed with exit code 1 (use -v to see invocation) ``` This turned out to be a regression fromb6b51374fc
. That change was bad/undesirable in the first place and I only applied it to quickly fix another build error caused by incompatible wayland-protocols header files from a newer system version (Chromium bundles version 1.21 while we already package 1.26). The better fix for that wayland-protocols build issue is to pull in a patch that is already used/tested by the Arch package [0] and seems to originate from [1] (not sure if that patch was formally submitted yet). Alternatives to that patch would be to (we should probably first try the first approach if need be): 1) Build with wayland-protocols 1.21 from the system (by overriding the Nixpkgs package). 2) Dynamically link against libffi by patching [2] to use the other branch (`default_toolchain == "//build/toolchain/cros:target"`). Some additional details can be found in the GitHub PR [3]. Huge thanks to Lorenz Brun for his great analysis that enabled me to fix the build so that we can finally merge the update to Chromium M105 (which contains many important security fixes!). [0]:a353833a5a
[1]: https://bugs.chromium.org/p/angleproject/issues/detail?id=7582#c1 [2]: https://source.chromium.org/chromium/chromium/src/+/refs/tags/105.0.5195.52:build/config/linux/libffi/BUILD.gn [3]: https://github.com/NixOS/nixpkgs/pull/189033 Co-Authored-By: Lorenz Brun <lorenz@brun.one>
39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
diff -upr a/third_party/angle/BUILD.gn b/third_party/angle/BUILD.gn
|
|
--- a/third_party/angle/BUILD.gn 2022-08-17 19:38:11.000000000 +0000
|
|
+++ b/third_party/angle/BUILD.gn 2022-08-18 11:04:09.061751111 +0000
|
|
@@ -489,6 +489,12 @@ config("angle_vulkan_wayland_config") {
|
|
if (angle_enable_vulkan && angle_use_wayland &&
|
|
defined(vulkan_wayland_include_dirs)) {
|
|
include_dirs = vulkan_wayland_include_dirs
|
|
+ } else if (angle_enable_vulkan && angle_use_wayland) {
|
|
+ include_dirs = [
|
|
+ "$wayland_gn_dir/src/src",
|
|
+ "$wayland_gn_dir/include/src",
|
|
+ "$wayland_gn_dir/include/protocol",
|
|
+ ]
|
|
}
|
|
}
|
|
|
|
@@ -1073,6 +1079,7 @@ if (angle_use_wayland) {
|
|
include_dirs = [
|
|
"$wayland_dir/egl",
|
|
"$wayland_dir/src",
|
|
+ "$wayland_gn_dir/include/protocol",
|
|
]
|
|
}
|
|
|
|
diff -upr a/third_party/angle/src/third_party/volk/BUILD.gn b/third_party/angle/src/third_party/volk/BUILD.gn
|
|
--- a/third_party/angle/src/third_party/volk/BUILD.gn 2022-08-17 19:38:12.000000000 +0000
|
|
+++ b/third_party/angle/src/third_party/volk/BUILD.gn 2022-08-18 11:04:36.499828006 +0000
|
|
@@ -21,6 +21,9 @@ source_set("volk") {
|
|
configs += [ "$angle_root:angle_no_cfi_icall" ]
|
|
public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ]
|
|
if (angle_use_wayland) {
|
|
- include_dirs = [ "$wayland_dir/src" ]
|
|
+ include_dirs = [
|
|
+ "$wayland_dir/src",
|
|
+ "$wayland_gn_dir/include/protocol",
|
|
+ ]
|
|
}
|
|
}
|