From owner-freebsd-current@FreeBSD.ORG Mon Sep 10 13:13:42 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90AA16A417 for ; Mon, 10 Sep 2007 13:13:42 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 29EF113C46B for ; Mon, 10 Sep 2007 13:13:42 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A577AC.dip.t-dialin.net [84.165.119.172]) by redbull.bpaserver.net (Postfix) with ESMTP id B1E5A2E185; Mon, 10 Sep 2007 15:13:08 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 695E05B4926; Mon, 10 Sep 2007 15:12:50 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l8ADCn0u054838; Mon, 10 Sep 2007 15:12:49 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Mon, 10 Sep 2007 15:12:48 +0200 Message-ID: <20070910151248.2ayzbtrdww40kkso@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 10 Sep 2007 15:12:48 +0200 From: Alexander Leidinger To: Ian FREISLICH References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-14.9, required 8, BAYES_00 -15.00, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: Luigi Rizzo , current@freebsd.org Subject: Re: Building asterisk - undefined reference to `__sync_fetch_and_add_4' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2007 13:13:42 -0000 Quoting Ian FREISLICH (from Mon, 10 Sep 2007 =20 14:35:30 +0200): > Luigi Rizzo wrote: >> On Mon, Sep 10, 2007 at 12:04:10PM +0200, Ian FREISLICH wrote: >> > Hi >> > >> > I was wondering if anyone else is having this problem building >> > asterisk on -CURRENT. The problem may not be with FreeBSD - it >> > looks like gnu configure is incorrectly detecting the CPU as "i386" >> > when it's actually a pentium3: >> > >> > configure: Package configured for: >> > configure: OS type : freebsd7.0 >> > configure: Host CPU : i386 >> > =3D=3D=3D> Building for asterisk-1.4.11 >> > >> > The i386 doesn't have any atomic primatives or something like that >> > (maybe just according to gcc-4.2). If I frob the configured sources >> > and change the i386 to pentium3, then the build works, but I don't >> > have enough asterisk foo at this point to verify that it actually >> > works. >> >> i don't completely understand what is happening here - i386 presumably >> refers to the architecture, not to the very-low-level details of >> the architecture, so there should not be anything specific to >> one processor of the family in the flags passed to the compiler. > > The trouble is that the asterisk build translates this into -march=3Di386 > and -mcpu=3Di386 or -mtune=3Di386 which has that low level effect. At > least the old asterisk port did this, I haven't yet figured out > what the new 1.4.11 asterisk is doing. > > I'm inclined to believe that i386 in the FreeBSD context means > something fundamentally different to the same in the Linux context. On Linux this is set to the target architecture which shall be =20 supported. Values are i386, i486, i586, ... and maybe some not so =20 generic ones like pentium4 (maybe all values which gcc supports for =20 -march). We just put the architecture of the system (${ARCH}) into it. On =20 FreeBSD-amd64 this is amd64 (linux uses x86_64), for FreeBSD-i386 this =20 is i386, ... I think we don't set it to something else, because nobody cared to do =20 it so far. Now... when you have a look at =20 http://www.Leidinger.net/FreeBSD/port-patches/Mk:bsd.port.mk.diff you =20 will see (if you search for it, the diff contains more than just this =20 patch) how we could do this based upon the value of CPUTYPE (the =20 packages are tailored to the same CPU as the world). Bye, Alexander. --=20 Men of peace usually are [brave]. =09=09-- Spock, "The Savage Curtain", stardate 5906.5 http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137