Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-08-28 Thread Ralf Wildenhues
Since the question asked in:

* Ralf Wildenhues wrote on Tue, Jun 29, 2010 at 06:49:39AM CEST:
  http://thread.gmane.org/gmane.comp.gnu.libtool.general/10794/focus=9769.

was now answered in

http://thread.gmane.org/gmane.comp.gnu.libtool.general/11039/focus=11045

I feel confident enough for the patch quoted in the first link, and am
pushing it after retesting on GNU/Linux.

Cheers,
Ralf

Uniform const'ness of symlist variable lt_preloaded_symbols.

On some systems, lt_preloaded_symbols may not be declared
const due to relocation issues.  C99 requires qualification to
match for compatible declarations, so ensure we declare
const'ness in the same way everywhere; link-time optimization
may otherwise rightfully complain about inconsistencies.
Since ltdl.h may not depend upon config.h, rely on system
defines for choosing const'ness.

* NEWS: Update.
* doc/libtool.texi (Dlpreopening): Document this issue.
* libltdl/config/ltmain.m4sh (func_generate_dlsyms):
[__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
according to system defines.  Remove old shell cruft.  Use
LT_DLSYM_CONST for lt_${my_prefix}_LTX_preloaded_symbols.
* libltdl/libltdl/lt_system.h (LT_DLSYM_CONST): Likewise,
define LT_DLSYM_CONST according to system defines.
* tests/demo/foo.h (LT_DLSYM_CONST): Likewise.
* tests/pdemo/foo.h (LT_DLSYM_CONST): Likewise.
* tests/demo/dlmain.c (lt_dlsymlist): Use LT_DLSYM_CONST.
* tests/pdemo/longer_file_name_dlmain.c (lt_dlsymlist):
Likewise.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Likewise
for configure test code.
* libltdl/ltdl.c (preloaded_symbols): Use LT_DLSYM_CONST.
* libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Likewise.
[...]



Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-08-28 Thread Ralf Wildenhues
Hi Charles,

* Charles Wilson wrote on Sat, Aug 28, 2010 at 05:13:38PM CEST:
 On 8/28/2010 9:21 AM, Ralf Wildenhues wrote:
  [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
 I don't think __WINDOWS__ is the correct symbol; that is only defined by
 Watcom C/C++. I think this should be changed to _WIN32 throughout.

Oops.  Like, this?

Would it be sufficient if I tested this on a GNU/Linux - MinGW cross?

Thanks,
Ralf

Fix symlist variable path to use _WIN32 instead of __WINDOWS__.

* libltdl/config/ltmain.m4sh, libltdl/libltdl/lt_system.h,
libltdl/m4/libtool.m4, tests/demo/foo.h, tests/pdemo/foo.h:
Change __WINDOWS__ to _WIN32.
Report by Charles Wilson.

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index a7da74f..1aa2e0b 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2005,7 +2005,7 @@ extern \C\ {
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
diff --git a/libltdl/libltdl/lt_system.h b/libltdl/libltdl/lt_system.h
index a8481d6..f1545ce 100644
--- a/libltdl/libltdl/lt_system.h
+++ b/libltdl/libltdl/lt_system.h
@@ -77,7 +77,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 7e5022a..89e2e6a 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3648,7 +3648,7 @@ _LT_EOF
if $GREP ' nm_test_func$' $nlist /dev/null; then
  cat _LT_EOF  conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@t...@_dlsym_const
diff --git a/tests/demo/foo.h b/tests/demo/foo.h
index 838264e..167096a 100644
--- a/tests/demo/foo.h
+++ b/tests/demo/foo.h
@@ -63,7 +63,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
diff --git a/tests/pdemo/foo.h b/tests/pdemo/foo.h
index dd4e86d..a2b2a4a 100644
--- a/tests/pdemo/foo.h
+++ b/tests/pdemo/foo.h
@@ -62,7 +62,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST



Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-08-28 Thread Charles Wilson
On 8/28/2010 11:31 AM, Ralf Wildenhues wrote:
 * Charles Wilson wrote on Sat, Aug 28, 2010 at 05:13:38PM CEST:
 On 8/28/2010 9:21 AM, Ralf Wildenhues wrote:
 [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
 I don't think __WINDOWS__ is the correct symbol; that is only defined by
 Watcom C/C++. I think this should be changed to _WIN32 throughout.
 
 Oops.  Like, this?

Yes, that looks fine.

 Would it be sufficient if I tested this on a GNU/Linux - MinGW cross?

Yes; the mingw (gcc) compiler defines this symbol.

--
Chuck



Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-08-28 Thread Charles Wilson
On 8/28/2010 11:43 AM, Vincent Torri wrote:
 On Sat, 28 Aug 2010, Charles Wilson wrote:
 On 8/28/2010 9:21 AM, Ralf Wildenhues wrote:
 [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
 I don't think __WINDOWS__ is the correct symbol; that is only defined by
 Watcom C/C++. I think this should be changed to _WIN32 throughout.
 
 _WIN32 is what is defined everywhere, indeed.

Wait, Vincent...what are you saying?  Do you mean that we don't need to
use _WIN32_WCE since (maybe?) _WIN32 is defined also on WINCE?

--
Chuck




Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-08-28 Thread Ralf Wildenhues
* Charles Wilson wrote on Sat, Aug 28, 2010 at 05:31:57PM CEST:
 On 8/28/2010 11:31 AM, Ralf Wildenhues wrote:
  * Charles Wilson wrote on Sat, Aug 28, 2010 at 05:13:38PM CEST:
  On 8/28/2010 9:21 AM, Ralf Wildenhues wrote:
  [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
  I don't think __WINDOWS__ is the correct symbol; that is only defined by
  Watcom C/C++. I think this should be changed to _WIN32 throughout.
  
  Oops.  Like, this?
 
 Yes, that looks fine.

Great, thanks for the quick review, and also Vincent for the help!

  Would it be sufficient if I tested this on a GNU/Linux - MinGW cross?
 
 Yes; the mingw (gcc) compiler defines this symbol.

Done, works as well as it did before; pushed.

Cheers,
Ralf



Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-06-28 Thread Ralf Wildenhues
Hello Vincent,

* Ralf Wildenhues wrote on Sat, Jun 19, 2010 at 12:08:29PM CEST:
 I would like to commit the patch quoted below, on the way of support for
 LTO with GCC.  For that, I need to know from somebody who is willing to
 help out with the Windows CE port of Libtool whether the #defines used
 in the patch are sufficient and correct.
 
 This is
 http://thread.gmane.org/gmane.comp.gnu.libtool.general/10794/focus=9769.

Libtool has no wince maintainer.  If we cannot even get simple questions
answered about WinCE, then we cannot ensure to keep Libtool working on
this system.  Questions answered are a necessary, but not necessarily
sufficient condition for keeping a port working.  Regular regression
testing is usually necessary as well, even if there are none to few
changes specific to some port.  For systems Charles, the Peters, Bob,
Gary, and I have access to, regular testing is pretty much a given,
which sums up to something like 3 dozen different setups at least
(users do more testing, but I have less of an overview off-hand).

Right now I have one simple question: can I assume that the preprocessor
symbol _WIN32_WCE is defined for wince code, and usually not defined for
non-wince code?

This question is the only impediment for this particular patch.  Of
course, a regression test of Libtool with this patch on wince would be
much better even.

Thank you,
Ralf



Re: [PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-06-19 Thread Ralf Wildenhues
Hello Vincent, all,

I would like to commit the patch quoted below, on the way of support for
LTO with GCC.  For that, I need to know from somebody who is willing to
help out with the Windows CE port of Libtool whether the #defines used
in the patch are sufficient and correct.

This is
http://thread.gmane.org/gmane.comp.gnu.libtool.general/10794/focus=9769.

Thanks,
Ralf

* Ralf Wildenhues wrote on Sun, Apr 04, 2010 at 10:56:47AM CEST:
 On some systems, lt_preloaded_symbols may not be declared
 const due to relocation issues.  C99 requires qualification to
 match for compatible declarations, so ensure we declare
 const'ness in the same way everywhere; link-time optimization
 may otherwise rightfully complain about inconsistencies.
 Since ltdl.h may not depend upon config.h, rely on system
 defines for choosing const'ness.
 
 * NEWS: Update.
 * doc/libtool.texi (Dlpreopening): Document this issue.
 * libltdl/config/ltmain.m4sh (func_generate_dlsyms):
 [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
 according to system defines.  Remove old shell cruft.  Use
 LT_DLSYM_CONST for lt_${my_prefix}_LTX_preloaded_symbols.
 * libltdl/libltdl/lt_system.h (LT_DLSYM_CONST): Likewise,
 define LT_DLSYM_CONST according to system defines.
 * tests/demo/foo.h (LT_DLSYM_CONST): Likewise.
 * tests/pdemo/foo.h (LT_DLSYM_CONST): Likewise.
 * tests/demo/dlmain.c (lt_dlsymlist): Use LT_DLSYM_CONST.
 * tests/pdemo/longer_file_name_dlmain.c (lt_dlsymlist):
 Likewise.
 * libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Likewise
 for configure test code.
 * libltdl/ltdl.c (preloaded_symbols): Use LT_DLSYM_CONST.
 * libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Likewise.
 
 Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
 ---
 
 Hello,
 
 this patch addresses the const-ness of the symlist variable.
 
 I would like things to be consistent across ltmain, libtool.m4 (where we test
 symbol-pipe functionality), and ltdl.h, and since the latter can't depend on
 config.h, I guess the best bet is to hard-code using system defines.
 
 Question is whether
   *cygwin* | *mingw* | *cegcc* | *osf5*
 
 matches
   defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
   defined(__osf__)
 
 well enough?
 
 OK to commit?
 
 Thanks,
 Ralf
 
  ChangeLog |   26 ++
  NEWS  |3 +++
  doc/libtool.texi  |3 +++
  libltdl/config/ltmain.m4sh|   33 
 ++---
  libltdl/libltdl/lt_system.h   |   14 +-
  libltdl/ltdl.c|2 +-
  libltdl/ltdl.h|2 +-
  libltdl/m4/libtool.m4 |   14 +-
  tests/demo/dlmain.c   |2 +-
  tests/demo/foo.h  |   14 +-
  tests/pdemo/foo.h |   14 +-
  tests/pdemo/longer_file_name_dlmain.c |2 +-
  12 files changed, 102 insertions(+), 27 deletions(-)
 
 diff --git a/ChangeLog b/ChangeLog
 index c082cee..245452b 100644
 --- a/ChangeLog
 +++ b/ChangeLog
 @@ -1,5 +1,31 @@
  2010-04-04  Ralf Wildenhues  ralf.wildenh...@gmx.de
  
 + Uniform const'ness of symlist variable lt_preloaded_symbols.
 + On some systems, lt_preloaded_symbols may not be declared
 + const due to relocation issues.  C99 requires qualification to
 + match for compatible declarations, so ensure we declare
 + const'ness in the same way everywhere; link-time optimization
 + may otherwise rightfully complain about inconsistencies.
 + Since ltdl.h may not depend upon config.h, rely on system
 + defines for choosing const'ness.
 + * NEWS: Update.
 + * doc/libtool.texi (Dlpreopening): Document this issue.
 + * libltdl/config/ltmain.m4sh (func_generate_dlsyms):
 + [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
 + according to system defines.  Remove old shell cruft.  Use
 + LT_DLSYM_CONST for lt_${my_prefix}_LTX_preloaded_symbols.
 + * libltdl/libltdl/lt_system.h (LT_DLSYM_CONST): Likewise,
 + define LT_DLSYM_CONST according to system defines.
 + * tests/demo/foo.h (LT_DLSYM_CONST): Likewise.
 + * tests/pdemo/foo.h (LT_DLSYM_CONST): Likewise.
 + * tests/demo/dlmain.c (lt_dlsymlist): Use LT_DLSYM_CONST.
 + * tests/pdemo/longer_file_name_dlmain.c (lt_dlsymlist):
 + Likewise.
 + * libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Likewise
 + for configure test code.
 + * libltdl/ltdl.c (preloaded_symbols): Use LT_DLSYM_CONST.
 + * libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Likewise.
 +
   Fix incompatible struct declarations.
   * doc/libtool.texi (Dlpreopening): Remove broken documentation
   of lt_dlsymbol and lt_dlsymlist.  Document typedef lt_dlsymlist
 diff --git a/NEWS b/NEWS
 index f220f28..1ffbf74 100644
 --- a/NEWS
 +++ b/NEWS
 @@ -27,6 +27,9 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, 

[PATCH 3/4] Uniform const'ness of symlist variable lt_preloaded_symbols.

2010-04-04 Thread Ralf Wildenhues
On some systems, lt_preloaded_symbols may not be declared
const due to relocation issues.  C99 requires qualification to
match for compatible declarations, so ensure we declare
const'ness in the same way everywhere; link-time optimization
may otherwise rightfully complain about inconsistencies.
Since ltdl.h may not depend upon config.h, rely on system
defines for choosing const'ness.

* NEWS: Update.
* doc/libtool.texi (Dlpreopening): Document this issue.
* libltdl/config/ltmain.m4sh (func_generate_dlsyms):
[__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
according to system defines.  Remove old shell cruft.  Use
LT_DLSYM_CONST for lt_${my_prefix}_LTX_preloaded_symbols.
* libltdl/libltdl/lt_system.h (LT_DLSYM_CONST): Likewise,
define LT_DLSYM_CONST according to system defines.
* tests/demo/foo.h (LT_DLSYM_CONST): Likewise.
* tests/pdemo/foo.h (LT_DLSYM_CONST): Likewise.
* tests/demo/dlmain.c (lt_dlsymlist): Use LT_DLSYM_CONST.
* tests/pdemo/longer_file_name_dlmain.c (lt_dlsymlist):
Likewise.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Likewise
for configure test code.
* libltdl/ltdl.c (preloaded_symbols): Use LT_DLSYM_CONST.
* libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Likewise.

Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
---

Hello,

this patch addresses the const-ness of the symlist variable.

I would like things to be consistent across ltmain, libtool.m4 (where we test
symbol-pipe functionality), and ltdl.h, and since the latter can't depend on
config.h, I guess the best bet is to hard-code using system defines.

Question is whether
  *cygwin* | *mingw* | *cegcc* | *osf5*

matches
  defined(__WINDOWS__) || defined(__CYGWIN__) || defined(_WIN32_WCE)
  defined(__osf__)

well enough?

OK to commit?

Thanks,
Ralf

 ChangeLog |   26 ++
 NEWS  |3 +++
 doc/libtool.texi  |3 +++
 libltdl/config/ltmain.m4sh|   33 ++---
 libltdl/libltdl/lt_system.h   |   14 +-
 libltdl/ltdl.c|2 +-
 libltdl/ltdl.h|2 +-
 libltdl/m4/libtool.m4 |   14 +-
 tests/demo/dlmain.c   |2 +-
 tests/demo/foo.h  |   14 +-
 tests/pdemo/foo.h |   14 +-
 tests/pdemo/longer_file_name_dlmain.c |2 +-
 12 files changed, 102 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c082cee..245452b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
 2010-04-04  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
+   Uniform const'ness of symlist variable lt_preloaded_symbols.
+   On some systems, lt_preloaded_symbols may not be declared
+   const due to relocation issues.  C99 requires qualification to
+   match for compatible declarations, so ensure we declare
+   const'ness in the same way everywhere; link-time optimization
+   may otherwise rightfully complain about inconsistencies.
+   Since ltdl.h may not depend upon config.h, rely on system
+   defines for choosing const'ness.
+   * NEWS: Update.
+   * doc/libtool.texi (Dlpreopening): Document this issue.
+   * libltdl/config/ltmain.m4sh (func_generate_dlsyms):
+   [__WINDOWS__, __CYGWIN__, _WIN32_WCE]: Define LT_DLSYM_CONST
+   according to system defines.  Remove old shell cruft.  Use
+   LT_DLSYM_CONST for lt_${my_prefix}_LTX_preloaded_symbols.
+   * libltdl/libltdl/lt_system.h (LT_DLSYM_CONST): Likewise,
+   define LT_DLSYM_CONST according to system defines.
+   * tests/demo/foo.h (LT_DLSYM_CONST): Likewise.
+   * tests/pdemo/foo.h (LT_DLSYM_CONST): Likewise.
+   * tests/demo/dlmain.c (lt_dlsymlist): Use LT_DLSYM_CONST.
+   * tests/pdemo/longer_file_name_dlmain.c (lt_dlsymlist):
+   Likewise.
+   * libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Likewise
+   for configure test code.
+   * libltdl/ltdl.c (preloaded_symbols): Use LT_DLSYM_CONST.
+   * libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Likewise.
+
Fix incompatible struct declarations.
* doc/libtool.texi (Dlpreopening): Remove broken documentation
of lt_dlsymbol and lt_dlsymlist.  Document typedef lt_dlsymlist
diff --git a/NEWS b/NEWS
index f220f28..1ffbf74 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,9 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, Libtool team:
 options that begin with '--lt-*' from the argument list before launching
 (uninstalled) programs. Any '--lt-*' option on the command line not
 recognized by the wrapper will result in an error.
+  - The type of the symbol lists variables (lt_*_LTX_preloaded_symbols) has
+been fixed in the manual and in a couple of tests to match the actual
+implementation.
 
 * Changes in supported systems or compilers:
 
diff --git a/doc/libtool.texi b/doc/libtool.texi
index