Summary

Build fails on 64-bit Mac OS X

Metadata

Attachments

Description

`uname` appears to return `i386` on 64-bit Macs, so assembling the apply-hack will fail.

Changes and comments

[2009-12-10 02:33:49 UTC] iraikov attached config-arch.sh.patch (description=Patch for config-arch.sh)

[2009-12-10 02:35:05 UTC] iraikov wrote:

I have attached a patch for config-arch.sh that checks the output of gcc -dumpspecs under Darwin to determine if this is a 64-bit machine.

[2009-12-10 03:28:33 UTC] zbigniew wrote:

There was a post to the list a few months ago about this problem on OS X 10.6 and I recommended compiling with ARCH=x86-64 as a workaround. But I did not have Snow Leopard to test a proper fix (and still don't).

However, this is what raikov's patch does on my box:

 $ gcc -dumpspecs | grep -A2 darwin_arch: | paste - - | grep x86_64
 *darwin_arch:   %{m64:x86_64;:i386}

This is on OS X 10.5 32-bit, but it would set ARCH=x86-64 unconditionally. That is only fine if you wish to force 64-bit builds on any OS X system that supports them.

[2009-12-10 03:37:16 UTC] zbigniew wrote:

And let me point out that is a bad idea. On 10.5, even though it supports 64-bit, gcc is configured to build 32-bit. That means user-built libraries are typically all 32-bit. You will break everything if you force 64-bit without the user's permission.

On 10.6 gcc will build 64-bit by default so this is fine.

Therefore any patch needs to do two things: 1) If ARCH is not set, determine the default bittedness of gcc and configure ARCH accordingly. 2) Probably, permit override of 64-bit to 32-bit if ARCH=x86 is specified on 10.6. I assume this is possible on 10.6, however, I do not know what the flag is (-m32?)

Sounds like I need to get 10.6 soon.

[2009-12-10 07:45:43 UTC] felix wrote:

I don't see what's wrong with just letting the user decide. A note in the README and possibly a warning at build-time is enough. We do this for `PLATFORM`, and we can require it just as well for `ARCH`.

[2009-12-13 12:40:04 UTC] felix wrote:

Ivan, is there a way of finding out the processor-type?

[2009-12-15 15:01:48 UTC] iraikov changed milestone from 4.3.0 to 4.4.0

[2009-12-15 15:05:07 UTC] iraikov wrote:

Replying to felix: > Ivan, is there a way of finding out the processor-type?

Well, as per zbigniew's suggestion, it appears that it is better to check whether the default system libraries are 32-bit or 64-bit; the processor type is always reported as x86_64 by gcc on recent Macs, so this is not a reliable indicator. I will look into a reliable way to detect what target the system libraries were compiled for.

[2009-12-26 21:06:53 UTC] ddp wrote:

> Well, as per zbigniew's suggestion, it appears that it is better to check whether the default system libraries are 32-bit or 64-?> bit; the processor type is always reported as x86_64 by gcc on recent Macs, so this is not a reliable indicator. I will look into a > reliable way to detect what target the system libraries were compiled for.

You probably want to look for a Darwin Kernel Version >=10 and 'sysctl hw.cpu64bit_capable: 1'

If the kernel version is less than 10 or the CPU is not 64-bit capable, then build 32-bit.

[2009-12-29 01:08:49 UTC] felix changed status from new to accepted

[2009-12-29 01:08:49 UTC] felix set owner to felix

[2009-12-29 01:08:49 UTC] felix wrote:

Replying to ddp: > > Well, as per zbigniew's suggestion, it appears that it is better to check whether the default system libraries are 32-bit or 64-?> bit; the processor type is always reported as x86_64 by gcc on recent Macs, so this is not a reliable indicator. I will look into a > reliable way to detect what target the system libraries were compiled for. > > You probably want to look for a Darwin Kernel Version >=10 and 'sysctl hw.cpu64bit_capable: 1' > > If the kernel version is less than 10 or the CPU is not 64-bit capable, then build 32-bit.

Ok, but how do I check for this?

[2010-01-06 08:53:49 UTC] felix changed status from accepted to assigned

[2010-01-06 08:53:49 UTC] felix removed owner felix

[2010-01-06 08:53:49 UTC] felix wrote:

Since I have no access to such a system, I will refuse to do anything about it, unless someone gives me some assistance.

[2010-01-06 08:54:12 UTC] felix set owner to iraikov

[2010-02-24 18:49:59 UTC] felix changed status from assigned to closed

[2010-02-24 18:49:59 UTC] felix set resolution to wontfix

[2010-02-24 18:49:59 UTC] felix wrote:

Closed, due to lack of interest and assistance.

[2010-03-11 10:33:12 UTC] Milestone 4.4.0 deleted