cross build for OS lion
Peica
peica@qq.com
Tue Oct 11 02:11:00 GMT 2011
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
More information about the crossgcc
mailing list