Don't link FreeBSD tests with -ldl.
authorAndreas Tobler <andreast@fgznet.ch>
Mon, 19 May 2014 06:49:55 +0000 (08:49 +0200)
committerAndreas Tobler <andreast@fgznet.ch>
Mon, 19 May 2014 06:49:55 +0000 (08:49 +0200)
    * ld-elf/shared.exp: Introduce the extralibs variable to control
    the libraries to be linked. Don't link -ldl on *-*-freebsd*.

    * ld-bootstrap/bootstrap.exp: Do not add -ldl to the extralibs on
    *-*-freebsd*.

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

index 021d17cf0de5bcdc41afeb69fcf048bd77b57b01..b4157ef82b8a7a4299a3240b594123671dc06ae7 100644 (file)
@@ -1,3 +1,11 @@
+2014-05-19  Andreas Tobler  <andreast@fgznet.ch>
+
+       * ld-elf/shared.exp: Introduce the extralibs variable to control
+       the libraries to be linked. Don't link -ldl on *-*-freebsd*.
+
+       * ld-bootstrap/bootstrap.exp: Do not add -ldl to the extralibs on
+       *-*-freebsd*.
+
 2014-05-10  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * ld-mmix/wrap1.d, ld-mmix/wrap1a.s, ld-mmix/wrap1b.s,
index 27eb5d0e277704bbab74588976949a7b5e9910ef..bbd4fd87ba8fb18513ac79318b5a7edace528f50 100644 (file)
@@ -122,7 +122,9 @@ foreach flags $test_flags {
 
     # Plugin support requires linking with libdl.
     if { $plugins == "yes" } {
-       set extralibs "$extralibs -ldl"
+       if { ![istarget "*-*-freebsd*"]} {
+           set extralibs "$extralibs -ldl"
+       }
     }
 
     # On Irix 5, linking with --static only works if all the files are
index 9a17953c77222110690a319e506d6279b1881d93..0763cd4b747712dfabf517fee313f04c3938820a 100644 (file)
@@ -37,6 +37,11 @@ if { [which $CC] == 0 } {
     return
 }
 
+# Add -ldl to extralibs if needed
+if { ![istarget *-*-freebsd*]} {
+    set extralibs "-ldl"
+}
+
 set build_tests {
   {"Build libfoo.so"
    "-shared" "-fPIC"
@@ -275,10 +280,10 @@ set run_tests {
      "tmpdir/libbarhfoov.so tmpdir/libfoov.so" ""
      {main.c} "hidden" "hidden.out"}
     {"Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so"
-     "--dynamic-list=dl1.list -ldl" ""
+     "--dynamic-list=dl1.list $extralibs" ""
      {dl1main.c} "dl1a" "dl1.out"}
     {"Run dl1b with --dynamic-list-data and dlopen on libdl1.so"
-     "--dynamic-list-data -ldl" ""
+     "--dynamic-list-data $extralibs" ""
      {dl1main.c} "dl1b" "dl1.out"}
     {"Run with libdl2a.so"
      "tmpdir/libdl2a.so" ""
@@ -308,37 +313,37 @@ set run_tests {
      "tmpdir/libdl4f.so" ""
      {dl4main.c} "dl4f" "dl4a.out"}
     {"Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so"
-     "--dynamic-list-data -ldl" ""
+     "--dynamic-list-data $extralibs" ""
      {dl6amain.c} "dl6a1" "dl6a.out"}
     {"Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so"
-     "-Bsymbolic-functions -ldl" ""
+     "-Bsymbolic-functions $extralibs" ""
      {dl6amain.c} "dl6a2" "dl6b.out"}
     {"Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so"
-     "-Bsymbolic -ldl" ""
+     "-Bsymbolic $extralibs" ""
      {dl6amain.c} "dl6a3" "dl6b.out"}
     {"Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so"
-     "-Bsymbolic --dynamic-list-data -ldl" ""
+     "-Bsymbolic --dynamic-list-data $extralibs" ""
      {dl6amain.c} "dl6a4" "dl6a.out"}
     {"Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so"
-     "-Bsymbolic-functions --dynamic-list-cpp-new -ldl" ""
+     "-Bsymbolic-functions --dynamic-list-cpp-new $extralibs" ""
      {dl6amain.c} "dl6a5" "dl6b.out"}
     {"Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so"
-     "--dynamic-list-cpp-new -Bsymbolic-functions -ldl" ""
+     "--dynamic-list-cpp-new -Bsymbolic-functions $extralibs" ""
      {dl6amain.c} "dl6a6" "dl6b.out"}
     {"Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so"
-     "--dynamic-list-data -Bsymbolic -ldl" ""
+     "--dynamic-list-data -Bsymbolic $extralibs" ""
      {dl6amain.c} "dl6a7" "dl6a.out"}
     {"Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so"
-     "--dynamic-list-data -ldl" ""
+     "--dynamic-list-data $extralibs" ""
      {dl6bmain.c} "dl6b1" "dl6a.out"}
     {"Run dl6b2 with dlopen on libdl6b.so"
-     "-ldl" ""
+     "$extralibs" ""
      {dl6bmain.c} "dl6b2" "dl6b.out"}
     {"Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so"
-     "--dynamic-list-data -ldl" ""
+     "--dynamic-list-data $extralibs" ""
      {dl6cmain.c} "dl6c1" "dl6b.out"}
     {"Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so"
-     "--dynamic-list-data -ldl" ""
+     "--dynamic-list-data $extralibs" ""
      {dl6dmain.c} "dl6d1" "dl6b.out"}
     {"Run with libdata1.so"
      "tmpdir/libdata1.so" ""