Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Failed building NetBSD current at 6.99.40 with BSD toolchain



Before I tried building NetBSD/amd64 with pure BSD
toolchain(clang/r207350+elftoolchain of head+llvm-lld/r207350, hope one day
we get a pure BSD Licensed base system), I did successfully build the same
version of the NetBSD with the following mk.conf, and after upgraded to this
version, I did not cvs update any part of the src tree.
 (when I swithed on the BUILD_LEGACY=yes knob, the build failed at the stage
of linking libcold.so.0.0 something, when commented it out, the building
process was smooth. But clang+elftoolchain+lld can survive BUILD_LEGACY=yes
and successfully build libcold.so.0.0)

#####################
## SYSTEM BUILDING ##
#####################

#TOOLCHAIN_MISSING=yes
#EXTERNAL_TOOLCHAIN=/usr/pkg
NOGCCERROR=yes
MKGCC=no
MKGCCCMDS=no
MKBINUTILS=no
HAVE_LIBGCC=no
 HAVE_LIBGCC_EH=no
 UNSUPPORTED_COMPILER.gcc=yes
MKLLVM=yes
MKLIBCXX=yes
HAVE_LLVM=yes
MKBSDGREP=yes
MKATF=no
MKCATPAGES=no
MKCOMPAT=no
MKCROSSGDB=no
MKCVS=no
MKDEBUG=no
MKDEBUGLIB=no
MKDOC=no
MKGDB=no
 MKGROFF=no
MKHTML=no
MKINFO=no
MKIPFILTER=no
MKLIBSTDCXX=no
MKMANZ=yes
MKPF=no
MKPOSTFIX=no
MKPROFILE=no
MKYP=no
#BUILD_LEGACY=yes
USE_FORT=no
USE_SSP=no

when building with the BSD toolchain with the command ./build.sh -O ../obj
-T ../obj/tools -u -U distribution, I got this error.(same mk.conf, except
the first two lines and commented out MKLLVM=yes and MKLIBCXX=yes, the tools
was successfully built with the command ./build.sh -O ../obj -T ../obj/tools
tools, I tried different version of clang, from in tree version/r202566 to
recent version/r207350 and some versions in between, same error.)

clang+elftoolchain(head r3029)+lld

#   compile  csu/crt0.o
clang     -DELFSIZE=64 -I/usr/src/libexec/ld.elf_so
-I/usr/src/lib/csu/common -I.  -x assembler-with-cpp -c
/usr/src/lib/csu/arch/x86_64/crt0.S -o crt0.o.S.o
 clang -O2  -std=gnu99  -Wno-sign-compare -Wno-pointer-sign  -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare
-Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra
-Wno-unused-parameter -Wno-sign-compare -Wold-style-definition
-Wsign-compare -Wformat=2   -Wpointer-sign -Wmissing-noreturn     
-DELFSIZE=64 -I/usr/src/libexec/ld.elf_so -I/usr/src/lib/csu/common -I.  -c
-fPIC /usr/src/lib/csu/common/crt0-common.c -o crt0.o.c.o
 ld -r -o crt0.o.o crt0.o.S.o crt0.o.c.o
Stack dump:
0.      Program arguments: ld -r -o crt0.o.o crt0.o.S.o crt0.o.c.o
*** Signal 11

Stop.
make[1]: stopped in /usr/src/lib/csu
*** Error code 1

Stop.
 make: stopped in /usr/src/lib/csu

Later, I found a solution, in the file src/lib/csu/common/Makefile.inc I
commented out the line
#PICFLAGS ?= -fPIC, it successfully passed this stage, but it failed again
at the following stage of building libwrap.so.1.0, I don't know if the
change I made is relevent to this error.

#     build  libwrap/libwrap.so.1.0
rm -f libwrap.so.1.0
/usr/pkg/bin/x86_64--netbsd-clang  -Wl,-x -shared -Wl,-soname,libwrap.so.1
-Wl,-
-warn-shared-textrel -Wl,-Map=libwrap.so.1.map   -Wl,--fatal-warnings  -o
libwra
 p.so.1.0  -Wl,-rpath-link,/usr/src/../obj/destdir.amd64/lib  -L=/lib 
