1From: Khem Raj <raj.khem@gmail.com>
2Subject: [PATCH] ltmain.in: Parse additional clang options
3
4clang uses -rtlib and --unwindlib to select proper compiler runtime in
5some cases. There fore pass these options to linker when found in
6ldflags
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Index: libtool-2.4.7/build-aux/ltmain.in
12===================================================================
13--- libtool-2.4.7.orig/build-aux/ltmain.in
14+++ libtool-2.4.7/build-aux/ltmain.in
15@@ -5420,10 +5420,12 @@ func_mode_link ()
16       # -fsanitize=*         Clang/GCC memory and address sanitizer
17       # -fuse-ld=*           Linker select flags for GCC
18       # -f*-prefix-map*      needed for lto linking
19+      # -rtlib=*             select c runtime lib with clang
20+      # --unwindlib=*        select unwinder library with clang
21       # -Wa,*                Pass flags directly to the assembler
22       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
23       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
24-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
25+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*|-rtlib=*|--unwindlib=*| \
26       -specs=*|-fsanitize=*|-fuse-ld=*|-f*-prefix-map*|-Wa,*)
27         func_quote_arg pretty "$arg"
28 	arg=$func_quote_arg_result
29