From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10952 invoked by alias); 19 Jun 2009 16:27:31 -0000 Received: (qmail 10941 invoked by uid 22791); 19 Jun 2009 16:27:30 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp2b.orange.fr (HELO smtp2b.orange.fr) (80.12.242.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Jun 2009 16:27:22 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b23.orange.fr (SMTP Server) with ESMTP id 796A9700008C; Fri, 19 Jun 2009 18:27:18 +0200 (CEST) Received: from r-lnx-leminkainen.bzh.lan (ARennes-252-1-45-39.w83-195.abo.wanadoo.fr [83.195.118.39]) by mwinf2b23.orange.fr (SMTP Server) with ESMTP id 419D870000AA; Fri, 19 Jun 2009 18:27:18 +0200 (CEST) From: "Yann E. MORIN" To: bartvdrmeulen@gmail.com Subject: Re: [patch 4/4] Implement canadian build option Date: Fri, 19 Jun 2009 16:27:00 -0000 User-Agent: KMail/1.9.9 Cc: crossgcc@sourceware.org References: <20090610101230.342741672@gmail.com> <20090610101230.342741672@gmail.com>> <20090610113222.856924123@gmail.com>> In-Reply-To: <20090610113222.856924123@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906191827.17961.yann.morin.1998@anciens.enib.fr> X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00039.txt.bz2 Bart, See comments inlined below... On Wednesday 10 June 2009 12:12:34 Bart vd. Meulen wrote: > Add implementation for a candadian build option already > present in crosstool in order to build a cross-compiler > where build != host != target > > The included sample uses a pre-installed mingw build-host compiler and a > build-target compiler (that has been build with Crosstool-ng, using the > i686-ntpl-linux-gnu example has basis) > The resulting cross compiler runs on a mingw host and builds for a > i686-linux-gnu target. > > Signed-off-by: Bart van der Meulen > --- > config/toolchain.in | 2 > samples/i686-none-linux-gnu/crosstool.config | 353 +++++++++++++++++++++++++++ > samples/i686-none-linux-gnu/reported.by | 3 > scripts/build/cc/gcc.sh | 8 > scripts/build/companion_libs/mpfr.sh | 3 > scripts/crosstool-NG.sh.in | 17 + > 6 files changed, 381 insertions(+), 5 deletions(-) > > Index: crosstool-ng/scripts/crosstool-NG.sh.in > =================================================================== > --- crosstool-ng.orig/scripts/crosstool-NG.sh.in 2009-06-08 15:30:40.000000000 +0200 > +++ crosstool-ng/scripts/crosstool-NG.sh.in 2009-06-08 15:30:41.000000000 +0200 > @@ -202,8 +202,10 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILD_DI > CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}" > CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}" > CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}" > -CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}" > -CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" > +if [ -z "${CT_CANADIAN}" ]; then > + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}" > + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" > +fi > > # Only create the state dir if asked for a restartable build > [ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}" > @@ -303,10 +305,18 @@ if [ -z "${CT_RESTART}" ]; then > > # Prepare mangling patterns to later modify BUILD and HOST (see below) > case "${CT_TOOLCHAIN_TYPE}" in > + canadian) > + CT_REAL_TARGET=${TARGET} CT_REAL_TARGET is used nowhere in the code. What was it for? > + build_mangle="build_" > + host_mangle="host_" > + install_build_tools_for="BUILD HOST TARGET" Yep, nice! > + ;; > + Useless empty line, doesn't mind. > cross) > CT_HOST="${CT_BUILD}" > build_mangle="build_" > host_mangle="build_" > + install_build_tools_for="BUILD HOST" > ;; > *) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!" > ;; > @@ -334,7 +344,7 @@ if [ -z "${CT_RESTART}" ]; then > # cross-tools for those mangled tuples. > CT_DoLog DEBUG "Making build system tools available" > CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools" > - for m in BUILD HOST; do > + for m in ${install_build_tools_for}; do > r="CT_REAL_${m}" > v="CT_${m}" > p="CT_${m}_PREFIX" > @@ -402,6 +412,7 @@ if [ -z "${CT_RESTART}" ]; then > # so don't add those PATHs in this case... > case "${CT_TOOLCHAIN_TYPE}" in > cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";; > + canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";; Good! > *) ;; > esac > > Index: crosstool-ng/config/toolchain.in > =================================================================== > --- crosstool-ng.orig/config/toolchain.in 2009-06-08 15:30:35.000000000 +0200 > +++ crosstool-ng/config/toolchain.in 2009-06-08 15:30:41.000000000 +0200 > @@ -123,7 +123,7 @@ config CROSS_NATIVE > > config CANADIAN > bool > - prompt "Canadian (NO CODE!) (EXPERIMENTAL)" > + prompt "Canadian (EXPERIMENTAL)" > depends on EXPERIMENTAL > help > Build a canadian-toolchain. > Index: crosstool-ng/scripts/build/cc/gcc.sh > =================================================================== > --- crosstool-ng.orig/scripts/build/cc/gcc.sh 2009-06-08 15:30:35.000000000 +0200 > +++ crosstool-ng/scripts/build/cc/gcc.sh 2009-06-08 15:30:41.000000000 +0200 > @@ -45,6 +45,10 @@ do_cc_extract() { > #------------------------------------------------------------------------------ > # Core gcc pass 1 > do_cc_core_pass_1() { > + # If we're building a candadian compiler no use to build the CC Typo: "canadian"; s/CC/core compiler/ > + # core compiler, we're not using it > + [ -n "${CT_CANADIAN}" ] && return 0 > + > # If we're building for bare metal, build the static core gcc, > # with libgcc. > # In case we're not bare metal, and we're NPTL, build the static core gcc. > @@ -58,6 +62,10 @@ do_cc_core_pass_1() { > > # Core gcc pass 2 > do_cc_core_pass_2() { > + # If we're building a candadian compiler no use to build the CC Ditto, ditto. > + # core compiler, we're not using it > + [ -n "${CT_CANADIAN}" ] && return 0 > + > # In case we're building for bare metal, do nothing, we already have > # our compiler. > # In case we're NPTL, build the shared core gcc and the target libgcc. > Index: crosstool-ng/scripts/build/companion_libs/mpfr.sh > =================================================================== > --- crosstool-ng.orig/scripts/build/companion_libs/mpfr.sh 2009-06-08 15:30:35.000000000 +0200 > +++ crosstool-ng/scripts/build/companion_libs/mpfr.sh 2009-06-08 15:30:41.000000000 +0200 > @@ -64,7 +64,8 @@ do_mpfr() { > mpfr_opt= > # Under Cygwin, we can't build a thread-safe library > case "${CT_HOST}" in > - *-cygwin) mpfr_opt="--disable-thread-safe";; > + *cygwin*) mpfr_opt="--disable-thread-safe";; > + *mingw*) mpfr_opt="--disable-thread-safe";; > *) mpfr_opt="--enable-thread-safe";; > esac > This chunk should have gone in a separate patch, to prepare for that one. Anyway, already applied this chunk as-is. Overall, looks good. I'l wait for your answer on CT_REAL_TARGET before I commit. Oh, by the way... It just occured to me that your original messages didn't make it to the list. :-( Did you get an error message about this? If so, what was the reason? Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ___ | | --==< ^_^ >==-- `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | `------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq