Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#143 closed defect (wontfix)

Build fails on 64-bit Mac OS X

Reported by: felix winkelmann Owned by: Ivan Raikov
Priority: critical Milestone:
Component: build system Version: 4.2.x
Keywords: arch Cc: Ivan Raikov
Estimated difficulty:

Description

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

Attachments (1)

config-arch.sh.patch (1.0 KB) - added by Ivan Raikov 14 years ago.
Patch for config-arch.sh

Download all attachments as: .zip

Change History (14)

Changed 14 years ago by Ivan Raikov

Attachment: config-arch.sh.patch added

Patch for config-arch.sh

comment:1 Changed 14 years ago by Ivan Raikov

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.

comment:2 Changed 14 years ago by Jim Ursetto

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.

comment:3 Changed 14 years ago by Jim Ursetto

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.

comment:4 Changed 14 years ago by felix winkelmann

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.

comment:5 Changed 14 years ago by felix winkelmann

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

comment:6 Changed 14 years ago by Ivan Raikov

Milestone: 4.3.04.4.0

comment:7 in reply to:  5 ; Changed 14 years ago by Ivan Raikov

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.

comment:8 in reply to:  7 ; Changed 14 years ago by 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.

comment:9 in reply to:  8 Changed 14 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newaccepted

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?

comment:10 Changed 14 years ago by felix winkelmann

Owner: felix winkelmann deleted
Status: acceptedassigned

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

comment:11 Changed 14 years ago by felix winkelmann

Owner: set to Ivan Raikov

comment:12 Changed 14 years ago by felix winkelmann

Resolution: wontfix
Status: assignedclosed

Closed, due to lack of interest and assistance.

comment:13 Changed 14 years ago by (none)

Milestone 4.4.0 deleted

Note: See TracTickets for help on using tickets.