delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/21/15:15:50

X-Spam-Check-By: sourceware.org
Message-ID: <a6355d0d0608211215i4f7eeb46o3184c0304afdf365@mail.gmail.com>
Date: Mon, 21 Aug 2006 15:15:36 -0400
From: "Wang Yiping" <ypwangandy AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: gcc-3.4.4 compile dietlibc error on cygwin
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019