This is an automated email from the git hooks/post-receive script.

ildumi pushed a commit to branch master
in repository libtool.

The following commit(s) were added to refs/heads/master by this push:
     new 297b5cf1 libtool: Pass the "-no-canonical-prefixes" linker flag
297b5cf1 is described below

commit 297b5cf19fe12bbee1322a17ff013a21f57bb93d
Author: Ileana Dumitrescu <ileanadumitresc...@gmail.com>
AuthorDate: Thu Apr 18 19:26:55 2024 +0300

    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.
---
 Makefile.am         |  1 +
 build-aux/ltmain.in |  3 ++-
 tests/bug_62343.at  | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 904f3d73..8cc621ea 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 090a4fe8..8f109427 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 00000000..385cc413
--- /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

Reply via email to