From: Ileana Dumitrescu Date: Thu, 18 Apr 2024 16:26:55 +0000 (+0300) Subject: libtool: Pass the "-no-canonical-prefixes" linker flag X-Git-Tag: v2.5.0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=297b5cf19fe12bbee1322a17ff013a21f57bb93d;p=thirdparty%2Flibtool.git libtool: Pass the "-no-canonical-prefixes" linker flag When using the -no-canonical-prefixes flag in libtool, the flag is removed from the linking command, causing linking to fail. This adds the flag to the list of linker flags to be passed through to the linker. * build-aux/ltmain.in: Pass -no-canonical-prefixes to the linker. * Makefile.am: Added in tests/bug_62343.at. * tests/bug_62343.at: Contains test case for bug 62343. --- diff --git a/Makefile.am b/Makefile.am index 904f3d73f..8cc621ea4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -727,6 +727,7 @@ TESTSUITE_AT = tests/testsuite.at \ tests/sysroot.at \ tests/stresstest.at \ tests/cmdline_wrap.at \ + tests/bug_62343.at \ $(NOTHING_ELSE) EXTRA_DIST += $(testsuite) $(TESTSUITE_AT) $(package_m4) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 090a4fe8a..8f1094273 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5412,6 +5412,7 @@ func_mode_link () # -fno-sanitize* Clang/GCC memory and address sanitizer # -shared-libsan Link with shared sanitizer runtimes (Clang) # -static-libsan Link with static sanitizer runtimes (Clang) + # -no-canonical-prefixes Do not expand any symbolic links # -fuse-ld=* Linker select flags for GCC # -rtlib=* select c runtime lib with clang # --unwindlib=* select unwinder library with clang @@ -5420,7 +5421,7 @@ func_mode_link () # -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*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \ -stdlib=*|-rtlib=*|--unwindlib=*| \ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \ diff --git a/tests/bug_62343.at b/tests/bug_62343.at new file mode 100644 index 000000000..385cc413b --- /dev/null +++ b/tests/bug_62343.at @@ -0,0 +1,40 @@ +# bug_62343.at -- bug 62343 -*- Autotest -*- + +# Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#### + +AT_BANNER([Testing bug 62343:]) + +AT_SETUP([Use -no-canonical-prefixes flag]) + +AT_DATA([x.cpp], +[[ +void f(int *p) { *p = 21; } +]]) + + +AT_CHECK([$LIBTOOL --mode=compile --tag=CXX g++ -c x.cpp], [0], [stdout], [stderr]) + +AT_CHECK([$LIBTOOL --mode=link --tag=CXX g++ -o libx.la -no-canonical-prefixes -rpath /usr/lib64/ x.lo], [0], [stdout], [stderr]) + +AT_CHECK([$GREP -- '-no-canonical-prefixes' stdout], [0], [ignore]) + +AT_CLEANUP