This is the mail archive of the mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using crosstool ng for building win32 hosted cross compiler

On Monday 27 April 2009 13:48:48 Remy Bohmer wrote:
> Hello,
> Thanks for your answer.
> >> I am currently using crosstool-ng to build a cross-toolchain for my
> >> target (target=x86-bare, host=x86-linux, build=x86-linux)
> >> Now I also need the same toolchain that can run on a Windows host
> >> (target=x86-bare, host=x86-mingw, build=x86-linux)
> >
> > That's a canadian-cross, and crosstool-NG does not yet handle this
> > case.
> I know... not yet!
> >
> > But it should be fine with:
> > ?host=x86-mingw, build=x86-mingw, target=x86-bare
> And this is what I wanted to prevent....
> I prefer building on Linux, one build system for all platforms and
> tools; usually cross-compiling Linux stuff on a Windows box is just
> pain. Unfortunately there are application engineers that are addicted
> to Windows for whom I need a cross-compiler, so let's try to build one
> on Linux...
> I did it before (a few years ago) with my own set of dirty scripts
> which needs severe update. So I wanted to get it all going inside
> crosstool-ng. Back then I did it with first building the linux hosted
> toolchain, and finally replace every executable by its Windows
> counterpart by only building binutils and gcc for mingw. I was
> wondering if such a route was still possible, and if so: how to
> integrate that in crosstool-ng?
> > Also, please note that 1.4.0 can now be used under Cygwin.
> > If you can't build under mingw, then maybe Cygwin would be a good
> > fallback/workaround...
> Cygwin compiles slower and is annoying if make tooling is used that
> works outside the cygwin environment (and that do not understand the
> cygwin path-naming).
> >> Is there an lightweight way possible to make crosstool-ng build only
> >> the win32 executables by using a mingw cross-compiler, and using the
> >> linux-hosted-toolchain-build-results as starting point? If so, where
> >> in the build process ct-ng performs could this be added?
> >> I guess, as mingw cross-compiler the i586-mingw32msvc-gcc from Ubuntu
> >> can be used...
> >
> > Unfortunately, canadian-cross is not yet supported.
> I know it is not supported, and I wanted to do something about the
> 'not yet' part...
> > I don't have enough
> > time to test it, but most of the infrastructure should already be here.
> > Most probably, a matter of:
> > - set "Paths and misc options" --> "Experimental" (to see next option)
> > - set "Toolchain options" --> "Type" --> "Canadian"
> > - set "Toolchain options" --> "Host system" --> "Tuple"
> If I start using it, crosstool-ng complains about 'no-code'
> So, where to start to implement it nicely?

(Sorry if the mailer mangles the following lines...)
# rep -nr -B7 -A2 -E 'No code|CT_TOOLCHAIN_TYPE' scripts/
scripts/    # Determine build system if not set by the user
scripts/    CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
scripts/    case "${CT_BUILD}" in
scripts/        "") CT_BUILD=$("${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX}" -dumpmachine);;
scripts/    esac
scripts/    # Prepare mangling patterns to later modify BUILD and HOST (see below)
scripts/    case "${CT_TOOLCHAIN_TYPE}" in
scripts/        cross)
scripts/            CT_HOST="${CT_BUILD}"
scripts/            build_mangle="build_"
scripts/            host_mangle="build_"
scripts/            ;;
scripts/        *)  CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!"
scripts/            ;;
scripts/    esac
scripts/    # Carefully add paths in the order we want them:
scripts/    #  - first try in ${CT_PREFIX_DIR}/bin
scripts/    #  - then try in ${CT_CC_CORE_SHARED_PREFIX_DIR}/bin
scripts/    #  - then try in ${CT_CC_CORE_STATIC_PREFIX_DIR}/bin
scripts/    #  - fall back to searching user's PATH
scripts/    # Of course, neither cross-native nor canadian can run on BUILD,
scripts/    # so don't add those PATHs in this case...
scripts/    case "${CT_TOOLCHAIN_TYPE}" in
scripts/        cross)  export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
scripts/        *)  ;;

Lines 307 and 401 seem like good candidates to start with.

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  |
| | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

For unsubscribe information see

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]