Ticket #22168 (closed defect: fixed)
gdc-0.24 fails to build with MacPorts 1.8
| Reported by: | afalquina@… | Owned by: | mww@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.8.1 |
| Keywords: | Cc: | t.kunishi@…, bgschaid@…, ryandesign@…, da.br.oz+gdcfail@… | |
| Port: | gdc |
Description
The following command:
sudo port -v install gdc
fails with this output:
cc1: error: unrecognized command line option "-arch"
Find attached the rest of the command's output as a text file compressed with bzip2.
This is some information about my system:
$ sw_vers ProductName: Mac OS X ProductVersion: 10.6.1 BuildVersion: 10B504 $ uname -a Darwin MacBookPro.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386 $ port version Version: 1.8.1 About XCode: Version 3.2 64-bit Component versions Xcode IDE: 1610.0 Xcode Core: 1608.0 ToolSupport: 1591.0
Attachments
Change History
comment:2 follow-up: ↓ 4 Changed 4 years ago by afb@…
When building a non-Apple GCC (as in FSF GCC), you can't use the -arch flags (like in the default archflags).
So you need to do some workaround like the gcc41 port does:
# the generated compiler doesn't accept -arch
if {[info exists build_arch] && ${os.platform} == "darwin"} {
configure.cc_archflags
configure.cxx_archflags
configure.objc_archflags
configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
}
comment:3 Changed 4 years ago by afb@…
Alternatively someone could do a apple-gdc40 port, that would accept the -arch flags and similar...
Or even better make GDC run with gcc-4.2 as well as gcc-4.0, by updating the upstream code for it.
comment:4 in reply to: ↑ 2 Changed 4 years ago by afalquina@…
Replying to afb@…:
When building a non-Apple GCC (as in FSF GCC), you can't use the -arch flags (like in the default archflags).
So you need to do some workaround like the gcc41 port does:
I have added those lines to the Portfile and after a while I get the following error:
gnumake[2]: i386-apple-darwin10.0.0-ar: No such file or directory
I guess I have missed something, since it is the first time I have ever touched a Portfile...
comment:5 Changed 4 years ago by afb@…
Sounds like #21388, probably it needs a AR=ar somewhere like in the configure.env.
comment:6 Changed 4 years ago by afb@…
The reason it is needed is that the workaround above sets it up for a GNU-style cross-compilation (--build being different from OS) but then it lacks some matching links for the various compiler/linker commands. It also leads to other things like adding a prefix to all the generated commands (like seen in #22163). The "easiest" would have been to not add that -arch everywhere, but the workaround is to use --program-prefix="" in the configure.
comment:7 Changed 4 years ago by afalquina@…
I added --program-prefix="" to configure.args, but the build still failed. Afterwards, I added AR=ar to configure.env, then AS=as, NM=nm, LD=ld as different programs were reported to be missing. Finally it complains about i386-apple-darwin10.0.0-cc. I have not found a way around this.
comment:10 Changed 3 years ago by ryandesign@…
- Cc ryandesign@… added
- Summary changed from gdc-0.24 fails to build on Snow Leopard to gdc-0.24 fails to build with MacPorts 1.8
Markus, can you fix this, please? This prevents gdc from being installed at all on MacPorts 1.8 and later.
comment:11 Changed 3 years ago by ryandesign@…
Has duplicate #26442.
comment:13 Changed 3 years ago by jmr@…
- Status changed from new to closed
- Resolution set to fixed

