llvm-gcc and -march

Hi,

I apologize if I am not asking on the right mailing list.

I am using the llvm-gcc4.2 from MacPorts.
https://trac.macports.org/browser/trunk/dports/lang/llvm-gcc42/Portfile

llvm-gcc does not seem to accept the -march flag. This is the error,
I got:

cc1: error: unrecognized command line option "-march"

The port developer asked me to find out if this is a known issue.

[yendi:~] echristo% llvm-gcc -march=nocona foo.c -S
[yendi:~] echristo%

Seems to work for me with the llvm-gcc installed on my machine. What are you doing?

-eric

llvm-gcc 4.2 should support almost exactly the same command-line
options as gcc 4.2, including -march. How exactly are you getting
this error?

-Eli

This comes up when trying to compile Valgrind, here is the full compile line:

/opt/local/bin/llvm-gcc-4.2 -Wbad-function-cast -Wcast-qual
-Wcast-align -fstrict-aliasing \
         -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
-Wno-format-zero-length -fno-strict-aliasing -mmacosx-version-min=10.5
-fno-stack-protector \
        -O -S -o auxprogs/genoffsets.s \
           auxprogs/genoffsets.c

Still nothing here:

[yendi:~] echristo% llvm-gcc -march=nocona foo.c -S -arch x86_64
[yendi:~] echristo%

So, perhaps you could send more information? Or bug the mac ports people.

-eric

Here is some more info:

[naromero:~/pmr] naromero% llvm-gcc -v
Using built-in specs.
Target: x86_64-apple-darwin10
Configured with: ../llvm-gcc-4.2-2.9.source/configure
--prefix=/opt/local --host=x86_64-apple-darwin10
--enable-llvm=/opt/local --enable-languages=c,c++,objc,obj-c++,fortran
--libdir=/opt/local/lib/llvm-gcc42
--includedir=/opt/local/include/llvm-gcc42
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-prefix=llvm- --program-suffix=-4.2 --with-gmp=/opt/local
--with-mpfr=/opt/local --with-build-time-tools=/usr/bin
--with-gxx-include-dir=/usr/include/c++/4.2.1 --with-slibdir=/usr/lib
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)

I tried this on a simple file using your syntax and it still didn't work.
[naromero:~/pmr] naromero% llvm-gcc -march=nocona pow.c -S -arch x86_64
cc1: error: unrecognized command line option "-arch"

Not that this macport is using LLVM 2.9.

The -arch option is handled by Apple's "driver-driver", and the MacPorts build is probably not using that. See the driverdriver.c source file in llvm-gcc for details.

The -arch option is handled by Apple's "driver-driver", and the MacPorts build is probably not using that. See the driverdriver.c source file in llvm-gcc for details.

He's asking about the -march option which should work either way.

Also, the driver-driver should be in the sources that they're using even still.

Nichols: You might want to talk to the llvm-gcc port maintainer. There's nothing obviously wrong other than it not working for you so I'm not sure what's going on.

-eric

So my original post subject was for -march, but that was my mistake.
The command line option
is -arch.

Since presumably Macports is just fetching an llvm tar ball from some
repository, is the issue that llvm
has been misconfigure in some obvious way? Yes, I can take a look at
the driverdriver.c source file
as well.

Should this also be working in LLVM 2.9 or is the latest SVN also needed?

So my original post subject was for -march, but that was my mistake.
The command line option
is -arch.

*sigh*

Since presumably Macports is just fetching an llvm tar ball from some
repository, is the issue that llvm
has been misconfigure in some obvious way? Yes, I can take a look at
the driverdriver.c source file
as well.

Just plain configure/make/make install won't build the driver driver. You need an apple style buildit for that. Check out the build_llvm or build_gcc scripts in the source directory for a guideline.

Should this also be working in LLVM 2.9 or is the latest SVN also needed?

2.9 should be fine.

-eric