Skip to content

Commit

Permalink
Add an optional patch to fix missing symbol link error
Browse files Browse the repository at this point in the history
Similar in nature to rust-lang/rust#105967
I was getting the following at the final chrome link stage :-

ld.lld: error: version script assignment of 'global' to symbol \
'__libc_csu_fini' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol \
'__libc_csu_init' failed: symbol not defined

The explanation at https://reviews.llvm.org/D140591#4014995 seems to
point to my self-compiled llvm/clang perhaps lacking one or both of
libcxx and libcxxabi (-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"),
which may have avoided the issue.

Bundled clang users probably won't need to enable the patch.
  • Loading branch information
berkley4 committed Jan 5, 2023
1 parent 44056e2 commit c47484a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions debian/patches/optional/fix-missing-symbols.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -520,6 +520,14 @@
}
}

+ if (use_lld) {
+ # Workaround for missing symbol link errors similar in form to the one at
+ # https://github.com/llvm/llvm-project/issues/59660 and described at
+ # https://reviews.llvm.org/D140591#4014995.
+ ldflags += [ "-Wl,--undefined-version" ]
+ }
+
+
# Enable text section splitting only on linux when using lld for now. Other
# platforms can be added later if needed.
if ((is_linux || is_chromeos) && use_lld && use_text_section_splitting) {
1 change: 1 addition & 0 deletions debian/patches/series.debian
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ various/vanadium/disable-article-suggestions-feature-by-default.patch
#optional/system/unstable/roll-src-third_party-ffmpeg-102.patch
#optional/system/unstable/roll-src-third_party-ffmpeg-106.patch
#optional/system/unstable/v8-enhance-Date-parser-to-take-Unicode-SPACE.patch
#optional/fix-missing-symbols.patch

0 comments on commit c47484a

Please sign in to comment.