From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29731 invoked by alias); 11 Oct 2011 02:11:35 -0000 Received: (qmail 29721 invoked by uid 22791); 11 Oct 2011 02:11:33 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,FREEMAIL_FROM,FREEMAIL_REPLY,MIME_CHARSET_FARAWAY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID X-Spam-Check-By: sourceware.org Received: from smtpbg55.qq.com (HELO smtpbg55.qq.com) (64.71.138.44) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 11 Oct 2011 02:11:15 +0000 X-QQ-mid: esmtp8t1318299069t504t03343 Received: from [192.168.5.101] (unknown [113.109.179.159]) by esmtp4.qq.com (ESMTP) with id ; Tue, 11 Oct 2011 10:11:08 +0800 (CST) X-QQ-SSF: 00000000000000F0F[F01F000000000 Subject: Re: cross build for OS lion Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=GB2312 From: Peica In-Reply-To: <201110102247.40823.yann.morin.1998@anciens.enib.fr> Date: Tue, 11 Oct 2011 02:11:00 -0000 Cc: crossgcc@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <76FFA43A-3B4C-4768-B798-6B43E43C6D18@qq.com> References: <201110102247.40823.yann.morin.1998@anciens.enib.fr> To: Yann E. MORIN 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: 2011-10/txt/msg00024.txt.bz2 Hi Yann E. MORIN and All, Sorry for the wrong patch. I need to add these line into scripts/crosstool-NG to avoid the wrong choic= e for compiler.=20 If not, the script would call the Xcode gcc by default. and it cause the ta= rget compiler=20 crash at runtime. case "${CT_TOOLCHAIN_TYPE}" in cross) # A cross-compiler runs on the same machine it is built on CT_HOST=3D"${CT_BUILD}" =09=20=20=20=20 CT_HOST_PREFIX=3D"${CT_BUILD_PREFIX}" // i add=20 CT_HOST_SUFFIX=3D"${CT_BUILD_SUFFIX}" // i add =20=20=20=20=20=20=20=20=20=20=20=20 build_mangle=3D"build_" host_mangle=3D"build_" target_mangle=3D"" install_build_tools_for=3D"BUILD HOST" ;; canadian) build_mangle=3D"build_" host_mangle=3D"host_" target_mangle=3D"" install_build_tools_for=3D"BUILD HOST TARGET" ;; *) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!" ;; esac Another problem is to build the gdb in static way(script/build/debug/300-gd= b.sh). Please refer here if it make sense to you, if [ "${CT_GDB_CROSS}" =3D "y" ]; then local -a cross_extra_config local gcc_version CT_DoStep INFO "Installing cross-gdb" CT_DoLog EXTRA "Configuring cross-gdb" mkdir -p "${CT_BUILD_DIR}/build-gdb-cross" cd "${CT_BUILD_DIR}/build-gdb-cross" cross_extra_config=3D("${extra_config[@]}") case "${CT_THREADS}" in none) cross_extra_config+=3D("--disable-threads");; *) cross_extra_config+=3D("--enable-threads");; esac CC_for_gdb=3D LD_for_gdb=3D if [ "${CT_GDB_CROSS_STATIC}" =3D "y" ]; then CC_for_gdb=3D"gcc -static" // should we use "${CT_HOST}-gc= c static" to replace here? LD_for_gdb=3D"ld -static" // should we use "${CT_HOST}-ld -st= atic" to replace here? fi =D4=DA 2011-10-11=A3=AC=C9=CF=CE=E74:47=A3=AC Yann E. MORIN =D0=B4=B5=C0=A3= =BA > Peica, All, >=20 > On Thursday 06 October 2011 19:09:15 Peica wrote: >> I have make a patch for crosstool-NG cross building from OS Lion via >> MacPort GCC. If I use the default one, it could stop the building >> because the script set the Xcode gcc as C_HOST and it would make a >> internal compiler error when calling my target compiler. >=20 > The patch is almost unreadable. Please provide a unified patch: > diff -u >=20 > It also seems the patch is reversed. >=20 > Anyway, the patch seems really wrong. Setting the HOST and build prefix to > be the same breaks on canadian-crosses. With a canadian-cross toolchain, > the build machine is where the compiler is _built_, while the host machine > is where the compiler _runs_. And those two machines may be different. >=20 > Care to explain what breaks for you? For example, put your entire build.l= og > file on some website (or a pastebin) where we can get it to analyse the > issue. >=20 > Regards, > Yann E. MORIN. >=20 > --=20 > .-----------------.--------------------.------------------.--------------= ------. > | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspi= racy: | > | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ = | > | +33 223 225 172 `------------.-------: X AGAINST | \e/ There i= s no | > | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspir= acy. | > '------------------------------^-------^------------------^--------------= ------' >=20 > -- > For unsubscribe information see http://sourceware.org/lists.html#faq >=20 >=20 >=20 Best wishes, Peica Chen =B3=C2=C5=E0=BC=CE other mail: gpeica@gmail.com -- For unsubscribe information see http://sourceware.org/lists.html#faq