-Wl,--whol
e-archive libwrap_pic.a  -Wl,--no-whole-archive
warning: ignoring unknown argument: -x
warning: ignoring unknown argument: --warn-shared-textrel
 warning: ignoring unknown argument: -Map=libwrap.so.1.map
warning: ignoring unknown argument: --fatal-warnings
Undefined symbol: libwrap_pic.a(refuse.pico): deny_severity
Undefined symbol: libwrap_pic.a(options.pico): allow_severity
 symbol(s) not found
clang-3.5: error: linker command failed with exit code 1 (use -v to see
invocati
on)

*** Failed target:  libwrap.so.1.0
*** Failed command: /usr/pkg/bin/x86_64--netbsd-clang -Wl,-x -shared
-Wl,-soname
 ,libwrap.so.1 -Wl,--warn-shared-textrel -Wl,-Map=libwrap.so.1.map
-Wl,--fatal-wa
rnings -o libwrap.so.1.0 -Wl,-rpath-link,/usr/src/../obj/destdir.amd64/lib
-L=/l
ib -Wl,--whole-archive libwrap_pic.a -Wl,--no-whole-archive
 *** Error code 1

Stop.
nbmake[6]: stopped in /usr/src/lib/libwrap

*** Failed target:  dependall
*** Failed command: cd "/usr/src/lib/libwrap";
/usr/src/../obj/tools/bin/nbmake
realall
*** Error code 1

Stop.
nbmake[5]: stopped in /usr/src/lib/libwrap

*** Failed target:  dependall-libwrap
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift;
case
 "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="lib/";
real="/usr/src
 /lib" ;; *) this="lib/${dir}/"; real="/usr/src/lib/${dir}" ;; esac;
show=${this:
-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/usr/src/
 ../obj/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
_makedirtarget li
bwrap dependall
*** Error code 1

Stop.
nbmake[4]: stopped in /usr/src/lib

*** Failed target:  build_install
 *** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift;
case
 "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="lib/";
real="/usr/src
 /lib" ;; *) this="lib/${dir}/"; real="/usr/src/lib/${dir}" ;; esac;
show=${this:
-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/usr/src/
 ../obj/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
_makedirtarget .
dependall-i18n_module dependall-libarch dependall-libbluetooth
dependall-libbsdm
alloc dependall-libbz2 dependall-libcompat dependall-libcrypt
dependall-libintl
 dependall-libipsec dependall-libkvm dependall-libm dependall-libossaudio
dependa
ll-libpci dependall-libpmc dependall-libposix dependall-libprop
dependall-libpth
read dependall-libpthread_dbg dependall-libpuffs dependall-libresolv
dependall-l
 ibrmt dependall-librpcsvc dependall-librt dependall-libtelnet
dependall-libtermi
nfo dependall-libusbhid dependall-libutil dependall-libwrap dependall-liby
depen
dall-libz dependall-libkern dependall-librumpclient dependall-libskey
dependall-
 ../external/apache2/mDNSResponder/lib
dependall-../external/bsd/am-utils/lib dep
endall-../external/bsd/flex/lib dependall-../external/bsd/tre/lib
dependall-../e
xternal/bsd/elftoolchain/lib/libelf dependall-../external/bsd/liblzf/lib
dependa
 ll-../external/bsd/libpcap/lib dependall-../external/mit/expat/lib
dependall-../
external/public-domain/sqlite/lib dependall-../external/public-domain/xz/lib
dep
endall-../gnu/lib/libmalloc

*** Error code 1

Stop.
nbmake[3]: stopped in /usr/src/lib

*** Failed target:  do-lib
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift;
case
 "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="";
real="/usr/src" ;;
  *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
"${tar
get} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/usr/src/../obj/tools/bin
/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget lib
build_install
 *** Error code 1

Stop.
nbmake[2]: stopped in /usr/src

*** Failed target:  build
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift;
case
 "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="";
real="/usr/src" ;;
  *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
"${tar
get} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/usr/src/../obj/tools/bin
/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . do-lib
 *** Error code 1

Stop.
nbmake[1]: stopped in /usr/src

*** Failed target:  distribution
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift;
case
 "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="";
real="/usr/src" ;;
  *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
