From patchwork Thu Jan 30 18:15:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Soloff, Steven M Belcan Engineering Group, Cincinnati, Ohio" X-Patchwork-Id: 315426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 081F12C00BB for ; Fri, 31 Jan 2014 05:15:19 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:subject:date:message-id:in-reply-to :references:from:to; q=dns; s=default; b=Q4GWDPhvzzD3pz1PK/4ftq9 mXuQ165/htipP7R9JTCfswnm93lzwwifuWbGPJ7MOETDdl1hM1nTFjAWxxZqD9kD pMe+hqbVUKn/TgBnzJ3JrI5NBTOIaWtS2p5E/YT5UJMGSSzdJiMV3favRyaRmfNa p7fG3FHx0oLkl39jbjWw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:subject:date:message-id:in-reply-to :references:from:to; s=default; bh=yulMgDyRDFgYJxUERSFuPlOuQPQ=; b= m8O+DFGh1WHrNH51ac8ysQMTotkHB6bNuMD54TIIhJ2L/KPNKfBFfARilZmcBzXJ /A30u3tbtGdPSjyANooGLewqtwN2k5vjjEao6txz7ymg6+vZ1woYwbrPhpw/bTZF tzNIY+t07pYZlnvV2eNbuZFrfc+MHrvsZO/+KBWIGKo= Received: (qmail 31798 invoked by alias); 30 Jan 2014 18:15:11 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 31782 invoked by uid 89); 30 Jan 2014 18:15:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mx0b-00105401.pphosted.com Received: from mx0b-00105401.pphosted.com (HELO mx0b-00105401.pphosted.com) (67.231.152.184) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 30 Jan 2014 18:15:08 +0000 Received: from pps.filterd (m0004038.ppops.net [127.0.0.1]) by mx0b-00105401.pphosted.com (8.14.5/8.14.5) with SMTP id s0UICkhl017117 for ; Thu, 30 Jan 2014 13:15:06 -0500 Received: from xmnpv31.utc.com (xmnpv31.utc.com [159.82.164.211]) by mx0b-00105401.pphosted.com with ESMTP id 1hq8nmc5pr-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK) for ; Thu, 30 Jan 2014 13:15:06 -0500 Received: from pps.filterd (XMNPV31.utc.com [127.0.0.1]) by XMNPV31.utc.com (8.14.5/8.14.5) with SMTP id s0UHwGE4026090 for ; Thu, 30 Jan 2014 13:15:04 -0500 Received: from uusmna21.corp.utc.com (uusmna21.corp.utc.com [159.82.227.11]) by XMNPV31.utc.com with ESMTP id 1hqu9agvht-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL) for ; Thu, 30 Jan 2014 13:15:04 -0500 Received: from PUSMNG02.pwemail.us (pusmng02.pwemail.us [10.29.133.16]) by uusmna21.corp.utc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s0UIF47t016900 for ; Thu, 30 Jan 2014 13:15:04 -0500 Received: from PUSMNEI1.pwemail.us ([10.29.133.138]) by PUSMNG02.pwemail.us with Microsoft SMTPSVC(6.0.3790.4675); Thu, 30 Jan 2014 13:15:04 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [External] Re: crosstool-ng 1.19.0 fails to build i686-unknown-mingw32 Date: Thu, 30 Jan 2014 13:15:00 -0500 Message-ID: <4F66624F960F3746BB0263581CC9CE83040B7F1C@PUSMNEI1.pwemail.us> In-Reply-To: References: <081118858EAEC94C9E4EE628510B31CD13227DF1@exchange10.valvesoftware.com><4F66624F960F3746BB0263581CC9CE83040B7E11@PUSMNEI1.pwemail.us> From: "Soloff, Steven M Belcan Engineering Group, Cincinnati, Ohio" To: X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1401300109 X-IsSubscribed: yes Hi Ray, My mistake... You're correct, the pass-1 compiler is successfully built if sysroot/mingw/include exists. I was just careless when examining the log; the missing header error I was referring to occurs during the build of the pass-2 compiler: [ALL ] In file included from /home/xbe1648/Documents/crosstool/i686-unknown-mingw32/.build/src/gcc-4. 8.1/libgcc/libgcc2.c:27:0: [ERROR] /home/xbe1648/Documents/crosstool/i686-unknown-mingw32/.build/src/gcc-4. 8.1/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory [ALL ] #include [ALL ] ^ [ALL ] compilation terminated. However, that error's a red herring. My problem was that I didn't correctly create sysroot/mingw/include. I didn't notice the comment in scripts/build/libc/mingw.sh regarding the creation of the symbolic link between sysroot/mingw and sysroot/usr/${CT_TARGET}. So instead of simply executing the following command after the build started (which lead to the compilation error above): mkdir -p /home/user/x-tools/i686-unknown-mingw32/i686-unknown-mingw32/sysroot/min gw/include I used the following two commands: mkdir -p /home/user/x-tools/i686-unknown-mingw32/i686-unknown-mingw32/sysroot/usr /i686-unknown-mingw32/include ln -sv usr/i686-unknown-mingw32 /home/user/x-tools/i686-unknown-mingw32/i686-unknown-mingw32/sysroot/min gw That apparently worked such that the link was pointing to the correct location when it came time to build the pass-2 compiler. With that said, I reformulated the patch to only perform the above two actions at the end of do_libc_extract() instead of installing the C library: do_libc_check_config() { @@ -48,11 +58,6 @@ do_libc_start_files() { CT_Popd - # It seems mingw is strangely set up to look into /mingw instead of - # /usr (notably when looking for the headers). This symlink is - # here to workaround this, and seems to be here to last... :-/ - CT_DoExecLog ALL ln -sv "usr/${CT_TARGET}" "${CT_SYSROOT_DIR}/mingw" - CT_EndStep } It still feels like I'm breaking cohesion by doing this in do_libc_extract(). Any suggestions for improvement would be appreciated. Thanks, Steve -----Original Message----- From: Ray Donnelly [mailto:mingw.android@gmail.com] Sent: Thursday, January 30, 2014 9:44 AM To: Soloff, Steven M Belcan Engineering Group, Cincinnati, Ohio Cc: crossgcc@sourceware.org Subject: [External] Re: crosstool-ng 1.19.0 fails to build i686-unknown-mingw32 I've never needed the crt headers installed during pass-1 GCC, just that the folder exists. On Thu, Jan 30, 2014 at 2:07 PM, Soloff, Steven M Belcan Engineering Group, Cincinnati, Ohio wrote: > This apparently broke beginning with GCC 4.6.0. I didn't track down > the root cause of the change in the GCC build process that required > the sysroot files to be accessible during the pass-1 compiler build. > However, the existence of the sysroot/mingw directory is not > sufficient > -- the headers need to be there, as well. > > Taking a cue from the patch referenced by Drew, I instead modified > scripts/build/libc/mingw.sh by moving the contents of > do_libc_start_files() to the end of do_libc_extract() [1], which > should only affect MinGW targets. I verified I could build a MinGW > target using GCC 4.5.3 (i686) and 4.8.1 (i686 and x86_64) using a > patched crosstool-ng 1.19.0. > > However, I doubt this is the optimal solution. Seeing the "Installing > C library headers" step during the "Extracting and patching toolchain > components" step just smells bad. I'd appreciate any suggestions from > the devs for a better fix that I could submit. > > Thanks, > Steve > > [1] > --- a/scripts/build/libc/mingw.sh > +++ b/scripts/build/libc/mingw.sh > @@ -11,13 +11,7 @@ do_libc_extract() { > CT_Pushd "${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/" > CT_Patch nochdir mingw-w64 "${CT_WINAPI_VERSION}" > CT_Popd > -} > > -do_libc_check_config() { > - : > -} > - > -do_libc_start_files() { > local -a sdk_opts > > CT_DoStep INFO "Installing C library headers" > @@ -56,6 +50,14 @@ do_libc_start_files() { > CT_EndStep > } > > +do_libc_check_config() { > + : > +} > + > +do_libc_start_files() { > + : > +} > + > do_libc() { > CT_DoStep INFO "Building mingw-w64 files" > > > -----Original Message----- > From: Drew Bliss [mailto:drewb@valvesoftware.com] > Sent: Monday, January 20, 2014 7:32 PM > To: 'crossgcc@sourceware.org' > Subject: RE: crosstool-ng 1.19.0 fails to build i686-unknown-mingw32 > > The x-tools directory appears to be cleaned up and recreated when > running ct-ng build, so any manually created directory is gone by the > time it gets to the point of needing it. > > Back in Aug 2012 the same issue was reported with 1.16 and a user said > that this patch reordering steps fixed the problem. It doesn't appear > to fix it with 1.19, plus the patch was considered undesirable since > it breaks non-mingw builds. > > --- a/lib/ct-ng.1.16.0/steps.mk 2012-08-06 14:55:00.848409671 +0200 > +++ b/lib/ct-ng.1.16.0/steps.mk 2012-08-06 14:39:24.736900247 +0200 > @@ -36,9 +36,9 @@ > binutils_for_host \ > elf2flt_for_host \ > sstrip_for_host \ > + libc_start_files \ > cc_core_pass_1 \ > kernel_headers \ > - libc_start_files \ > cc_core_pass_2 \ > libc \ > cc_for_build \ > > -----Original Message----- > From: Ray Donnelly [mailto:mingw.android@gmail.com] > Sent: Monday, January 20, 2014 4:19 PM > To: Drew Bliss > Cc: crossgcc@sourceware.org > Subject: Re: crosstool-ng 1.19.0 fails to build i686-unknown-mingw32 > > mkdir -p .. of course! > > On Tue, Jan 21, 2014 at 12:18 AM, Ray Donnelly > > wrote: >> As a workaround you can make the parent directory before commencing > the build: >> >> mkdir >> /home/user/x-tools/i686-unknown-mingw32/i686-unknown-mingw32/sysroot/ >> m >> ingw >> >> >> On Mon, Jan 20, 2014 at 11:50 PM, Drew Bliss >> > wrote: >>> This is the same issue that Daniel Pauli mailed about in Mar 2013 >>> but > there didn't seem to be a reply. Does anybody know what the problem > is here? >>> >>> From: Daniel Pauli >>> To: crossgcc at sourceware dot org >>> Date: Wed, 6 Mar 2013 19:47:25 +0100 >>> Subject: crosstool-ng 1.18.0 fails to build i686-unknown-mingw32 for >>> gcc 4.7.2 Hey there >>> >>> I'm trying to build the i686-unknown-mingw32 sample for gcc 4.7.2 >>> but > >>> it fails at the following step: >>> >>> [ALL ] The directory that should contain system headers does not > exist: >>> [ALL ] > /home/user/x-tools/i686-unknown-mingw32/i686-unknown-mingw32/sysroot/m > in > gw/include >>> [ERROR] make[2]: *** [stmp-fixinc] Error 1 >>> [ALL ] rm gcc.pod >>> [ALL ] make[2]: Leaving directory >>> > `/home/user/crosstool-ng-1.18.0/test/.build/i686-unknown-mingw32/build > /b > uild-cc-core-pass-1/gcc' >>> [ERROR] make[1]: *** [all-gcc] Error 2 >>> [ALL ] make[1]: Leaving directory >>> > `/home/user/crosstool-ng-1.18.0/test/.build/i686-unknown-mingw32/build > /b > uild-cc-core-pass-1' >>> [ERROR] >>> [ERROR] >> >>> [ERROR] >> Build failed in step 'Installing pass-1 core C compiler' >>> [ERROR] >> called in step '(top-level)' >>> [ERROR] >> >>> [ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257] >>> [ERROR] >> called from: > do_cc_core_backend[scripts/build/cc/gcc.sh@448] >>> [ERROR] >> called from: > do_cc_core_pass_1[scripts/build/cc/gcc.sh@101] >>> [ERROR] >> called from: main[scripts/crosstool-NG.sh@632] >>> >>> >>> -- >>> For unsubscribe information see http://sourceware.org/lists.html#faq >>> > > -- > For unsubscribe information see http://sourceware.org/lists.html#faq > --- For unsubscribe information see http://sourceware.org/lists.html#faq --- a/scripts/build/libc/mingw.sh +++ b/scripts/build/libc/mingw.sh @@ -11,6 +11,16 @@ do_libc_extract() { CT_Pushd "${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/" CT_Patch nochdir mingw-w64 "${CT_WINAPI_VERSION}" CT_Popd + + # Beginning with GCC 4.6.0, the "sysroot/mingw/include" directory + # must exist before the pass-1 compiler is built. + CT_mkdir_pushd "${CT_SYSROOT_DIR}/usr/${CT_TARGET}/include" + CT_Popd + + # It seems mingw is strangely set up to look into /mingw instead of + # /usr (notably when looking for the headers). This symlink is + # here to workaround this, and seems to be here to last... :-/ + CT_DoExecLog ALL ln -sv "usr/${CT_TARGET}" "${CT_SYSROOT_DIR}/mingw" }