From owner-freebsd-current@FreeBSD.ORG Mon Sep 10 12:36:10 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 2CE9F16A418 for ; Mon, 10 Sep 2007 12:36:10 +0000 (UTC) (envelope-from ianf@clue.co.za) Received: from munchkin.clue.co.za (munchkin.clue.co.za [66.219.59.160]) by mx1.freebsd.org (Postfix) with ESMTP id C845113C481 for ; Mon, 10 Sep 2007 12:36:09 +0000 (UTC) (envelope-from ianf@clue.co.za) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=20070313; d=clue.co.za; h=Received:Received:Received:To:cc:From:Subject:In-Reply-To:X-Attribution:Date:Message-Id; b=UI63atEUCotG1CDW36ceZAG3C4J7tPKv//QliMvdnhu6P+8zs/8Zr24B5Rj1NvAxyM1Hp/eqD9UrIe9+cSdrh1vPLovH2r3wFRFDcLstH0jmLUhEaGzRWuq1KsL59imrQsVwUwu1vA2+i4Cdib7u4r16kW+nDeFM3DjVY2HUOqRLcBlZMm/sfjAQ18oNJz/x8pqH5/IYQ2WrAmh6pZncPHT/DEfq0QvUf288t3CxLHsg7YIBjDWLDpSto3F8m4fv; Received: from uucp by munchkin.clue.co.za with local-rmail (Exim 4.66) (envelope-from ) id 1IUiUr-0008Qq-Ut; Mon, 10 Sep 2007 12:36:09 +0000 Received: from ianf.clue.co.za ([10.0.0.6] helo=clue.co.za) by urchin.clue.co.za with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.66) (envelope-from ) id 1IUiUG-0007gr-8C; Mon, 10 Sep 2007 12:35:32 +0000 Received: from localhost ([127.0.0.1] helo=clue.co.za) by clue.co.za with esmtp (Exim 4.68 (FreeBSD)) (envelope-from ) id 1IUiUE-000NkE-7B; Mon, 10 Sep 2007 14:35:30 +0200 To: Luigi Rizzo From: Ian FREISLICH In-Reply-To: Message from Luigi Rizzo of "Mon, 10 Sep 2007 04:23:55 MST." <20070910042355.A45937@xorpc.icir.org> X-Attribution: BOFH Date: Mon, 10 Sep 2007 14:35:30 +0200 Message-Id: Cc: 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 12:36:10 -0000 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 > > ===> 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=i386 and -mcpu=i386 or -mtune=i386 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. > Could it be that it's a compiler bug instead (or something in > your /etc/make.conf which is forcing compiler-specific optimizations > but only for a part of the build or the libraries) ? It builds if I don't set CPUTYPE=p3 in /etc/make.conf. So, I guess that's the fix. Ian -- Ian Freislich