Unix port using gcc with clang flags
I'm trying to build the Unix port, but I keep getting gcc: error: unrecognized command-line option ‘-Qunused-arguments’.
Looking at online docs, it looks like clang has that option, but gcc does not.
I have CC set to clang(both globally and when I run make, i.e., CC=clang make), but the Makefile seems to insist on using gcc and so I can't work around this by trying to use the appropriate compiler. https://github.com/micropython/micropython/blob/master/ports/unix/README.md also explicitly calls out gcc as the compiler to use.
Compiling unix port fails on OS X
I rarely use the unix port so I'm not really sure when this issue appeared - I was able to compile it for a while but at some point it broke with the following error message:
CC ../py/nlrx64.S
../py/nlrx64.S:88:Unknown pseudo-op: .bss
make: *** [build/py/nlrx64.o] Error 1
My limited research suggests that the problem is the ancient version of GNU assembler provided with OS X:
my-computer:unix bryan$ as -v
Apple Inc version cctools-845, GNU assembler version 1.38
Perhaps not as relevant, the version of gcc that gets installed by the XCode command line tools is also quite old, but I don't think that is the problem here:
my-computer:unix bryan$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
Since I don't really know what I'm doing ;^) I tried commenting out the offending .bss opcodes. The build gets past the compile stage, only to fail at the linker stage:
LINK micropython
Undefined symbols for architecture x86_64:
"nlr_jump_fail", referenced from:
.fail in nlrx64.o
(maybe you meant: _nlr_jump_fail)
"___bss_start", referenced from:
_gc_collect in gccollect.o
"__end", referenced from:
_gc_collect in gccollect.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [micropython] Error 1
Any suggestions?