"${tar
get} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/usr/src/../obj/tools/bin
/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . build
NOPOSTINST
 ALL=1
*** Error code 1

Stop.
nbmake: stopped in /usr/src

ERROR: Failed to make distribution
*** BUILD ABORTED ***


I also tried another build with gnu ld in the same system to test, it failed
build different targets depend on the version of elftoolchain.

clang+elftoolchain(0.5.1 in pkgsrc)+gnu ld

#     build  libc/libc.so.12.190
rm -f libc.so.12.190
/usr/pkg/bin/x86_64--netbsd-clang -nodefaultlibs -Wl,-x -shared
-Wl,-soname,libc.so.12 -Wl,--

warn-shared-textrel -Wl,-Map=libc.so.12.map -Wl,-z,initfirst -Wl,-z,defs  
-Wl,--fatal-warnings  

-o libc.so.12.190  -Wl,-rpath,/lib  -L=/lib  -Wl,--whole-archive libc_pic.a 
-Wl,--no-whole-

archive
 libc_pic.a(negvdi2.pico): In function `__negvdi2':
(.text+0x2f): undefined reference to `compilerrt_abort_impl'
libc_pic.a(mulvdi3.pico): In function `__mulvdi3':
(.text+0x31): undefined reference to `compilerrt_abort_impl'
 libc_pic.a(mulvdi3.pico): In function `__mulvdi3':
(.text+0x54): undefined reference to `compilerrt_abort_impl'
libc_pic.a(mulvdi3.pico): In function `__mulvdi3':
(.text+0xaa): undefined reference to `compilerrt_abort_impl'
 libc_pic.a(mulvdi3.pico): In function `__mulvdi3':
(.text+0xd8): undefined reference to `compilerrt_abort_impl'
libc_pic.a(absvdi2.pico):(.text+0x39): more undefined references to
`compilerrt_abort_impl' 

follow
clang-3.5: error: linker command failed with exit code 1 (use -v to see
invocation)

*** Failed target:  libc.so.12.190
*** Failed command: /usr/pkg/bin/x86_64--netbsd-clang -nodefaultlibs -Wl,-x
-shared -Wl,-

soname,libc.so.12 -Wl,--warn-shared-textrel -Wl,-Map=libc.so.12.map
-Wl,-z,initfirst -Wl,-z,defs 

-Wl,--fatal-warnings -o libc.so.12.190 -Wl,-rpath,/lib -L=/lib
-Wl,--whole-archive libc_pic.a -

Wl,--no-whole-archive
 *** Error code 1

Stop.
nbmake[6]: stopped in /usr/src/lib/libc


clang+elftoolchain(head r3029)+gnu ld

It passed building libc.so.12.190(seems that elftoolchain improved a lot at
head), but failed at

#      link  rpc.bootparamd/rpc.bootparamd
/usr/pkg/bin/x86_64--netbsd-clang    -Wl,--fatal-warnings     -o
rpc.bootparamd
 bootparamd.o bootparam_prot_svc.o 
-Wl,-rpath-link,/usr/src/../obj/destdir.amd6
 4/lib  -L=/lib -lrpcsvc -lutil
bootparamd.o: In function `main':
/usr/src/usr.sbin/rpc.bootparamd/bootparamd.c:(.text+0x248): undefined
reference
 to `bootparamprog_1'
clang-3.5: error: linker command failed with exit code 1 (use -v to see
invocati
 on)

*** Failed target:  rpc.bootparamd
*** Failed command: /usr/pkg/bin/x86_64--netbsd-clang -Wl,--fatal-warnings
-o rp
c.bootparamd bootparamd.o bootparam_prot_svc.o
-Wl,-rpath-link,/usr/src/../obj/d
 estdir.amd64/lib -L=/lib -lrpcsvc -lutil
 *** Error code 1

Stop.
nbmake[6]: stopped in /usr/src/usr.sbin/rpc.bootparamd



--
View this message in context: 
http://netbsd.2816.n7.nabble.com/Failed-building-NetBSD-current-at-6-99-40-with-BSD-toolchain-tp300156.html
Sent from the current-users mailing list archive at Nabble.com.


Home | Main Index | Thread Index | Old Index