bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS


From: Bruno Haible
Subject: havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS
Date: Tue, 29 Dec 2020 04:05:17 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

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
         }
         ;;
       *)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]