Skip to content

Commit 0cff34e

Browse files
committed
devel/libffi: fix build with lld 17
As reported in bug 273753#c12, devel/libffi fails to link with lld 17, at least on i386: libtool: link: cc -shared -fPIC -DPIC src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/.libs/tramp.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o -O2 -fstack-protector-strong -Wl,--version-script -Wl,libffi.map -fstack-protector-strong -Wl,-soname -Wl,libffi.so.8 -o .libs/libffi.so.8.1.2 ld: error: version script assignment of 'LIBFFI_BASE_8.0' to symbol 'ffi_java_raw_call' failed: symbol not defined ld: error: version script assignment of 'LIBFFI_CLOSURE_8.0' to symbol 'ffi_prep_java_raw_closure' failed: symbol not defined ld: error: version script assignment of 'LIBFFI_CLOSURE_8.0' to symbol 'ffi_prep_java_raw_closure_loc' failed: symbol not defined cc: error: linker command failed with exit code 1 (use -v to see invocation) This is because the symbols it complains about are not implemented on i386, due to the FFI_NATIVE_RAW_API define being nonzero. Fix it by adding more #if statements to libffi.map.in. PR: 274056 Approved by: kbowling (maintainer) MFH: 2023Q3
1 parent b26a85b commit 0cff34e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--- libffi.map.in.orig 2022-10-23 15:23:27 UTC
2+
+++ libffi.map.in
3+
@@ -33,7 +33,9 @@ LIBFFI_BASE_8.0 {
4+
ffi_raw_to_ptrarray;
5+
ffi_raw_size;
6+
7+
+#if !FFI_NATIVE_RAW_API
8+
ffi_java_raw_call;
9+
+#endif
10+
ffi_java_ptrarray_to_raw;
11+
ffi_java_raw_to_ptrarray;
12+
ffi_java_raw_size;
13+
@@ -62,8 +64,10 @@ LIBFFI_CLOSURE_8.0 {
14+
ffi_prep_closure_loc;
15+
ffi_prep_raw_closure;
16+
ffi_prep_raw_closure_loc;
17+
+#if !FFI_NATIVE_RAW_API
18+
ffi_prep_java_raw_closure;
19+
ffi_prep_java_raw_closure_loc;
20+
+#endif
21+
} LIBFFI_BASE_8.0;
22+
#endif
23+

0 commit comments

Comments
 (0)