config-patches
[Top][All Lists]
Advanced

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

config.guess: x86_64-pc-solaris2.11 is not properly recognized


From: Andreas F. Borchert
Subject: config.guess: x86_64-pc-solaris2.11 is not properly recognized
Date: Tue, 30 Nov 2021 21:18:10 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi,

config.guess guesses Solaris 11 to run on a 32-bit platform
despite Solaris 11 no longer supporting any 32-bit platform.

See the following code at lines 434 to 445:

| SUN_ARCH=i386
| # If there is a compiler, see if it is configured for 64-bit objects.
| # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
| # This test works for both compilers.
| if test "$CC_FOR_BUILD" != no_compiler_found; then
|     if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
|         (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
|         grep IS_64BIT_ARCH >/dev/null
|     then
|         SUN_ARCH=x86_64
|     fi
| fi

If "cc" is installed, i.e. the Oracle Studio compiler, this one
is chosen for $CC_FOR_BUILD. This compiler, the gcc provided
by Oracle and also gcc bootstrapped from sources on that platform
with a default configuration will by default generate 32-bit
binaries -- even on a 64-bit platform. And __amd64 will not
be defined for compilations targeting a 32-bit platform. This
is different from the corresponding behaviour on GNU/Linux systems
where the local platform is targeted by default.

Thus, as long as you do not add "-m64" or if you have a custom-built
gcc which defaults to 64 bit, you will get 32-bit binaries on Solaris
despite living on a 64-bit platform.

You can either omit this test for Solaris 11 (as this operating system
will not run on any 32-bit platform) or adapt the test by adding the
"-m64" flag. This this will work properly for Solaris 10 as well (the
last Solaris release that supported x86 32-bit platforms).

Here is a patch that simply adds the "-m64" flag:

-------------------------------------------------------------------------------
*** config.guess        Tue Nov 30 20:42:03 2021
--- config.guess-fixed  Tue Nov 30 20:44:54 2021
***************
*** 438,442 ****
        if test "$CC_FOR_BUILD" != no_compiler_found; then
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
!               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
                grep IS_64BIT_ARCH >/dev/null
            then
--- 438,442 ----
        if test "$CC_FOR_BUILD" != no_compiler_found; then
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
!               (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
                grep IS_64BIT_ARCH >/dev/null
            then
-------------------------------------------------------------------------------

This is related to following discussion:
   https://github.com/latex3/luaotfload/issues/203

BTW, I wonder why config.guess does not distinguish between
SPARCv8 (32-bit platform) and SPARCv9 and other SPARC-based
64-bit platforms. config.guess always generates
"sparc-sun-solaris2.x" for these cases.

And I also wonder why config.sub supports "solaris3" alias
"sunos6". This is pure fantasy. There will be no "solaris3"
as we are already arrived at Solaris 11. (There was a jump
from Solaris 2.6 to Solaris 7 where "uname -r" just moved from
5.6 to 5.7. We are now at 5.11 and nobody expects a move towards
6.x and, even if this would happen, this would not be named
Solaris 3.

Thanks for your work & kind regards, Andreas F. Borchert.



reply via email to

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