[patch] Comments for linker-option section, was Re: powerpc*le-linux support

Brooks Moses <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
Gary, Peter -

First, thank you for helping get this committed!

On 08/22/2013 07:34 AM, Gary V. Vaughan wrote:
> On Aug 22, 2013, at 8:58 PM, Peter Rosin <[email protected]> wrote:
>> How can it be correct to say "-m elf32lppclinux" (32-bit) when $host is
>> explicitly 64-bit? That seems like utter garbage to me. What am I
>> missing this time?
>
> I don't get it either, and I can't test it.  I trust the ppcle community
> will commence shouting if the patches have done something horrible. However,
> if there is any nonsense here, it predates my recent patch butchering,
> because even the pre-patched code seems to mix 32bit and 64bit concepts
> liberally.
>
> If someone would like to apply (or send me) a patch that adds a comment
> explaining why this code needs to look so odd, that would be very helpful!

Based on Alan's explanation and what I could tell from looking at the 
code, I've tried to expand the comments to explain what's going on, as 
per the attached patch.  Does this look like a useful improvement to the 
situation?

Thanks,
- Brooks
2013-08-22_ld-option-comments.diff (text/x-patch, 1.8 KB)
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 08fb2a5..55d7159 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1260,7 +1260,8 @@ test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out which ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
@@ -1275,7 +1276,8 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out which ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     if test yes = "$lt_cv_prog_gnu_ld"; then
@@ -1309,7 +1311,12 @@ ia64-*-hpux*)
 
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out which ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1383,7 +1390,8 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out which ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.