]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Disallow `-L path', do not misparse it silently.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 21 Aug 2008 19:07:16 +0000 (21:07 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 21 Aug 2008 19:07:16 +0000 (21:07 +0200)
* libltdl/config/ltmain.m4sh (func_mode_link): Diagnose `-L'
without argument, and `-L path', i.e., with a space.
* tests/fail.at (Failure tests): Test for these failures.
* THANKS: Update.
Report by Olaf Lenz.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
libltdl/config/ltmain.m4sh
tests/fail.at

index fa044820004d331bad79300aaa5470f7bb7a0b38..a97279d51eae58e16e3951394bc28c50c0ac41af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-08-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Disallow `-L path', do not misparse it silently.
+       * libltdl/config/ltmain.m4sh (func_mode_link): Diagnose `-L'
+       without argument, and `-L path', i.e., with a space.
+       * tests/fail.at (Failure tests): Test for these failures.
+       * THANKS: Update.
+       Report by Olaf Lenz.
+
 2008-08-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Avoid test failure due to broken dlpreloading of shared library.
diff --git a/THANKS b/THANKS
index 6d00c88dbdbc8a657dcd18d9d8b337b6b3397598..f284d4e284c8e040180e5bf25cbe434b071db793 100644 (file)
--- a/THANKS
+++ b/THANKS
   Michael Haubenwallner                michael.haubenwallner@salomon.at
   Mike Frysinger               vapier@gentoo.org
   Nix                          nix@esperi.org.uk
+  Olaf Lenz                    olenz@fias.uni-frankfurt.de
   Olly Betts                   olly@muscat.co.uk
   Patrick Welche               prlw1@newn.cam.ac.uk
   Paul Eggert                  eggert@twinsun.com
index 31ed2c74367a8c01fce695024c9e7b971c20e3b6..d1c984ccda6ec6de30f1694b11b0e32f1d95e898 100644 (file)
@@ -4035,6 +4035,13 @@ func_mode_link ()
       -L*)
        func_stripname '-L' '' "$arg"
        dir=$func_stripname_result
+       if test -z "$dir"; then
+         if test $# -gt 0; then
+           func_fatal_error "require no space between \`-L' and \`$1'"
+         else
+           func_fatal_error "need path for \`-L' option"
+         fi
+       fi
        # We need an absolute path.
        case $dir in
        [\\/]* | [A-Za-z]:[\\/]*) ;;
index b12a1527161f00b36c82176baeaf1136d4b4ff48..fe38ddcd0d193a893e2c8bfce99a45d18be1dff4 100644 (file)
@@ -1,6 +1,6 @@
 # fail.at -- test that libtool really fail when it should     -*- Autotest -*-
 #
-#   Copyright (C) 2005 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2008 Free Software Foundation, Inc.
 #   Written by Ralf Wildenhues, 2005
 #
 #   This file is part of GNU Libtool.
@@ -92,5 +92,13 @@ case $build_libtool_libs in yes)
   ;;
 esac
 
+# Ensure we diagnose '-L path'.
+echo 'int main () { return 0; }' > d.c
+echo 'int foo () { return 0; }' > space-after-L.c
+$CC $CPPFLAGS $CFLAGS -c d.c
+$CC $CPPFLAGS $CFLAGS -c space-after-L.c
+FAIL_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -L space-after-L.$OBJEXT -o d d.$OBJEXT])
+FAIL_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o d d.$OBJEXT -L])
+
 m4_popdef([FAIL_CHECK])
 AT_CLEANUP