[60662] trunk/base/src/port1.0/portconfigure.tcl

Joshua Root jmr at macports.org
Thu Nov 19 11:54:08 PST 2009


On 2009-11-20 06:44, Jeremy Huddleston wrote:
> On Nov 19, 2009, at 10:07, Joshua Root wrote:
> 
>> On 2031-9-15 05:59, jeremyhu at macports.org wrote:
>>> Revision: 60662
>>>          http://trac.macports.org/changeset/60662
>>> Author:   jeremyhu at macports.org
>>> Date:     2009-11-19 09:34:26 -0800 (Thu, 19 Nov 2009)
>>> Log Message:
>>> -----------
>>> Set LDFLAGS when changing build_arch.
>> I didn't do this in the first place because I wasn't sure if there would
>> be a problem with ports using non-Apple compilers, which would have -m32
>> or -m64 in LDFLAGS, and could end up calling ld with those flags
>> directly. Do you think this will be rare enough that it won't be a
>> problem to just fix up the few affected portfiles?
> 
> I did it to fix a build issue with firefox-x11-devel.  I expected that setting the configure.build_arch would be sufficient, and I was surprised to see that it didn't set LDFLAGS as I expected.

I agree it should be set when using an Apple compiler.

> As for "non-Apple toolchains" ... isnt' that what [arch_flag_supported] is designed to handle in this hunk:
> 
> @@ -220,7 +220,7 @@
>     } elseif {[tbool configure.m32]} {
>         set flags "-m32"
>     } elseif {${configure.build_arch} != ""} {
> -        if {[arch_flag_supported] && ($tool == "cc" || $tool == "cxx" || $tool == "objc")} {
> +        if {[arch_flag_supported] && ($tool == "cc" || $tool == "cxx" || $tool == "objc" || $tool == "ld")} {
>             set flags "-arch ${configure.build_arch}"
>         } elseif {${configure.build_arch} == "x86_64" || ${configure.build_arch} == "ppc64"} {
>             set flags "-m64"

Yes, but it's only doing the right thing for flags that are going to be
passed to a compiler. You can't do "ld -m64 ..."

- Josh


More information about the macports-dev mailing list