I try to build FreeBSD with Clang and get following error
src.conf:
system and clang version:
So i think -fPIC option has no effect on Clang.
Has anyone any ideas how to fix this problem?
Code:
#make buildworld
.....
/usr/local/bin/clang -fpic -DPIC -O2 -pipe -Wtypedef-redefinition -DMAXPAGESIZES=3
-I/src/include -fPIC -I/src/r217821/lib/libc/include -I/src/r217821/lib/libc/../../include
-I/src/r217821/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE
-I/src/r217821/lib/libc/../../contrib/gdtoa -DINET6 -I/usr/obj/src/r217821/lib/libc
-I/src/r217821/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE
-I/src/r217821/lib/libc/../../contrib/tzcode/stdtime -I/src/r217821/lib/libc/stdtime
-I/src/r217821/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN
-I/src/r217821/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -std=gnu99
-fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized
-Wno-pointer-sign -c /src/r217821/lib/libc/string/wmemset.c -o wmemset.So
clang: warning: argument unused during compilation: '-fpic'
building shared library libc.so.7
/usr/obj/src/r217821/tmp/usr/bin/ld: pselect.So: relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
pselect.So: could not read symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Stop in /src/r217821/lib/libc.
*** Error code 1
src.conf:
Code:
.if !defined(CC) || ${CC} == "cc"
CC=/usr/local/bin/clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=/usr/local/bin/clang++
.endif
CFLAGS+=-Wtypedef-redefinition -DMAXPAGESIZES=3 -I/src/include -fPIC
CXXFLAGS+=-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/src/include -fPIC
NO_WERROR=
WERROR=
NO_FSCHG=
system and clang version:
Code:
# uname -a
FreeBSD mrt210 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009
root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
# clang -v
clang version 2.8 (branches/release_28)
Target: x86_64-unknown-freebsd8.0
Thread model: posix
So i think -fPIC option has no effect on Clang.
Has anyone any ideas how to fix this problem?