Date: Tue, 10 Mar 2015 16:49:46 -0700 From: Craig Rodrigues <rodrigc@FreeBSD.org> To: Dimitry Andric <dim@freebsd.org> Cc: "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>, freebsd-toolchain@freebsd.org Subject: Re: Failed to build with external toolchain Message-ID: <CAG=rPVcGzdDXVgmXOdt74ywbObrY5%2BNUi0eLFp3MwEnqEbca6g@mail.gmail.com> In-Reply-To: <C3173614-08B4-4616-BD76-93CA8417A044@FreeBSD.org> References: <CAG=rPVfP4=BuL8DOuy9FNDcN51zshfBfeuFONiAAONWON6n3kA@mail.gmail.com> <A1580F95-4882-46F3-96C2-3D3D1D493706@FreeBSD.org> <CAG=rPVd9deshQWvMXOHF%2ByfvqZfo3UOsao9iqipX_CQGKs=vHA@mail.gmail.com> <1857A2A3-0C19-4F52-BCAF-6C72FE7D8DF3@FreeBSD.org> <CAG=rPVfKTi5cFyhNBg7pSYi_rUoEw2d8NeqA89Fy%2BiLxZt86hg@mail.gmail.com> <C3173614-08B4-4616-BD76-93CA8417A044@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 7, 2015 at 3:48 PM, Dimitry Andric <dim@freebsd.org> wrote: > On 07 Mar 2015, at 21:12, Craig Rodrigues <rodrigc@FreeBSD.org> wrote: > > I ran the build again and this time I am getting errors about undefined > > symbol utimensat(): > > > > > https://jenkins.freebsd.org/job/FreeBSD_HEAD_external_toolchain_gcc/14/console > > > > Any ideas? > > It's linking against the wrong libc, the one from the FreeBSD-10 host > system, which does not have utimensat(): > > --- cp --- > /usr/local/bin/x86_64-portbld-freebsd10.0-gcc -isystem > /builds/FreeBSD_HEAD_external_toolchain_gcc/obj/builds/FreeBSD_HEAD_external_toolchain_gcc/tmp/usr/include > -L/builds/FreeBSD_HEAD_external_toolchain_gcc/obj/builds/FreeBSD_HEAD_external_toolchain_gcc/tmp/usr/lib > -O2 -pipe -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE -std=gnu99 > -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W > -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 -o cp cp.o > utils.o > [...] > utils.o: In function `setfile': > utils.c:(.text+0x83): undefined reference to `utimensat' > utils.c:(.text+0x1ce): undefined reference to `utimensat' > utils.c:(.text+0x38c): undefined reference to `utimensat' > collect2: error: ld returned 1 exit status > > There should probably be a --sysroot flag in there, pointing to the > ${WORLDTMP} built during the earlier stages. > > For some reason, this flag is not added for gcc, in Makefile.inc1. No > idea why that was done. > Oh, OK. So if I set CROSS_TOOLCHAIN=amd64-gcc, (1) /usr/local/share/toolchains/amd64-gcc.mk is included (2) X_COMPILER_TYPE=gcc is defined in (1) (3) This code is hit in Makefile.inc1: .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 .else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} So does this mean that --sysroot is not set? Should it be? -- Craig
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVcGzdDXVgmXOdt74ywbObrY5%2BNUi0eLFp3MwEnqEbca6g>