From owner-freebsd-toolchain@FreeBSD.ORG Wed Mar 25 03:18:03 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 B816D85B; Wed, 25 Mar 2015 03:18:03 +0000 (UTC) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (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 27C5A85D; Wed, 25 Mar 2015 03:18:03 +0000 (UTC) Received: by labe2 with SMTP id e2so9464197lab.3; Tue, 24 Mar 2015 20:18:01 -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=E92csWhiKNxWS43fpdGDbKfHFe4cZVaaP63qhQ2BJb8=; b=HKCZoAZZ4AqBBNw4gqOIMdLyB+7O2O0a5Ax9BHwHS7Yuta11scMA25ImlkLQa7N3Vw yF0zsPy2fLHtYHPwxu7lBZiip9988EzgDEXLgkmQGON0QFg4SWsCe2SMGzdAFUhkkTta rvIQOo8NFbrs2Wa5pfTsxoG97U1HQmgNpgPApjbh679sTbXz2hg741Th2yhDZtpNfkd1 d8hwHwLbf+Snx3NA33hwK7zRpCa70qNOF+MHh6OggOL6qRKMU8gULyg3q5KFCGETMNn/ dA0+BDuI6h1ovQLiUIoqjqV6pT+KjX+XQtgcx2S0SQAL/2J3VRBUBl3XF8pDWNNM3Edy bmrQ== MIME-Version: 1.0 X-Received: by 10.112.140.38 with SMTP id rd6mr6399718lbb.116.1427253480841; Tue, 24 Mar 2015 20:18:00 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.108.168 with HTTP; Tue, 24 Mar 2015 20:18:00 -0700 (PDT) In-Reply-To: References: <1857A2A3-0C19-4F52-BCAF-6C72FE7D8DF3@FreeBSD.org> Date: Tue, 24 Mar 2015 20:18:00 -0700 X-Google-Sender-Auth: VwrNYb59ny0Lp_Jp1cXjO4K7JWU 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: Wed, 25 Mar 2015 03:18:03 -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. > > -Dimitry > > I eliminated the problem with this patch: Index: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 280353) +++ Makefile.inc1 (working copy) @@ -381,9 +381,9 @@ TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} +.endif XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} -.endif .else .if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${CROSS_BINUTILS_PREFIX} This sets --sysroot when doing CROSS_TOOLCHAIN for both clang *or* gcc. Right now, --sysroot is only set for clang. I did a "make universe" and "make buildworld CROSS_TOOLCHAIN_PREFIX=/usr/bin/" Is it OK if I commit it? -- Craig