This patch fixes the problem of not correctly configuring for Mac OS X.
On Mac OS X, the compiler is simply called gcc, so the names the switch-arch script would look for were not available. Also uname -m returns i386 on Mac OS X. This value doesn't change on 32bit or 64bit intel processors. On Linux, the value would be x86_64 for 64bit processors and i686 for 32bit processors. The 6 in 686 might be 3,4, or 5 depending on your processor type.
With this patch I was actually able to go pretty far in the building process of making OpenBIOS. I stopped at an issue in elf_info.c. This is another issue to be solved for another time.
signed-off-by: John Arbuckle programmingkidx@gmail.com
Index: config/scripts/switch-arch =================================================================== --- config/scripts/switch-arch (revision 1078) +++ config/scripts/switch-arch (working copy) @@ -89,15 +89,25 @@
archname() { - HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \ - -e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \ - -e "s/Power Macintosh/ppc/"` + OS_NAME=`uname` + if test "$OS_NAME" = "Darwin"; then # Can't depend on uname -m on Mac OS X + IS_64BIT=`sysctl hw.cpu64bit_capable` + if test "$IS_64BIT" = "hw.cpu64bit_capable: 1"; then + HOSTARCH="amd64" + else + HOSTARCH="x86" + fi + else + HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \ + -e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \ + -e "s/Power Macintosh/ppc/"` + fi }
select_prefix() { - for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- '' do if type ${TARGET}gcc > /dev/null 2>&1 then
On 12/12/12 16:53, Programmingkid wrote:
This patch fixes the problem of not correctly configuring for Mac OS X.
On Mac OS X, the compiler is simply called gcc, so the names the switch-arch script would look for were not available. Also uname -m returns i386 on Mac OS X. This value doesn't change on 32bit or 64bit intel processors. On Linux, the value would be x86_64 for 64bit processors and i686 for 32bit processors. The 6 in 686 might be 3,4, or 5 depending on your processor type.
With this patch I was actually able to go pretty far in the building process of making OpenBIOS. I stopped at an issue in elf_info.c. This is another issue to be solved for another time.
signed-off-by: John Arbuckleprogrammingkidx@gmail.com
Hmmm. OS X uses LLVM instead of gcc, doesn't it? I'm not sure I know enough about LLVM cross-compile environments in order to know if this is the right thing to do or not. Any web references you can point me at, or are there any other compiler-savvy OS X users on the mailing list?
ATB,
Mark.
On Dec 13, 2012, at 3:10 PM, Mark Cave-Ayland wrote:
On 12/12/12 16:53, Programmingkid wrote:
This patch fixes the problem of not correctly configuring for Mac OS X.
On Mac OS X, the compiler is simply called gcc, so the names the switch-arch script would look for were not available. Also uname -m returns i386 on Mac OS X. This value doesn't change on 32bit or 64bit intel processors. On Linux, the value would be x86_64 for 64bit processors and i686 for 32bit processors. The 6 in 686 might be 3,4, or 5 depending on your processor type.
With this patch I was actually able to go pretty far in the building process of making OpenBIOS. I stopped at an issue in elf_info.c. This is another issue to be solved for another time.
signed-off-by: John Arbuckleprogrammingkidx@gmail.com
Hmmm. OS X uses LLVM instead of gcc, doesn't it? I'm not sure I know enough about LLVM cross-compile environments in order to know if this is the right thing to do or not. Any web references you can point me at, or are there any other compiler-savvy OS X users on the mailing list?
LLVM is part of CLANG. CLANG is another compiler that is different from gcc. To use CLANG, you have to specify it. GCC is still available on Mac OS X. This page should make things a little more clear to you.
http://lists.openbios.org/pipermail/openbios/2011-August/006642.html
On Fri, Dec 14, 2012 at 5:55 PM, Programmingkid programmingkidx@gmail.com wrote:
On Dec 13, 2012, at 3:10 PM, Mark Cave-Ayland wrote:
On 12/12/12 16:53, Programmingkid wrote:
This patch fixes the problem of not correctly configuring for Mac OS X.
On Mac OS X, the compiler is simply called gcc, so the names the switch-arch script would look for were not available. Also uname -m returns i386 on Mac OS X. This value doesn't change on 32bit or 64bit intel processors. On Linux, the value would be x86_64 for 64bit processors and i686 for 32bit processors. The 6 in 686 might be 3,4, or 5 depending on your processor type.
With this patch I was actually able to go pretty far in the building process of making OpenBIOS. I stopped at an issue in elf_info.c. This is another issue to be solved for another time.
signed-off-by: John Arbuckleprogrammingkidx@gmail.com
Hmmm. OS X uses LLVM instead of gcc, doesn't it? I'm not sure I know enough about LLVM cross-compile environments in order to know if this is the right thing to do or not. Any web references you can point me at, or are there any other compiler-savvy OS X users on the mailing list?
LLVM is part of CLANG. CLANG is another compiler that is different from gcc. To use CLANG, you have to specify it. GCC is still available on Mac OS X. This page should make things a little more clear to you.
I used Clang analyzer to detect bugs in OpenBIOS around 2010 (r750 to r752). Clang can be used to build at least openbios-unix on Linux just with 'make HOSTCC=clang CC=clang'. I'm not sure about other targets since I haven't had a cross-compiling Clang compiler or native Sparc/PPC Clang environment.
http://lists.openbios.org/pipermail/openbios/2011-August/006642.html
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you