Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2012 13:45:07 +0200
From:      Edward Meewis <ed@extraordinarymachine.nl>
To:        freebsd-current@freebsd.org
Subject:   Re: Building world with clang ToT
Message-ID:  <505075C3.7010504@extraordinarymachine.nl>
In-Reply-To: <50506D6E.3040905@FreeBSD.org>
References:  <5050680C.4020402@extraordinarymachine.nl> <50506D6E.3040905@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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"




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