From owner-freebsd-toolchain@FreeBSD.ORG Tue Mar 10 23:49:48 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9EEEE4D; Tue, 10 Mar 2015 23:49:48 +0000 (UTC) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484407F7; Tue, 10 Mar 2015 23:49:48 +0000 (UTC) Received: by labgm9 with SMTP id gm9so5245024lab.11; Tue, 10 Mar 2015 16:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kUAVfzmpdCsVcb8oV+k3MYV22b8DOlB/mgMSjLUwKvc=; b=ifwBDzRzziUfYdIbIfCQaYR1sorivxyZFUxkvY4hfbN/jkimaPgNH0UyYexhxHhRUF rfMcmP5cKfGlD99cIBUOtrf2PMVwPe7BdgsPVC24O4UNnMG6t75d56nf/QjykLGZF9xc U66Hd9cRoCwOJj2hxqPM88gwgmoOCuRf4+p/spPZNnuS/+Ql6uSjDS9ty2yUwwRs60BY k0CS0g1tECrx9OBt248wBine/ZaShfEFUBuwKe+YcRYPHFw6/lw1aNsYg5tekXSCxod7 Xe+oF+d3fBe6JIQP6+QqMkRu0zesN818NqAaWXTYWWN+E3I0WAvssAJrj40RYRyaQij4 Y84g== MIME-Version: 1.0 X-Received: by 10.112.26.209 with SMTP id n17mr27359675lbg.84.1426031386313; Tue, 10 Mar 2015 16:49:46 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.82.164 with HTTP; Tue, 10 Mar 2015 16:49:46 -0700 (PDT) In-Reply-To: References: <1857A2A3-0C19-4F52-BCAF-6C72FE7D8DF3@FreeBSD.org> Date: Tue, 10 Mar 2015 16:49:46 -0700 X-Google-Sender-Auth: rVsrEcvOk3bD3tRQrOibIMa_O5g Message-ID: Subject: Re: Failed to build with external toolchain From: Craig Rodrigues To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-testing@freebsd.org" , freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 23:49:49 -0000 On Sat, Mar 7, 2015 at 3:48 PM, Dimitry Andric wrote: > On 07 Mar 2015, at 21:12, Craig Rodrigues 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