Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2012 04:25:14 +1100
From:      andrew clarke <mail@ozzmosis.com>
To:        Scott Bennett <bennett@cs.niu.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: clang options question
Message-ID:  <20121016172514.GB64734@ozzmosis.com>
In-Reply-To: <201210161552.q9GFqaXj022507@mp.cs.niu.edu>
References:  <201210161552.q9GFqaXj022507@mp.cs.niu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue 2012-10-16 10:52:36 UTC-0500, Scott Bennett (bennett@cs.niu.edu) wrote:

> From looking at the clang(1) man page, it is not clear to me what the
> difference is between the -arch option and the -march= option.  Would
> someone please summarize the difference(s) for me?  Thanks much!

>From the users POV, clang is supposed to be a drop-in replacement for
gcc, where -arch is also an option. Looking online though, it would
appear it's an Apple Darwin (OS X) only feature of gcc for generating
universal binaries.

The question is a bit academic as it doesn't actually do anything in
FreeBSD, at least not for me:

$ clang -o hello -arch x86_64 hello.c
clang: warning: argument unused during compilation: '-arch x86_64'

$ clang -v
clang version 3.1 (branches/release_31)
Target: amd64-portbld-freebsd8.3
Thread model: posix

Nor in Linux (an old version, admittedly):

$ clang -o hello -arch i386 hello.c
clang: warning: argument unused during compilation: '-arch i386'

$ clang -v
clang version 1.1 (branches/release_27)
Target: x86_64-pc-linux-gnu
Thread model: posix

Regards
Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121016172514.GB64734>