[Clfs-dev] CLFS build under Cygwin

Serge.Nikulin at l-3com.com Serge.Nikulin at l-3com.com
Thu Sep 8 14:21:36 PDT 2011


Hi,

 

I have recently built a nice little embedded Linux under Cygwin
following CLFS guidelines (Current 1.x).

I used GCC-4.6.1 instead of GCC-4.6.0 and CLFS patches.

I hope somebody find these notes useful.

 

1.    GMP, MPFR, MPC and PPL libraries configuration calls should be run
with --disable-static --enable-shared options.

2.    MPC-0.9 configure script has some Cygwin-related bug. Instead of
finding the bug I just fixed mpc-0.9/src/Makefile:
In place of DEFS = -DHAVE_CONFIG_H you should use DEFS = -DHAVE_CONFIG_H
-D__MPC_WITHIN_MPC

3.    Before EGLIBC build:

a.    Convert your Windows NTFS to case-sensitive mode
(http://www.cygwin.com/cygwin-ug-net/using-specialnames.html)
Some 3-d party Windows software might grossly misbehave after that (e.g.
Garmin USB driver blue-screened my PC).
I settled on a VM with fresh installation of Win7 plus Cygwin.

b.    Rename Cygwin's native g++, cc, c++ files in C:\cygwin\bin to
c++.exe.saved, cc.exe.saved, g++.exe.saved.

4.    During EGLIBC build and installation it will fail on Cygwin-native
compilation of sunrpc/cross-rpcgen.exe and timezone/cross-zic.exe
(because of Cygwin's gcc deficiencies?). 
I am sure it's fixable in Makefiles and scripts but I did not care to do
it right and just temporarily commented out the 
whole #ifndef __u_char_defined construct  in
eglibc-2.13/sunrpc/rpc/types.h and linked with -lintl option. 
If you do it this way, don't forget to uncomment the above construct
when your are done!

5.    After EGLIBC installation rename g++, cc, c++ to c++.exe.saved,
cc.exe.saved, g++.exe.saved files to g++, cc, c++

 

 

One more suggestion (it's purely a matter of taste, I guess): instead of
CLFS-recommended values for environment variables I am using the
following definitions and no root mounts:

 

export CLFS_HOST="i686-cross-cygwin"

export CLFS_TARGET="i686-pc-linux-gnu"

export CLFS=/opt/crosstool/gcc-4.6.1-eglibc-2.13/$CLFS_TARGET

export TOOLS=$CLFS/$CLFS_TARGET

 

I had to change all CLFS snippets accordingly too.

This approach creates a nicely encapsulated
/opt/crosstool/gcc-4.6.1-eglibc-2.13 folder with everything related to
the build and this folder is easily transferrable (copy&paste) between
different windows workstations.

 

Serge

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-dev-clfs.org/attachments/20110908/2d09fcb7/attachment.html>


More information about the Clfs-dev mailing list