config-patches
[Top][All Lists]
Advanced

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

Re: [tex-live] tlmgr invokes cc on OS X


From: Mojca Miklavec
Subject: Re: [tex-live] tlmgr invokes cc on OS X
Date: Fri, 8 Nov 2013 10:39:08 +0100

On Wed, Nov 6, 2013 at 9:39 AM, Jan Engelhardt wrote:
>
> On Wednesday 2013-11-06 00:26, Mojca Miklavec wrote:
>>
>>The role of config.guess should be figuring out what architecture we
>>are compiling *for* (that could easily be i386 or ppc even on x86_64).
>
> This has come up before on the config-patches list[1]. config.guess's
> job is not to tell you what you are compiling for, but what the
> system type is.
> [1]
> http://lists.gnu.org/archive/html/config-patches/2013-10/msg00026.html
> Therefore,
>
>>if that same user then tries to
>>compile an arbitrary software from sources on the very same hardware
>>and software and specifies either
>>    CXX=powerpc-apple-darwin10-g++-4.0
>>or
>>    CXXFLAGS="-arch ppc"
>>then I would expect from config.guess to return
>>powerpc-apple-darwin10.x.y, not x86_64-apple-darwin10.x.y. (This is
>>not the case and I consider this a bug in config.guess, actually.)
>
> is not going to change the output of config.guess, and is not meant
> to.

In that case it's a lot easier.

And it also means that the current behaviour for Darwin is wrong:

> ./config.guess
x86_64-apple-darwin11.4.2
> CC=i686-apple-darwin11-gcc-apple-4.2.1 ./config.guess
i386-apple-darwin11.4.2

because it asks the compiler for '#ifdef __LP64__' and if I set the
compiler to 32-bit powerpc-apple-darwin10.y.z or
i686-apple-darwinx.y.z, it will give a negative answer and report that
a 64-bit machine is 32-bit.

I can submit a patch, but I would first like to ask why the script uses
    UNAME_PROCESSOR=`uname -p`
rather than
    UNAME_PROCESSOR=`uname -m`

m: print the machine hardware name
p: print the machine processor architecture name

On my machine (both 10.6 and 10.7) "-p" returns "i386" and "-m"
returns "x86_64".

This is an approximation of what I might do (but doesn't account for
64-bit powerpc yet and wasn't tested for syntax errors):

  case "$UNAME_MACHINE" in
    i*86)
      if test `/usr/sbin/sysctl -n hw.cpu64bit_capable` = 1; then
        UNAME_PROCESSOR="x86_64"
      else
        UNAME_PROCESSOR="i386"
      fi ;;
    x86_64) UNAME_PROCESSOR="x86_64" ;;
    ppc*|powerpc|power*|Power*) UNAME_PROCESSOR="powerpc" ;;
  esac

This logic is used in ConTeXt at least. The 64-bit PowerPC would need
some additional research though. The main question is: would a patch
in that direction be acceptable?

Mojca



reply via email to

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