public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Peica <peica@qq.com>
To: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Cc: crossgcc@sourceware.org
Subject: Re: cross build for OS lion
Date: Tue, 11 Oct 2011 02:11:00 -0000	[thread overview]
Message-ID: <76FFA43A-3B4C-4768-B798-6B43E43C6D18@qq.com> (raw)
In-Reply-To: <201110102247.40823.yann.morin.1998@anciens.enib.fr>

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 choice for compiler. 
If not, the script would call the Xcode gcc by default. and it cause the target compiler 
crash at runtime.

    case "${CT_TOOLCHAIN_TYPE}" in
        cross)
            # A cross-compiler runs on the same machine it is built on
            CT_HOST="${CT_BUILD}"
	    
            CT_HOST_PREFIX="${CT_BUILD_PREFIX}"		// i add 
            CT_HOST_SUFFIX="${CT_BUILD_SUFFIX}"		// i add
            
            build_mangle="build_"
            host_mangle="build_"
            target_mangle=""
            install_build_tools_for="BUILD HOST"
            ;;
        canadian)
            build_mangle="build_"
            host_mangle="host_"
            target_mangle=""
            install_build_tools_for="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-gdb.sh). Please refer here if it make sense to you,

    if [ "${CT_GDB_CROSS}" = "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=("${extra_config[@]}")
        case "${CT_THREADS}" in
            none)   cross_extra_config+=("--disable-threads");;
            *)      cross_extra_config+=("--enable-threads");;
        esac

        CC_for_gdb=
        LD_for_gdb=
        if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
            CC_for_gdb="gcc -static"      // should we use "${CT_HOST}-gcc static" to replace here?
            LD_for_gdb="ld -static"   // should we use "${CT_HOST}-ld -static" to replace here?
        fi




在 2011-10-11,上午4:47, Yann E. MORIN 写道:

> Peica, All,
> 
> 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.
> 
> The patch is almost unreadable. Please provide a unified patch:
>  diff -u
> 
> It also seems the patch is reversed.
> 
> 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.
> 
> Care to explain what breaks for you? For example, put your entire build.log
> file on some website (or a pastebin) where we can get it to analyse the
> issue.
> 
> Regards,
> Yann E. MORIN.
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  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
> 
> 
> 

Best wishes,

Peica Chen 陈培嘉
other mail: gpeica@gmail.com





--
For unsubscribe information see http://sourceware.org/lists.html#faq

      reply	other threads:[~2011-10-11  2:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 17:09 Peica
2011-10-10 20:48 ` Yann E. MORIN
2011-10-11  2:11   ` Peica [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76FFA43A-3B4C-4768-B798-6B43E43C6D18@qq.com \
    --to=peica@qq.com \
    --cc=crossgcc@sourceware.org \
    --cc=yann.morin.1998@anciens.enib.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).