libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] ltmain.in: Parse additional clang options


From: Richard Purdie
Subject: [PATCH 2/3] ltmain.in: Parse additional clang options
Date: Tue, 16 Jan 2024 15:14:23 +0000

clang uses -rtlib and --unwindlib to select proper compiler runtime in
some cases. Therefore pass these options to linker when found in
ldflags

* build-aux/ltmain.in: Handle clang linker options
---
 build-aux/ltmain.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 34784c8c..cf6dc13a 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5412,12 +5412,14 @@ func_mode_link ()
       # -shared-libsan       Link with shared sanitizer runtimes (Clang)
       # -static-libsan       Link with static sanitizer runtimes (Clang)
       # -fuse-ld=*           Linker select flags for GCC
+      # -rtlib=*             select c runtime lib with clang
+      # --unwindlib=*        select unwinder library with clang
       # -f{file|debug|macro}-prefix-map* needed for lto linking
       # -Wa,*                Pass flags directly to the assembler
       # -Werror, -Werror=*   Report (specified) warnings as errors
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*|-rtlib=*|--unwindlib=*|
 \
       -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
       -ffile-prefix-map*|-fdebug-prefix-map*|-fmacro-prefix-map*| \
       -fdiagnostics-color*|-frecord-gcc-switches| \
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]