Opened 13 years ago

Closed 13 years ago

#31834 closed defect (fixed)

sbcl: cc1: error: unrecognized command line option "-arch"

Reported by: jrjsmrtn Owned by: easye
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: gwright@…, waqar@…, ryandesign (Ryan Carsten Schmidt)
Port: sbcl

Description

Hello...

I just found that installing sbcl 1.0.52 on 10.6.8 ends with:

...
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.5 -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer -pagezero_size 0x100000 -I. -DSBCL_PREFIX=\"'/opt/local'\"  -c -o alloc.o alloc.c
cc1: error: unrecognized command line option "-arch"
make: *** [alloc.o] Error 1
shell command "ulimit -s 8192 && unset LD_PREBIND && unset LD_PREBIND_ALLOW_OVERLAP && cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_sbcl/sbcl/work/sbcl-1.0.52 && CC=/Developer/usr/bin/llvm-gcc-4.2 CXX=/Developer/usr/bin/llvm-g++-4.2 CPP=/Developer/usr/bin/llvm-cpp-4.2 sh make.sh "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_sbcl/sbcl/work/sbcl-1.0.48-x86-darwin/src/runtime/sbcl --core /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_sbcl/sbcl/work/sbcl-1.0.48-x86-darwin/output/sbcl.core --disable-debugger --sysinit /dev/null --userinit /dev/null"  --prefix=/opt/local" returned error 2
Error: Target org.macports.build returned: shell command failed (see log for details)
Warning: the following items did not execute (for sbcl): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Log for sbcl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_sbcl/sbcl/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Log file is enclosed.

Attachments (2)

main.log (1.1 MB) - added by jrjsmrtn 13 years ago.
patch-use-right-gcc.diff (274 bytes) - added by jonathan.braud@… 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by jrjsmrtn

Attachment: main.log added

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

Cc: gwright@… waqar@… ryandesign@… added
Owner: changed from macports-tickets@… to easieste@…
Summary: sbcl 1.0.52 doesn't build on 10.6.8sbcl: cc1: error: unrecognized command line option "-arch"

What is "gcc" on your system? It sounds like you have made a different compiler the default than /usr/bin/gcc-4.2, using "sudo port select gcc" or manually changing the symlink. It's not surprising that sbcl isn't UsingTheRightCompiler since we already know it's not using the right archflags (#29832). It looks like the port is trying to use the right compiler, but apparently some edge case was missed.

I had been working on a fix to #29832 that included changes for using the right compiler... I'll see if I can dust that off and finish it.

comment:2 in reply to:  1 Changed 13 years ago by jason.swails@…

Replying to ryandesign@…:

What is "gcc" on your system? It sounds like you have made a different compiler the default than /usr/bin/gcc-4.2, using "sudo port select gcc" or manually changing the symlink. It's not surprising that sbcl isn't UsingTheRightCompiler since we already know it's not using the right archflags (#29832). It looks like the port is trying to use the right compiler, but apparently some edge case was missed.

I had been working on a fix to #29832 that included changes for using the right compiler... I'll see if I can dust that off and finish it.

I saw the same behavior when my gcc was set to mp-gcc44. Resetting to gcc42 and rebuilding fixed the issue, which is a temporary workaround. Obviously if a command uses "gcc" instead of /usr/bin/gcc-4.2, it'll just pull the currently selected MacPorts one...

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

Georges sent me this reply by email:

Indeed... I switched to mp-gcc44 and forgot to get back to llvm-gcc42.

sbcl is now building fine.

So indeed sbcl needs changes to ensure it's UsingTheRightCompiler in all cases.

Changed 13 years ago by jonathan.braud@…

Attachment: patch-use-right-gcc.diff added

comment:4 Changed 13 years ago by jonathan.braud@…

Replying to ryandesign@…:

I had been working on a fix to #29832 that included changes for using the right compiler... I'll see if I can dust that off and finish it.

I'm having the same problem (my gcc is /opt/local/bin/gcc), so I tracked down the problem. I see the portfile exports CC, but this is not enough because tools-for-build/Makefile includes src/runtime/Config, which defines CC = gcc.

So I attached a patch that removes that line. I don't know how to integrate it into the tarball. Should I contact the owner directly or is it enough that they are Cc-ed?

comment:5 Changed 13 years ago by easye

Resolution: fixed
Status: newclosed

Let the macport envirnoment supply the determination of gcc.

r90328: Supplemented the attached 'patch-use-right-gcc' diff which deletes reference to SBCL platform specific 'src/runtime/Config.x86-64-darwin. Probably not necessary to push back upstream (???).

Note: See TracTickets for help on using tickets.