Opened 11 years ago

Closed 11 years ago

#36428 closed defect (fixed)

gcc43, gcc44, gcc45: as: more than one -arch option

Reported by: mwglass@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), jeremyhu (Jeremy Huddleston Sequoia)
Port: gcc43, gcc44, gcc45

Description

After updating our macports installation to 2.1.2, we have run into an issue with the gcc44 port which is demonstrated below.

Given the simple C routine, foo.c:

int foo(int a) { return a+5; }

It compiles fine with:

gcc-mp-4.4 -c foo.c

But it throws an error when I have an include path the ends with the word "search":

bash-3.2$ gcc-mp-4.4 -Isearch -c foo.c
/opt/local/bin/as: more than one -arch option (not allowed, use cc(1) instead)

bash-3.2$ gcc-mp-4.4 -Iextras/mysearch -c foo.c
/opt/local/bin/as: more than one -arch option (not allowed, use cc(1) instead)

I also get this behavior with the gcc45 port but not with gcc46 or gcc47. We have a ~10M LOC project that is not yet ported to gcc46 or above so having this fixed got gcc44 would really be helpful.

Change History (7)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Owner: changed from macports-tickets@… to mww@…
Port: gcc43 gcc45 added
Summary: gcc44 4.4.7_6 compile error on Lion and Snow Leopardgcc43, gcc44, gcc45: as: more than one -arch option

We don't typically backport fixes from newer versions. We typically just update ports to newer versions as they're made available. But I suppose upstream will not release any new versions of gcc 4.4 anymore.

However if you can provide a link to the relevant upstream bugreport, or identify the specific fix that needs to be backported (a specific upstream revision that implements the fix, for example), or better yet can backport it yourself and provide a patch that we can apply to the MacPorts portfile, then of course we would consider that.

comment:2 Changed 11 years ago by mwglass@…

It looks like this Portfile change is what caused the error I'm seeing:

Revision 92064, 5.8 KB checked in by jeremyhu@macports.org, 6 months ago (diff)
gcc*: Use our cctools and ld64 for assembly and linking

comment:3 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… added

comment:4 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

As this is reported with older gcc, you can use -v, you can see how as is being executed differently:

4.5:

/opt/local/bin/as -v -Ia/search -arch x86_64 -force_cpusubtype_ALL -o test.o /var/folders/kd/lg174pm94bz417bmp5vv57j80000gn/T//ccpSXwIb.s

4.7:

/opt/local/bin/as -v -I a/search -arch x86_64 -force_cpusubtype_ALL -o test.o /var/folders/kd/lg174pm94bz417bmp5vv57j80000gn/T//ccOXvW5f.s

Note the space between -I and "a". It looks like older gcc pass on the arguments as they get them (-Iabc becomes -Iabc, and -I abc becomes -I abc). Newer gcc separate them out into two arguments.

We can probably deal with this in cctools.

comment:5 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from mww@… to jeremyhu@…
Status: newassigned

comment:6 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

<rdar://problem/12475288>

comment:7 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.