Re: Relocatable linking with relocations from format elf64-x86-64-freebsd (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

2011-08-18 Thread Dimitry Andric

On 2011-08-18 07:01, Alexander Best wrote:

i'm getting this error, when trying to make target buildwork with clang.


You mean with make target buildwork, that you are running make
buildworld TARGET=whatever, right?

...

this is the error i'm getting:

===  lib/csu/i386-elf (obj,depend,all,install)

...

clang -O2 -pipe -fno-strict-aliasing -fno-omit-frame-pointer -frename-registers 
-I/usr/git-freebsd-head/lib/csu/i386-elf/../common  
-I/usr/git-freebsd-head/lib/csu/i386-elf/../../libc/include -DSTRIP_FBSDID 
-std=gnu99  -Wsystem-headers -Wall -Wno-format-y2k -Wextra 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
-Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls 
-Wold-style-definition -Wno-pointer-sign  -c 
/usr/git-freebsd-head/lib/csu/i386-elf/crt1_s.S
clang: warning: argument unused during compilation: '-frename-registers'
ld -m elf_i386_fbsd -Y P,/usr/obj/usr/git-freebsd-head/lib32/usr/lib32  -o 
gcrt1.o -r crt1_s.o gcrt1_c.o
ld: Relocatable linking with relocations from format elf64-x86-64-freebsd 
(crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported


Most likely, this is because you are forcing CC=clang, which does not
work as expected.  Can you please post your /etc/make.conf and
/etc/src.conf files, and show us any environment variables related to
buildworld?  Also, how exactly are you running make buildworld?
___
freebsd-toolchain@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org


Re: Relocatable linking with relocations from format elf64-x86-64-freebsd (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

2011-08-18 Thread Alexander Best
On Thu Aug 18 11, Dimitry Andric wrote:
 On 2011-08-18 07:01, Alexander Best wrote:
 i'm getting this error, when trying to make target buildwork with clang.
 
 You mean with make target buildwork, that you are running make
 buildworld TARGET=whatever, right?
 
 ...
 this is the error i'm getting:
 
 ===  lib/csu/i386-elf (obj,depend,all,install)
 ...
 clang -O2 -pipe -fno-strict-aliasing -fno-omit-frame-pointer 
 -frename-registers -I/usr/git-freebsd-head/lib/csu/i386-elf/../common  
 -I/usr/git-freebsd-head/lib/csu/i386-elf/../../libc/include -DSTRIP_FBSDID 
 -std=gnu99  -Wsystem-headers -Wall -Wno-format-y2k -Wextra 
 -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes 
 -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch 
 -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
 -Wnested-externs -Wredundant-decls -Wold-style-definition 
 -Wno-pointer-sign  -c /usr/git-freebsd-head/lib/csu/i386-elf/crt1_s.S
 clang: warning: argument unused during compilation: '-frename-registers'
 ld -m elf_i386_fbsd -Y P,/usr/obj/usr/git-freebsd-head/lib32/usr/lib32  -o 
 gcrt1.o -r crt1_s.o gcrt1_c.o
 ld: Relocatable linking with relocations from format elf64-x86-64-freebsd 
 (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported
 
 Most likely, this is because you are forcing CC=clang, which does not
 work as expected.  Can you please post your /etc/make.conf and
 /etc/src.conf files, and show us any environment variables related to
 buildworld?  Also, how exactly are you running make buildworld?

i've attached my src.conf, my make.conf and the output of 'env'. nothing
special, i'm using a simple 'make buildworld'.

i'm now trying to reproduce the issue with a fresh src snapshot

cheers.
alex
# WORLD/KERNEL options
KERNCONF = ARUNDEL
#KERNCONF = GENERIC
#MODULES_OVERRIDE = \
#netgraph/netgraph netgraph/socket netgraph/bluetooth/bluetooth \
#netgraph/bluetooth/hci netgraph/bluetooth/l2cap netgraph/bluetooth/socket \
#netgraph/bluetooth/ubt tmpfs sound/sound sound/driver/hda usb/uhid \
#procfs pseudofs linux linprocfs linsysfs lindev usb/quirk geom \

#MODULES_OVERRIDE =
MODULES_WITH_WORLD = yes
#opensolaris dtrace cyclic nfsclient krpc nfs_common nfslock usb/quirk geom

#CC = /usr/local/bin/clang# -B/usr/bin
CC = clang
#CC = /usr/bin/clang
#CC= /usr/local/bin/pcc
#CXX = /usr/local/bin/clang++# -B/usr/bin
CXX = clang++
#CC=/usr/bin/cc
#CXX=/usr/bin/c++
#CPP=/usr/bin/cpp

# compiler flags
CPUTYPE ?= core2
#COPTFLAGS = -O2 -pipe -fno-builtin -frename-registers -fno-strict-aliasing
#COPTFLAGS = -O3 -pipe -fno-inline-functions# -frename-registers# -fno-builtin 
-fno-strict-aliasing
CFLAGS = -O2 -pipe -fno-strict-aliasing -fno-omit-frame-pointer 
-frename-registers# -fno-builtin
#CFLAGS = -O3 -pipe -fno-inline-functions -fno-omit-frame-pointer 
-fno-strict-aliasing -fno-builtin -frename-registers

# SENDMAIL options
SENDMAIL_MC = /etc/mail/freebsd.mc
SENDMAIL_SUBMIT_MC = /etc/mail/freebsd.submit.mc

# PORTS options
OVERRIDE_LINUX_BASE_PORT = f10
OVERRIDE_LINUX_NONBASE_PORTS = f10
DA4 = yes
WITH_BSDEL = yes
WITH_256_COLOR = yes
WITH_LCD_FILTERING = yes
GENTOO_OPTIMIZED = i686

# added by use.perl 2011-08-15 19:48:33
PERL_VERSION=5.12.4
# Don't die on warnings
NO_WERROR=
WERROR=
# Don't forget this when using Jails!
#NO_FSCHG=

#CWARNFLAGS?=   -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes\
#   -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual\
#   -Wundef -Wmissing-include-dirs

# Enable debugging symbols for world
CFLAGS += -DSTRIP_FBSDID
BURN_BRIDGES=yes

# BUILDWORLD options
BOOT2_UFS=UFS2_ONLY # don't need UFS1 support anymore
GPTBOOT_UFS=UFS2_ONLY   # don't need UFS1 support anymore
WITHOUT_ACCT=true
#WITHOUT_ACPI=true  # needed by VirtualBox
WITHOUT_AMD=true
WITHOUT_APM=true
#WITHOUT_ASSERT_DEBUG=true  # broken
WITHOUT_AT=true
WITHOUT_ATM=true
WITHOUT_AUDIT=true
WITHOUT_BIND=true
WITHOUT_GPIO=true
WITH_BSD_GREP=true
WITHOUT_BSNMP=true
WITHOUT_CALENDAR=true
#WITHOUT_CDDL=true  # needed for dtrace
WITHOUT_CTM=true
WITHOUT_CVS=true
WITHOUT_FLOPPY=true
#WITHOUT_FORTH=true # needed for bootloader
WITHOUT_FREEBSD_UPDATE=true
WITHOUT_GAMES=true
#WITHOUT_GNU=true   # no effect
WITHOUT_GPIB=true
#WITHOUT_GSSAPI=true# needed for md2()
WITHOUT_HTML=true
WITH_IDEA=true
WITHOUT_INET6=true
#WITHOUT_INFO=true  # needed by ports (`install-info`)
#WITHOUT_INSTALLLIB=yes # DON'T USE
WITHOUT_IPFILTER=true
WITHOUT_IPFW=true
WITHOUT_IPX=true
WITHOUT_JAIL=true
WITHOUT_KERBEROS=true   # possible?
WITHOUT_KERBEROS_SUPPORT=true
WITHOUT_LPR=true
WITHOUT_NDIS=true
WITHOUT_NETCAT=true
WITHOUT_NIS=true
WITHOUT_NLS=true
WITHOUT_NLS_CATALOGS=true
WITHOUT_NS_CACHING=true
WITHOUT_PAM_SUPPORT=true
WITHOUT_PF=true
WITHOUT_PMC=true
WITHOUT_PPP=true
WITHOUT_PROFILE=true# for using gprof(1)
WITHOUT_QUOTAS=true
WITHOUT_RCMDS=true

Re: Relocatable linking with relocations from format elf64-x86-64-freebsd (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

2011-08-18 Thread Dimitry Andric

On 2011-08-18 19:35, Alexander Best wrote:
...

ld: Relocatable linking with relocations from format elf64-x86-64-freebsd
(crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

Most likely, this is because you are forcing CC=clang, which does not
work as expected.  Can you please post your /etc/make.conf and
/etc/src.conf files, and show us any environment variables related to
buildworld?  Also, how exactly are you running make buildworld?


i've attached my src.conf, my make.conf and the output of 'env'. nothing
special, i'm using a simple 'make buildworld'.


The problem is in your make.conf. Effectively, you are doing:

CC = clang
CXX = clang++

which will not work, at least not for the 32-bit compat stage on amd64.
Please use the following fragment instead, which is recommended on
http://wiki.freebsd.org/BuildingFreeBSDWithClang:

.if !defined(CC) || ${CC} == cc
CC=clang
.endif
.if !defined(CXX) || ${CXX} == c++
CXX=clang++
.endif
.if !defined(CPP) || ${CPP} == cpp
CPP=clang -E
.endif
___
freebsd-toolchain@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org


Re: Relocatable linking with relocations from format elf64-x86-64-freebsd (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

2011-08-18 Thread Warner Losh
We really need a 'SYSTEM_COMPILER={gcc,clang,xxx}' sort of knob.

Warner

On Aug 18, 2011, at 2:04 PM, Kostik Belousov wrote:

 On Thu, Aug 18, 2011 at 09:54:41PM +0200, Dimitry Andric wrote:
 The problem is in your make.conf. Effectively, you are doing:
 
 CC = clang
 CXX = clang++
 
 which will not work, at least not for the 32-bit compat stage on amd64.
 Please use the following fragment instead, which is recommended on
 http://wiki.freebsd.org/BuildingFreeBSDWithClang:
 
 .if !defined(CC) || ${CC} == cc
 CC=clang
 .endif
 .if !defined(CXX) || ${CXX} == c++
 CXX=clang++
 .endif
 .if !defined(CPP) || ${CPP} == cpp
 CPP=clang -E
 .endif
 
 May be, add the commented out lines into share/examples/etc/make.conf ?

___
freebsd-toolchain@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org