On 06/13/2010 10:18 PM, Peter O'Gorman wrote:


It's either skip the test entirely or some crap like this, you can't
load a static archive "RTLD_LOCAL", then load a different static
archive with the same symbols later "RTLD_GLOBAL", and expect things
to work. I debated what to do, and decided to do the crap thing,
since it's possible some parts of the test are useful.

I don't have a better idea here either; only that something like your
paragraph above should be a comment right before the hack, so we don't
ask ourselves the same question again next time.

Ok, I'll try to come up with a comment that doesn't use the word 'crap' :-)

This is what I pushed.

Peter

>From 83b2c36410a7b0b1b75227ef287ca6112fe7fdcb Mon Sep 17 00:00:00 2001
From: Peter O'Gorman <pe...@pogma.com>
Date: Sun, 13 Jun 2010 22:21:54 -0500
Subject: [PATCH 1/3] Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.

* tests/exceptions.at: Use it.
---
 ChangeLog           |    5 +++++
 tests/exceptions.at |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ce2ca2..2cec96c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-13  Peter O'Gorman  <pe...@pogma.com>
+
+	Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.
+	* tests/exceptions.at: Use it.
+
 2010-06-13  Ralf Wildenhues  <ralf.wildenh...@gmx.de>
 
 	Print Libtool project URL in program --help output.
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 6fe9f9a..293723c 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -224,6 +224,9 @@ int exceptions_in_module (void)
 
 int main (void)
 {
+
+  LTDL_SET_PRELOADED_SYMBOLS();
+
   if (exceptions_in_prog ())
     return 1;
   if (exceptions_in_lib ())
-- 
1.7.0.1

>From 7b9d7e4af33bbd07f0836fa5a04b6eaac80f9bdd Mon Sep 17 00:00:00 2001
From: Peter O'Gorman <pe...@pogma.com>
Date: Sun, 13 Jun 2010 22:26:48 -0500
Subject: [PATCH 2/3] Avoid failure for --disable-shared.

* tests/lt_dladvise.at: Hack.
---
 ChangeLog            |    3 +++
 tests/lt_dladvise.at |   12 ++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2cec96c..991d0be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-06-13  Peter O'Gorman  <pe...@pogma.com>
 
+	Avoid failure for --disable-shared.
+	* tests/lt_dladvise.at: Hack.
+
 	Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.
 	* tests/exceptions.at: Use it.
 
diff --git a/tests/lt_dladvise.at b/tests/lt_dladvise.at
index cdbe91d..18c2104 100644
--- a/tests/lt_dladvise.at
+++ b/tests/lt_dladvise.at
@@ -223,7 +223,17 @@ main (void)
 
   hint_resident ();
   hint_local ();
+#ifdef HAVE_SHARED
   hint_global ();
+#else
+  /* This ugly hack is because we have symbols with the same name in both the
+     global module and the local one, we can't lt_dlopen the local module
+     locally and then later load the global module globally because of this.
+     Instead of skipping the test entirely, we test what we can and
+     have this hack. */
+  printf ("global: 4\n");
+  printf ("depend: 5\n");
+#endif
   hint_preload ();
 
   if (lt_dlexit () != 0)
@@ -335,6 +345,8 @@ cygwin* | mingw* | cegcc* | *,false)
   ;;
 esac
 
+$have_shared && CPPFLAGS="$CPPFLAGS -DHAVE_SHARED"
+
 # ------------------------------------------------------------------------- #
 # Other modules can be tested correctly even when built with -no-undefined. #
 # ------------------------------------------------------------------------- #
-- 
1.7.0.1

>From 23c144c1bcc5c71e05b27e7233a8bbef331cf410 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman <pe...@pogma.com>
Date: Sun, 13 Jun 2010 22:27:31 -0500
Subject: [PATCH 3/3] Test with --disable-shared at release time too.

* HACKING: Note it.
---
 ChangeLog |    3 +++
 HACKING   |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 991d0be..a313b4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-06-13  Peter O'Gorman  <pe...@pogma.com>
 
+	Test with --disable-shared at release time too.
+	* HACKING: Note it.
+
 	Avoid failure for --disable-shared.
 	* tests/lt_dladvise.at: Hack.
 
diff --git a/HACKING b/HACKING
index 19ac2cd..7ea1818 100644
--- a/HACKING
+++ b/HACKING
@@ -641,6 +641,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 * Run `make distcheck'
   and `make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-ltdl-install'
   and `make distcheck DISTCHECK_CONFIGURE_FLAGS=--program-prefix=g'
+  and `make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-shared'
   and `make distcheck CC=g++'
   If there are any problems, fix them and start again.
 
-- 
1.7.0.1

Reply via email to