Cross Compiler Build Error Issues

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
brodeur235
Member
Member
Posts: 86
Joined: Sat Jun 06, 2009 11:55 am

Cross Compiler Build Error Issues

Post by brodeur235 »

I'm following the tutorial in the wiki on creating a cross compiler for developing my toy OS in my native OS; 10.7 Lion. At the first compiler time binutils attempts to install until I receive this error:

Code: Select all

creating libtool
loading cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for Cygwin environment... (cached) no
checking for mingw32 environment... (cached) no
checking for executable suffix... (cached) .dSYM
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 -W -Wall ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
Configure in /usr/src/build-binutils/bfd failed, exiting.
I have followed the instructions up until this point. No idea how to tend to this. Help appreciated,

Nick
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Cross Compiler Build Error Issues

Post by gerryg400 »

Which version of GCC do you have installed on your mac ?

Look in config.log to get more details of your error.

BTW, I've not been able to build a cross-compiler on Lion with the latest Xcode installed. I got error like this https://trac.macports.org/ticket/29104.
If a trainstation is where trains stop, what is a workstation ?
brodeur235
Member
Member
Posts: 86
Joined: Sat Jun 06, 2009 11:55 am

Re: Cross Compiler Build Error Issues

Post by brodeur235 »

I have the latest version of xcode installed, which is apparently:

Code: Select all

NICHOLAS-PACHULSKIs-MacBook-Pro:nick nmpach$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But, the version that I was planning on using for my cross compiler is 4.2.0 (which is not installed yet). The cross compiler tutorial in the wiki says to redo the gcc installation after doing a binutils install (which I obviously haven't done yet). Thanks for the reply. Future assistance greatly appreciated; want to do this on my mac!

Nick
mike20123
Posts: 15
Joined: Sat Aug 13, 2011 3:18 pm

Re: Cross Compiler Build Error Issues

Post by mike20123 »

hi "brodeur235"
i have found a tutorial step by step how to make cross platform compiler
i have tried that tutorial my self and it works for me me pretty well
check my topic in the forum
http://forum.osdev.org/viewtopic.php?f=1&t=24019
this video will teach you how to do it in Windows Platform
brodeur235
Member
Member
Posts: 86
Joined: Sat Jun 06, 2009 11:55 am

Re: Cross Compiler Build Error Issues

Post by brodeur235 »

I appreciate the help, but I need a cross compiler for mac; not windows. Just from skimming that video I can see that it uses tools that are .exe(s) which can't help me.

Any additional input is greatly appreciated. Still in need of help,

Nick
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Cross Compiler Build Error Issues

Post by Owen »

GCC 4.2.1 is perfectly fine; and there is no newer GCC version for mac (From Apple, that is; and if you use a non-Apple GCC, you're in for a world of hurt)

Check "config.log"
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Cross Compiler Build Error Issues

Post by Brynet-Inc »

OP is probably compiling an ancient version of binutils.

Also, 4.2.1 is the last GPLv2 licensed GCC compiler and is used by OS X.. the entire ARM community.. and at least OpenBSD, as a systems compiler.

OS X forked 4.2.1 for their own reasons as well.

For a cross compiler, you can use whatever version you want.. so long as it compiles on your host OS.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Cross Compiler Build Error Issues

Post by gerryg400 »

As I said, you cannot build a cross-compiler out-of-the-box on Lion because the new version of Xcode will not support it. I really wanted to get going again so rather than investigating the problem I just reverted to the old Xcode version from Snow Leopard. That worked.

As Brynet-Inc said, take care that you are using the latest Binutils. Note that 2.21 is NEWER than 2.9

Brodeur, attach your config.log.

[Edit] Actually, to be more specific, the cros-compiler tool-chain does build on Lion. But It segfaults in the compiler when used.
If a trainstation is where trains stop, what is a workstation ?
Post Reply