diff options
author | Brooks Moses <bmoses@google.com> | 2013-10-09 12:32:48 -0700 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2014-10-26 20:29:24 +0000 |
commit | 71edbf90370b9ab8e31d1356e9e89a73210cb65d (patch) | |
tree | a6b6ce20ca6bfa1523bb608cdc314b091bbda326 | |
parent | d1d34e152e17ecc00d6903a2bcd909484543c5d7 (diff) | |
download | libtool-71edbf90370b9ab8e31d1356e9e89a73210cb65d.tar.gz |
libtool: Discard "-mllvm $arg" options when linking.
Clang accepts options of the form "-mllvm $arg", and passes the
argument as an option to LLVM. These options caused problems
for Libtool when linking; in some cases, the -mllvm option is
passed through but the corresponding argument is dropped. (See
for example http://llvm.org/bugs/show_bug.cgi?id=14716.)
This patch resolves the issue by explicitly matching -mllvm and
taking an argument. Since Clang never uses LLVM for linking,
the matched "-mllvm $arg" option is irrelevant for the link
step, and we can simply discard it once we've recognized it.
Co-authored-by: Johannes Obermayr <johannesobermayr@gmx.de>
Copyright-paperwork-exempt: Yes
-rw-r--r-- | libltdl/config/ltmain.m4sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index a7d36ccf..80693348 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -4560,6 +4560,12 @@ func_mode_link () prev= continue ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; objectlist) if test -f "$arg"; then save_arg=$arg @@ -4898,6 +4904,11 @@ func_mode_link () continue ;; + -mllvm) + prev=mllvm + continue + ;; + -module) module=yes continue |