bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS
@ 2020-12-29  3:05 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2020-12-29  3:05 UTC (permalink / raw)
  To: bug-gnulib

The ELF class detection of shared libraries is not working on
Solaris 11 OpenIndiana and Solaris 11 OmniOS, leading to executables
linked without rpath.

The cause is that on these platforms, the 'od' program prints
decimal values of bytes as 3-digit integers, padded with zeroes,
instead of padded with spaces, like other platforms (including
Solaris 10 and Solaris 11.3) do.

One possible fix is to use octal output. Another one is to compare
the resulting value using 'expr' instead of 'test'.

Here I prefer the latter.


2020-12-28  Bruno Haible  <bruno@clisp.org>

	havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.
	* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): In
	acl_is_expected_elfclass, use 'expr', not 'test'.

diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 28bb3d3..2bcdfdf 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 18
+# lib-prefix.m4 serial 19
 dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -198,20 +198,23 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
         echo
       }
     fi
+    # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+    # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+    # not 1 or 2.
 changequote(,)dnl
     case $HOST_CPU_C_ABI_32BIT in
       yes)
         # 32-bit ABI.
         acl_is_expected_elfclass ()
         {
-          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 1
+          expr "`func_elfclass | sed -e 's/[ 	]//g'`" = 1 > /dev/null
         }
         ;;
       no)
         # 64-bit ABI.
         acl_is_expected_elfclass ()
         {
-          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 2
+          expr "`func_elfclass | sed -e 's/[ 	]//g'`" = 2 > /dev/null
         }
         ;;
       *)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-29  3:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29  3:05 havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).