Mail Archives: cygwin/2006/08/21/15:15:50
Dear Reads:
In my first letter, I just tried to cross-compiled the dietlibc in
cygwin. In order to cross-compile programs that depends on dietlibc
such as nash, one must get a HOST diet execution from the dietlibc and
then run diet some-arch-gcc yourfile.c.
Although dietlibc supports cross-compile, but It doesn't support
create host diet.exe in cygwin directly from it's Makefile. Just do
the following, you can get diet.exe then you can do cross-compiling
other programs depended on dietlibc.
1. patch the diet.c
$ diff -Nur diet.c diet-cygwin.c
--- diet.c 2004-07-29 06:40:21.000000000 -0400
+++ diet-cygwin.c 2006-08-19 22:27:13.468750000 -0400
@@ -3,8 +3,8 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <write12.h>
-
+//#include <write12.h>
+#define __write2 printf
#include "dietfeatures.h"
/* goal:
2. compile the diet.exe
$ i686-pc-cygwin-gcc diet-cygwin.c -I./include -DDIETHOME=\"/tmp/dietlibc-0.27\
" -DVERSION=\"dietlibc-0.27\" -o diet-cygwin
3. in your programs, change the diet name to your newly diet.exe
e.g. in /tmp/mkinitrd-3.5.13/nash/Makefile
CC:=/tmp/dietlibc-0.27/diet-cygwin $(CC)
then do the cross-compiling, you will get the nash
Best Regards
Andy
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -