]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/link-order2.at: Define our override `sin' function with
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 14 Dec 2006 20:59:26 +0000 (20:59 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 14 Dec 2006 20:59:26 +0000 (20:59 +0000)
C binding even if $CC is a C++ compiler.  Skip the test with g++
as its command line driver reorders `-lm'.
* tests/search-path.at: Declare `inflate' with C binding.
* tests/stresstest.at: Avoid unused variable warnings.

ChangeLog
tests/link-order2.at
tests/search-path.at
tests/stresstest.at

index 0d33fe1ff9a1de98da70e674be3c68fe7acdfc17..545a51d2799f2a8384971fe8ecd6e19bd517b57f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-12-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * tests/link-order2.at: Define our override `sin' function with
+       C binding even if $CC is a C++ compiler.  Skip the test with g++
+       as its command line driver reorders `-lm'.
+       * tests/search-path.at: Declare `inflate' with C binding.
+       * tests/stresstest.at: Avoid unused variable warnings.
+
 2006-11-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * tests/link-order2.at: Simplify logic to be a bit more self
index ac54edb4b50f39a27ff10742190dc7c12cada5a7..ec2acf5f35d025de7ffda697f70811d8ffdcea4f 100644 (file)
 
 AT_SETUP([Link order of deplibs.])
 AT_KEYWORDS([libtool])
+
+# g++ reorders `-lm' on the command line.  :-(
+AT_DATA([t.c], [[
+#if defined(__cplusplus) && defined(__GNUC__)
+choke me
+#endif
+int t = 42;
+]])
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c t.c || exit 77], [], [ignore], [ignore])
+
 LDFLAGS="$LDFLAGS -no-undefined"
 libdir=`pwd`/inst/lib
 bindir=`pwd`/inst/bin
@@ -31,11 +41,17 @@ mkdir inst inst/bin inst/lib
 
 cat >a.c <<\EOF
 /* pretend we have a better sine function */
+#ifdef __cplusplus
+extern "C"
+#endif
 double sin (double x) { return 0.0; }
 EOF
 
 cat >b.c <<\EOF
-extern double sin (double);
+#ifdef __cplusplus
+extern "C"
+#endif
+double sin (double);
 double b (double x) { return sin (x); }
 EOF
 
index ab0eca04e1ad51018aa051f1c28358bba1824bad..f45ec0b9941e91d00c3aa0097abf00e1a67b5229 100644 (file)
@@ -21,7 +21,11 @@ AT_KEYWORDS([libtool])
 LDFLAGS="$LDFLAGS -no-undefined"
 
 AT_DATA([main.c],
-[[extern int inflate ();
+[[extern
+#ifdef __cplusplus
+"C"
+#endif
+int inflate ();
 int main()
 {
   return inflate ();
index 4f7abaf651e779f11e08685f2856f163543c1b5b..19a1cb9022ff6578989f88b6c5ac0eb6b59d9244 100644 (file)
@@ -45,7 +45,7 @@ const int v5 = 0;
 const int v6 = 1;
 const char* v7 = "\01foo";
 const char v8[] = "\01bar";
-int v9(void) { return 1; }
+int v9(void) { return v2 + 1; }
 int (*v10) (void);
 int (*v11) (void) = v9;
 int (*const v12) (void) = v9;
@@ -165,7 +165,7 @@ const int w5 = 0;
 const int w6 = 1;
 const char* w7 = "\01foo";
 const char w8[] = "\01bar";
-int w9(void) { return 1; }
+int w9(void) { return w2 + 1; }
 int (*w10) (void);
 int (*w11) (void) = w9;
 int (*const w12) (void) = w9;