* ld-bootstrap/bootstrap.exp: Also pass '-liconv' to linker when
authorDave Korn <dave.korn@artimi.com>
Mon, 16 Mar 2009 22:03:44 +0000 (22:03 +0000)
committerDave Korn <dave.korn@artimi.com>
Mon, 16 Mar 2009 22:03:44 +0000 (22:03 +0000)
linking statically on Cygwin, necessitated by '-lintl'.

ld/testsuite/ChangeLog
ld/testsuite/ld-bootstrap/bootstrap.exp

index 462b6954b91a3a03636608323678544759eea3b2..30dadce4fc4553b60db6e54c3c2433ae5ec536a9 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-16  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       * ld-bootstrap/bootstrap.exp:  Also pass '-liconv' to linker when
+       linking statically on Cygwin, necessitated by '-lintl'.
+
 2009-03-15  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * ld-auto-import/auto-import.exp:  Add missing dll entrypoint.
index fdeffe3593b95b9140c25a28c1b215c9be6ce337..d84897d39bed588da14ecb6cb3f81b7466ed45e4 100644 (file)
@@ -83,13 +83,21 @@ foreach flags {"" "strip" "--static" "--traditional-format"
        }
     }
 
+    # On Cygwin, -lintl may require -liconv when linking statically.
+    set extralibs ""
+    if { [istarget "*-*-cygwin*"]} {
+       if {"$flags" == "--static"} {
+           set extralibs "-liconv"
+       }
+    }
+
     # On Irix 5, linking with --static only works if all the files are
     # compiled using -non_shared.
     if {"$flags" == "--static"} {
        setup_xfail "mips*-*-irix5*"
     }
 
-    if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY"] {
+    if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY $extralibs"] {
        fail $testname
        continue
     }
@@ -104,12 +112,12 @@ foreach flags {"" "strip" "--static" "--traditional-format"
        }
     }
 
-    if ![ld_link tmpdir/ld1 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY"] {
+    if ![ld_link tmpdir/ld1 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
        fail $testname
        continue
     }
 
-    if ![ld_link tmpdir/ld2 tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY"] {
+    if ![ld_link tmpdir/ld2 tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
        fail $testname
        continue
     }