From d9555a425b4c0c081a913a7026d6273eb787e8e4 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 19 Nov 2024 13:24:21 +0000 Subject: [PATCH] V8: fix relocation error ``` ld.lld: error: relocation R_X86_64_TPOFF32 against v8::internal::g_current_local_heap_ cannot be used with -shared ld.lld: error: relocation R_386_TLS_LE against v8::internal::g_current_isolate_ cannot be used with -shared ld.lld: error: relocation R_ARM_TLS_LE32 against v8::internal::g_current_isolate_ cannot be used with -shared ld.lld: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v8::internal::g_current_local_heap_ cannot be used with -shared relocation R_X86_64_TPOFF32 against hidden symbol `_ZN2v88internal18g_current_isolate_E' can not be used when making a shared object ``` --- patches/linux/v8.patch | 12 ++++++++++++ steps/03-patch.sh | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 patches/linux/v8.patch diff --git a/patches/linux/v8.patch b/patches/linux/v8.patch new file mode 100644 index 00000000..1c3cc9a9 --- /dev/null +++ b/patches/linux/v8.patch @@ -0,0 +1,12 @@ +diff --git a/BUILD.gn b/BUILD.gn +index 6a4efbb03ee..9c0a45df4a5 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -1096,6 +1096,7 @@ config("features") { + + defines = + [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ] ++ defines += ["V8_TLS_USED_IN_LIBRARY"] + + configs = [ + ":v8_header_features", diff --git a/steps/03-patch.sh b/steps/03-patch.sh index 8d80f474..be22daa7 100755 --- a/steps/03-patch.sh +++ b/steps/03-patch.sh @@ -22,6 +22,10 @@ case "$OS" in [ "${PDFium_ENABLE_V8:-}" == "true" ] && git -C v8 apply -v "$PATCHES/ios/v8.patch" ;; + linux) + [ "${PDFium_ENABLE_V8:-}" == "true" ] && git -C v8 apply -v "$PATCHES/linux/v8.patch" + ;; + wasm) git apply -v "$PATCHES/wasm/pdfium.patch" git -C build apply -v "$PATCHES/wasm/build.patch"