Hi,
I'd like to cross compile a scheme app for OpenWRT (MIPS architecture). Has anyone attempted to do this? How can I approach this?
The main problem is that I can't have a running MIPS system in a virtual machine. So cross-compilation seems to be the only option.
Razvan
Afficher les réponses par date
On Sun, Oct 27, 2013 at 1:07 PM, Răzvan Rotaru razvan.rotaru@gmail.com wrote:
Hi,
I'd like to cross compile a scheme app for OpenWRT (MIPS architecture). Has anyone attempted to do this? How can I approach this?
The main problem is that I can't have a running MIPS system in a virtual machine. So cross-compilation seems to be the only option.
I haven't tackled this sort of problem myself, but presumably you would use gsc -link to compile the Scheme files to C and generate a link file, and then pass those to your C cross-compiler.
--Jeff
Well, I'm not familiar with all the options that need to be passed to gcc for compiling. Right now, I'm getting a linker error.
[roti@pella myschemeapp]$ mips-openwrt-linux-gcc -I/home/roti/programs/gambit.mips-openwrt/include -L/home/roti/programs/gambit.mips-openwrt/lib -lgambc main.c main_.c /tmp/ccHNROa6.o: In function `main': main_.c:(.text+0x58): undefined reference to `___main_char' /tmp/ccHNROa6.o:(.data+0x0): undefined reference to `____20___gambc' /tmp/ccjEdal3.o: In function `___H__20_main': main.c:(.text+0xe8): undefined reference to `___gstate' ....
Razvan
On 27 October 2013 19:14, Jeff Read bitwize@gmail.com wrote:
On Sun, Oct 27, 2013 at 1:07 PM, Răzvan Rotaru razvan.rotaru@gmail.com wrote:
Hi,
I'd like to cross compile a scheme app for OpenWRT (MIPS architecture).
Has
anyone attempted to do this? How can I approach this?
The main problem is that I can't have a running MIPS system in a virtual machine. So cross-compilation seems to be the only option.
I haven't tackled this sort of problem myself, but presumably you would use gsc -link to compile the Scheme files to C and generate a link file, and then pass those to your C cross-compiler.
--Jeff
Hallo,
On Sun, Oct 27, 2013 at 7:24 PM, Răzvan Rotaru razvan.rotaru@gmail.com wrote:
Well, I'm not familiar with all the options that need to be passed to gcc for compiling. Right now, I'm getting a linker error.
Try to put '-lgambc' last in your linking command line.
HTH,
In case it's useful, LambdaNative supports cross-compiling Gambit Scheme apps using the OpenWrt SDKs (tested on one of the MIPS targets from the Attitude Adjustment (12.09) release).
Chris
________________________________________ From: gambit-list-bounces@iro.umontreal.ca [gambit-list-bounces@iro.umontreal.ca] On Behalf Of Răzvan Rotaru [razvan.rotaru@gmail.com] Sent: Sunday, October 27, 2013 10:07 AM To: gambit-list@iro.umontreal.ca Subject: [gambit-list] Cross compilation for OpenWRT
Hi,
I'd like to cross compile a scheme app for OpenWRT (MIPS architecture). Has anyone attempted to do this? How can I approach this?
The main problem is that I can't have a running MIPS system in a virtual machine. So cross-compilation seems to be the only option.
Razvan
On 30 October 2013 01:32, Petersen, Chris CPetersen@cw.bc.ca wrote:
In case it's useful, LambdaNative supports cross-compiling Gambit Scheme apps using the OpenWrt SDKs (tested on one of the MIPS targets from the Attitude Adjustment (12.09) release).
Chris
Thanks. It looks like an interesting project. I did not manage to get it up & running though, I can't remember right now why.
In the meantime I have found a way to cross compile scheme apps. When running gsc with -exe and -verbose, it will print out the gcc command lines it uses. It looks like I was missing -lutil -ldl -lm. The complete command line looks like this (not including all the optimization options):
mips-openwrt-linux-gcc -D___SINGLE_HOST -I"/home/roti/programs/gambit.mips-openwrt/include" test.c test_.c /home/roti/programs/gambit.mips-openwrt/lib/libgambc.a -lutil -ldl -lm
Razvan