From owner-freebsd-questions@FreeBSD.ORG Wed Oct 17 10:27:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A30D769A for ; Wed, 17 Oct 2012 10:27:20 +0000 (UTC) (envelope-from bennett@cs.niu.edu) Received: from mp.cs.niu.edu (mp.cs.niu.edu [131.156.145.41]) by mx1.freebsd.org (Postfix) with ESMTP id 715CE8FC16 for ; Wed, 17 Oct 2012 10:27:17 +0000 (UTC) Received: from mp.cs.niu.edu (bennett@localhost [127.0.0.1]) by mp.cs.niu.edu (8.14.3/8.14.3) with ESMTP id q9HAQLBD004122; Wed, 17 Oct 2012 05:26:21 -0500 (CDT) Date: Wed, 17 Oct 2012 05:26:21 -0500 (CDT) From: Scott Bennett Message-Id: <201210171026.q9HAQLRC004121@mp.cs.niu.edu> To: mail@ozzmosis.com Subject: Re: clang options question Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 10:27:20 -0000 On Wed, 17 Oct 2012 04:25:14 +1100 andrew clarke wrote: >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. Oh. Okay. Thanks for the Darwin info, too. I hadn't known that OS X had carried on NEXTSTEP's support for fat 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 > I see. So it's just decoration for compatibility with gcc and something to worry about. Thanks very much for the response. Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at cs.niu.edu * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************