From owner-freebsd-current@FreeBSD.ORG Wed Sep 12 11:45:44 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 050DD106566C for ; Wed, 12 Sep 2012 11:45:44 +0000 (UTC) (envelope-from ed@extraordinarymachine.nl) Received: from smtp-vbr11.xs4all.nl (smtp-vbr11.xs4all.nl [194.109.24.31]) by mx1.freebsd.org (Postfix) with ESMTP id 49D318FC08 for ; Wed, 12 Sep 2012 11:45:41 +0000 (UTC) Received: from jazzed.meewis.home (a80-101-71-20.adsl.xs4all.nl [80.101.71.20]) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8CBjAdX049686 for ; Wed, 12 Sep 2012 13:45:10 +0200 (CEST) (envelope-from ed@extraordinarymachine.nl) Received: from [192.168.1.254] (unknown [192.168.1.254]) by jazzed.meewis.home (Postfix) with ESMTP id 986AF5C0C for ; Wed, 12 Sep 2012 13:45:10 +0200 (CEST) Message-ID: <505075C3.7010504@extraordinarymachine.nl> Date: Wed, 12 Sep 2012 13:45:07 +0200 From: Edward Meewis User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <5050680C.4020402@extraordinarymachine.nl> <50506D6E.3040905@FreeBSD.org> In-Reply-To: <50506D6E.3040905@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Re: Building world with clang ToT 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: Wed, 12 Sep 2012 11:45:44 -0000 Hi Dimitry, On 12-09-12 13:09, Dimitry Andric wrote: > On 2012-09-12 12:46, Edward Meewis wrote: >> Has anyone recently built FreeBSD10-current with clang on a FreeBSD9 >> amd64 system? >> >> I've bumped into a number of issues. Mainly, buildworld picks up the old >> system includes, which miss newly introduced symbols; same thing with >> libraries. I fixed that by pointing compiler and linker to >> /usr/obj/FreeBSD-HEAD/tmp/include and lib. > > Strange, it should not do that. How exactly did you "point compiler and > linker"? What is your make.conf and/or src.conf? > > If had to hazard a guess based on this information alone, I would say > you are assigning to CFLAGS somewhere, instead of using +=. > I added the following lines to each individual Makefile it stumbled on: CFLAGS+= -I/usr/obj/usr/home/emeewis/src/FreeBSD-HEAD/tmp/usr/include LDADD+=-L/usr/obj/usr/home/emeewis/src/FreeBSD-HEAD/tmp/usr/lib or: LDFLAGS+=-L/usr/obj/usr/home/emeewis/src/FreeBSD-HEAD/tmp/usr/lib I hope to find a better place to set those, but it will do for now. > >> Building stops in lib/libstand: >> >> /usr/home/emeewis/src/FreeBSD-HEAD/lib/libstand/i386/_setjmp.S:50:82: >> error: register %rbp is only available in 64-bit mode >> .text; .p2align 4,0x90; .globl _setjmp; .type _setjmp,@function; >> _setjmp:; pushq %rbp; movq %rsp,%rbp; call .mcount; popq %rbp; 9: >> >> Libstand is build in i386 mode, but includes machine/asm.h in _setjmp.S. >> Is there a way to force it to use i386/asm.h? >> >> I had a go with gcc, but I got the same results... > > There must be a certain setting on your system which causes this. Most > likely, it is again using your existing system headers, instead of those > in /usr/obj. I suppose so, but where? Thanks for your help, Edward /etc/make.conf: ---------------------- # # Clang # USE_CLANG?=no # .if ${USE_CLANG} == "yes" .if !defined(CC) || ${CC} == "cc" CC=/usr/local/bin/clang .endif .if !defined(CXX) || ${CXX} == "c++" CXX=/usr/local/bin/clang++ .endif .if !defined(CPP) || ${CPP} == "cpp" #CPP=/usr/local/bin/clang .endif # Don't die on warnings NO_WERROR= WERROR= # Don't forget this when using Jails! NO_FSCHG= .endif # # Build kernel options # BOOTWAIT=5 KERNCONF=AMD-Minimal # # Kernel modules # # Needed by ssh and bind MODULES_OVERRIDE+=random # # Power management options MODULES_OVERRIDE+=cpuctl cpufreq #MODULES_OVERRIDE+=coretemp # # Legacy ATA support MODULES_OVERRIDE+=ata/atacore ata/atapci MODULES_OVERRIDE+=ata/atapicd MODULES_OVERRIDE+=md # # File systems MODULES_OVERRIDE+=procfs pseudofs MODULES_OVERRIDE+=msdosfs cd9660 MODULES_OVERRIDE+=krpc nfscl nfscommon nfslock nfssvc MODULES_OVERRIDE+=libiconv smbfs #MODULES_OVERRIDE+=ntfs # # Networking MODULES_OVERRIDE+=netgraph/netgraph MODULES_OVERRIDE+=mii re # # USB MODULES_OVERRIDE+=usb/usb MODULES_OVERRIDE+=usb/ugensa MODULES_OVERRIDE+=usb/uhci usb/ohci usb/ehci # HIDs, keyboards and mice MODULES_OVERRIDE+=usb/uhid usb/ukbd usb/ums # Printers #MODULES_OVERRIDE+=usb/ulpt # Storage MODULES_OVERRIDE+=usb/umass # # Graphic display MODULES_OVERRIDE+=agp MODULES_OVERRIDE+=drm/drm drm/i915 # # Serial port MODULES_OVERRIDE+=uart # # Parallel port MODULES_OVERRIDE+=ppc ppbus lpt # Parallel "Geek" port #MODULES_OVERRIDE+=ppi # # I2C bus #MODULES_OVERRIDE+=i2c/iicbus i2c/smbus i2c/smb #MODULES_OVERRIDE+=i2c/controllers/intpm # # Sound MODULES_OVERRIDE+=sound/sound sound/driver/hda # # Linux emulation #MODULES_OVERRIDE+=linux linprocfs # # Needed for firefox HTML5 #MODULES_OVERRIDE+=sem # added by use.perl 2012-02-16 20:40:59 PERL_VERSION=5.12.4 /etc/src.conf ------------------ # src.conf - Source build options #WITHOUT_TOOLCHAINS="yes" WITHOUT_ATM="yes" WITHOUT_BLUETOOTH="yes" WITHOUT_BSNMP="yes" WITHOUT_CDDL="yes" WITHOUT_CLANG="yes" WITHOUT_CTM="yes" WITHOUT_CVS="yes" WITHOUT_GCC="yes" #WITHOUT_GROFF="yes" WITHOUT_IPX="yes" WITHOUT_IPX_SUPPORT="yes" WITHOUT_LIB32="yes" WITHOUT_NCP="yes" WITHOUT_OBJC="yes" WITHOUT_PPP="yes" WITHOUT_RCMDS="yes" WITHOUT_RESCUE="yes" WITHOUT_RCS="yes" WITHOUT_SENDMAIL="yes" WITHOUT_WIRELESS="yes" WITHOUT_WIRELESS_SUPPORT="yes" WITHOUT_WPA_SUPPLICANT_EAPOL="yes" WITHOUT_ZFS="yes"