#180123 - 20/09/2003 20:34
Cross-compile chain for OS X (not uploaded yet)
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
I now have a cross-compile toolchain for MacOS X. I have it installed into /opt/local, which is the directory DarwinPorts suggested for its content; I plan to eventually contribute a port. When I get a few minutes I'll post a skeleton kit like mlord has from peter with the toolchain for linux x86 that he compiled, and when I get somewhere with better network than Laura's dialup (BTW, thanks Laura!) I'll upload the toolchain. The main lodge at Hueston Woods has for-pay wireless with a decent uplink, and I paid for today, so if I get back over there tonight, maybe I can upload it now. Anyhow, I have a new gpsapp compiled with the v3 font support; I'd love to have v3 to test it with
I also have gpsapp_host compiled for MacOS, but it doesn't work yet since it's not byteswapping anything.
|
Top
|
|
|
|
#180124 - 21/09/2003 23:26
Re: Cross-compile chain for OS X (not uploaded yet)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Here's the modified "kit" I used to build it.
Attachments
179062-armtools.tar.gz (276 downloads)
|
Top
|
|
|
|
#180125 - 22/09/2003 01:30
Re: Cross-compile chain for OS X (not uploaded yet)
[Re: Daria]
|
member
Registered: 12/01/2002
Posts: 192
Loc: Phoenix, AZ
|
Cool, I tried to compile it a while ago but didn't get anywhere with compilation problems, so I just put it on my FreeBSD box instead.
|
Top
|
|
|
|
#180126 - 22/09/2003 06:53
Re: Cross-compile chain for OS X (not uploaded yet)
[Re: Daria]
|
member
Registered: 07/11/2001
Posts: 188
Loc: New Jersey
|
Yay! Excellent news. I'll have to give this one a try. Thanks.
_________________________
-- JD - SN# 040104008 (120GB Blue, Digital Out)
|
Top
|
|
|
|
#180127 - 22/09/2003 07:34
Cross-compile chain for OS X uploaded
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
http://empeg.dementia.org/distributions/
There will eventually be some sort of nice html page there, but the absolute path to the binary distribution should stay the same.
The compiled kit is about 32 megs compressed.
|
Top
|
|
|
|
#180128 - 24/09/2003 15:16
Re: Cross-compile chain for OS X (not uploaded yet)
[Re: Daria]
|
pooh-bah
Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
|
Hey cool. This will come in handy, thanks.
-Mike
|
Top
|
|
|
|
#180129 - 18/01/2004 21:13
Re: Cross-compile chain for OS X uploaded
[Re: Daria]
|
member
Registered: 07/11/2001
Posts: 188
Loc: New Jersey
|
Now that I've finally gotten around to downloading this toolchain for darwin, I'm curious: is there any way to tie this gracefully into Xcode (or would I even want to)? Inquiring minds ...
_________________________
-- JD - SN# 040104008 (120GB Blue, Digital Out)
|
Top
|
|
|
|
#180130 - 18/01/2004 22:10
Re: Cross-compile chain for OS X uploaded
[Re: jdandrea]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
I don't know, honestly, because the truth is I'm still learning the "MacOS way(tm)"
|
Top
|
|
|
|
#346190 - 04/07/2011 02:49
Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Here's the kit. the binaries will follow.
Attachments
armtools-darwin-intel.tar.gz (224 downloads)Description: arm cross compile kit for intel darwin
Edited by dbrashear (04/07/2011 02:51) Edit Reason: add attachment
|
Top
|
|
|
|
#346191 - 04/07/2011 02:54
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
http://empeg.dementia.org/distributions/ again has the intel darwin kit. not tested yet, as it finished mere moments ago.
|
Top
|
|
|
|
#346200 - 05/07/2011 01:20
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
updated kit and toolchain in same place; this time also builds zlib and ncurses.
|
Top
|
|
|
|
#346363 - 12/07/2011 17:14
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Thanks. Have you by any chance tried to build a kernel using this toolchain? I'm getting this error:
arm-empeg-linux-gcc -D__KERNEL__ -I/Users/tonyc/dev/empeg/kernel/current/include -Wall -Wstrict-prototypes -O2 \
-fno-strict-aliasing -pipe -msoft-float -march=armv4 -mtune=strongarm110 -c -o sock.o sock.c
Assembler messages:
option `-marmv4' is deprecated: use -march=armv4
{standard input}:508: Error: Rn must not overlap other operands -- `swp r3,r2,[r3]'
make[3]: *** [sock.o] Error 1
make[2]: *** [first_rule] Error 2
make[1]: *** [_subdir_core] Error 2
make: *** [_dir_net] Error 2
No idea what's going on there. My next step would be to do build my own toolchain instead of relying on your binaries, but if you've got a quick fix, let me know.
|
Top
|
|
|
|
#346366 - 12/07/2011 19:21
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
if you build from the same source i do, you'll have the same problem. i can see where it was introduced but not why, if that patch is right, the generated code would have worked before.
i'll look some more after i get the openafs lion client finished later tonight.
|
Top
|
|
|
|
#346370 - 12/07/2011 21:33
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
can you arm-empeg-linux-gcc -D__KERNEL__ -I/Users/tonyc/dev/empeg/kernel/current/include -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing -pipe -msoft-float -march=armv4 -mtune=strongarm110 -E sock.c > sock.i
and tell me what's on line 508 of sock.i?
|
Top
|
|
|
|
#346371 - 12/07/2011 21:37
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
(it's going to be an issue like this: http://www.rockbox.org/tracker/task/7972but the simplest way to fix it is just to patch the kernel)
|
Top
|
|
|
|
#346376 - 13/07/2011 00:03
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Something's screwing with the line numbers, because that line (and many others) are blank. The only swp instruction I see in there is in this block:
extern const char xchg_str[];
extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
{
switch (size) {
case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
break;
case 2: abort ();
case 4: __asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
break;
default: arm_invalidptr(xchg_str, size);
}
return x;
}
Here's the full sock.i file.
|
Top
|
|
|
|
#346377 - 13/07/2011 00:53
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
that's gonna be it. lemme see what i can do with that.
|
Top
|
|
|
|
#346378 - 13/07/2011 01:01
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
apply the attached diff to your kernel tree. i *think* that will do it. if so, i'll ask mark if he's willing to add it to v514; it's what i believe to be the barest fix.
Attachments
system.h-diff (603 downloads)
|
Top
|
|
|
|
#346379 - 13/07/2011 01:16
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
That wins, but fails further into the build: arm-empeg-linux-ar rcs lib.a changebit.o checksum.o clearbit.o copy_page.o findbit.o memchr.o memcpy.o memset.o memzero.o setbit.o strchr.o strrchr.o testchangebit.o testclearbit.o testsetbit.o semaphore.o system.o uaccess.o io-sa1100.o make -C arch/arm/kernel arm-empeg-linux-gcc -D__KERNEL__ -I/Users/tonyc/dev/empeg/kernel/current/include -D__ASSEMBLY__ -mno-fpu -mapcs-32 -marmv4 -c -o entry-armv.o entry-armv.S entry-armv.S: Assembler messages: entry-armv.S:370: Error: Macro `arm700_bug_check' was already defined entry-armv.S:456: Warning: destination register same as write-back base make[1]: *** [entry-armv.o] Error 1 make: *** [_dir_arch/arm/kernel] Error 2
|
Top
|
|
|
|
#346380 - 13/07/2011 01:38
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
[pre] --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -397,8 +397,6 @@ irq_prio_ebsa110: run on an ARM7 and we can save a couple of instructions. --pb */ .macro arm700_bug_check, instr, temp - .endm - .macro arm700_bug_check, instr, temp #ifndef __ARM_ARCH_4__ and \temp, \instr, #0x0f000000 @ check for SWI teq \temp, #0x0f000000
[/pre]
|
Top
|
|
|
|
#346381 - 13/07/2011 01:54
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
|
Top
|
|
|
|
#346382 - 13/07/2011 02:01
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
well, basically it's just patches to deal with the tightening up of what gas enforces.
|
Top
|
|
|
|
#346384 - 13/07/2011 02:54
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Gotcha. Now I can build kernels, but I'm getting an undefined reference to fstat error when trying to build GNU gettext: make[5]: Nothing to be done for `all-am'. Making all in src /bin/sh ../libtool --tag=CC --mode=link arm-empeg-linux-gcc -DINSTALLDIR=\"/opt/arm/arm-empeg-linux/bin\" -I/opt/arm/include -I/opt/arm/arm-empeg-linux/include/ -L/opt/arm/lib -L/opt/arm/arm-empeg-linux/lib -o gettext gettext-gettext.o ../gnulib-lib/libgrt.a ../intl/libintl.la libtool: link: arm-empeg-linux-gcc -DINSTALLDIR=\"/opt/arm/arm-empeg-linux/bin\" -I/opt/arm/include -I/opt/arm/arm-empeg-linux/include/ -o .libs/gettext gettext-gettext.o -L/opt/arm/lib -L/opt/arm/arm-empeg-linux/lib ../gnulib-lib/libgrt.a ../intl/.libs/libintl.so -lc -Wl,-rpath -Wl,/opt/arm/arm-empeg-linux/lib ../intl/.libs/libintl.so: undefined reference to `fstat' collect2: ld returned 1 exit status
I've never seen anything like that when cross-compiling on my linux machine.
|
Top
|
|
|
|
#346386 - 13/07/2011 03:09
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Gotcha. Now I can build kernels, but I'm getting an undefined reference to fstat error when trying to build GNU gettext: make[5]: Nothing to be done for `all-am'. Making all in src /bin/sh ../libtool --tag=CC --mode=link arm-empeg-linux-gcc -DINSTALLDIR=\"/opt/arm/arm-empeg-linux/bin\" -I/opt/arm/include -I/opt/arm/arm-empeg-linux/include/ -L/opt/arm/lib -L/opt/arm/arm-empeg-linux/lib -o gettext gettext-gettext.o ../gnulib-lib/libgrt.a ../intl/libintl.la libtool: link: arm-empeg-linux-gcc -DINSTALLDIR=\"/opt/arm/arm-empeg-linux/bin\" -I/opt/arm/include -I/opt/arm/arm-empeg-linux/include/ -o .libs/gettext gettext-gettext.o -L/opt/arm/lib -L/opt/arm/arm-empeg-linux/lib ../gnulib-lib/libgrt.a ../intl/.libs/libintl.so -lc -Wl,-rpath -Wl,/opt/arm/arm-empeg-linux/lib ../intl/.libs/libintl.so: undefined reference to `fstat' collect2: ld returned 1 exit status
I've never seen anything like that when cross-compiling on my linux machine. I have. there was some fun in glibc i remember from sparclinux that did that. i'm not (network) near the toolchain; what does arm-empeg-linux-nm libc.a |grep fstat show? you'll need the full path to libc in your install.
|
Top
|
|
|
|
#346391 - 13/07/2011 11:25
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
actually, this one should be simpler. you relocated my tree, which is fine, but you need to tweak one file. arm-empeg-linux/lib/libc.so should have the paths corrected.
i should add that to a readme.
|
Top
|
|
|
|
#346392 - 13/07/2011 12:11
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Yeah, /opt/local is "owned" by MacPorts, so I didn't like the idea of using /opt/local/arm.
I did, however, end up symlinking /opt/local/armtools to /opt/arm, so the paths inside libc.so are legit. Shouldn't that still work?
|
Top
|
|
|
|
#346394 - 13/07/2011 12:44
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
it may be unhappy at a symlink. it's just a text file, try editing and see what happens? (fstat is defined in libc_nonshared.a)
|
Top
|
|
|
|
#346395 - 13/07/2011 13:02
Re: Cross-compile chain for OSX Intel
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
No dice. I'll build my own toolchain and see if that fixes it.
|
Top
|
|
|
|
#346396 - 13/07/2011 13:32
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Wonderful, now the toolchain build is failing:
hecking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
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 /Users/tonyc/tmp/armtools-darwin/build-binutils/binutils-2.10.1/bfd failed, exiting.
make: *** [arm-linux-binutils] Error 1
It doesn't like gcc? Earlier in the binutils build it likes it just fine, but once it gets into bfd, it doesn't. Update: From the config.log in the bfd subdirectory:
configure:1850: checking for gcc
configure:1963: checking whether the C compiler (gcc -g -O2 -W -Wall ) works
configure:1979: gcc -o conftest.dSYM -g -O2 -W -Wall conftest.c 1>&5
configure:1976: warning: return type defaults to 'int'
ld: can't open output file for writing: conftest.dSYM, errno=21
collect2: ld returned 1 exit status
configure: failed program was:
#line 1974 "configure"
#include "confdefs.h"
main(){return(0);}
errno 21 appears to be EISDIR. wtf?
Edited by tonyc (13/07/2011 13:41)
|
Top
|
|
|
|
#346401 - 13/07/2011 15:30
Re: Cross-compile chain for OSX Intel
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
you're missing a patch, the one that tells it not to assume .dSYM is an object type, for one of the config.* files.
did you use my kit for the toolchain?
|
Top
|
|
|
|
|
|