This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

crosstool and cygwin


Lots of people have asked whether crosstool could be
used on Cygwin.  I haven't tried it yet, but tonight I
got a copy of "Hacking your Tivo", and it happens to
come with a script for building a gcc-3.2 under Cygwin.
One of the strange things it does is patch all instances
of libtools to work around a bug; it seems even the latest
libtools is not compatible with cygwin!  Setting IFS to ~
as libtools does causes problems because on Cygwin, one
often finds ~ in directory and filenames.
(See e.g.
http://savannah.gnu.org/support/?func=detailsupport&support_id=100058&group_id=25
http://www.mail-archive.com/libtool@gnu.org/msg03746.html)

A script that builds a MIPS gcc for TiVo series 2 machines is at
http://dealdatabase.com/forum/showthread.php?s=&threadid=27280&highlight=cygwin+compiler
http://dealdatabase.com/forum/attachment.php?s=8b335111c8c546232ec5a16cc86dc8a1&postid=115275
It can't build a glibc, though, so it's probably not really going
to be a big help.

But (mostly as a reminder for me when I finally look at
cygwin and crosstool), here are a few excerpts from that script:


# Patch ~ into ? in sources for binutils/libtool declare -a files files=(binutils-$BINUTILS_VER/ltconfig binutils-$BINUTILS_VER/ltmain.sh \ binutils-$BINUTILS_VER/ltmain.sh.dso binutils-$BINUTILS_VER/ltcf-c.sh \ binutils-$BINUTILS_VER/ltcf-cxx.sh binutils-$BINUTILS_VER/ltcf-gcj.sh) for f in ${files[*]}; do echo $f test -f $f.old || mv $f $f.old sed 's/\([^\\]\)~/\1?/g' < $f.old > $f done

It does this for gcc/libtool, gdb/libtool, and insight/libtool, too.

It also changes a few identifiers (cf. http://lists.debian.org/debian-glibc/2003/debian-glibc-200305/msg00176.html) :

# Patch __mempcpy to mempcpy
declare -a files
files=(gcc-$GCC_VER/libiberty/getopt.c gcc-$GCC_VER/libiberty/regex.c \
  gcc-$GCC_VER/gcc/fixinc/gnu-regex.c)
for f in ${files[*]}; do
  echo $f
  test -f $f.old || mv $f $f.old
  sed 's/__mempcpy/mempcpy/g' < $f.old > $f
done

# Patch __thread to __thrd
declare -a files
files=(${PREFIX}/include/pthread.h ${PREFIX}/include/bits/sigthread.h)
for f in ${files[*]}; do
  echo $f
  test -f $f.old || mv $f $f.old
  sed -e 's/__thread,/__thrd,/g' -e 's/__thread)/__thrd)/g' < $f.old > $f
done

And finally, it does a third similar rename, but using a patch:

--- gcc-3.2-7.1/gcc/c-decl.c    2003-08-31 18:58:50.000000000 -0700
+++ gcc-3.2-7.1-mips/gcc/c-decl.c       2003-09-05 18:56:24.000000000 -0700
@@ -55,7 +55,7 @@
   PARM,                                /* Declaration of parm before function body */
   FIELD,                       /* Declaration inside struct or union */
   BITFIELD,                    /* Likewise but with specified width */
-  TYPENAME};                   /* Typename (inside cast or sizeof)  */
+  TYPENAME2};                  /* Typename (inside cast or sizeof)  */
...

So that's two basic changes - the ~ in the libtools, and renaming reserved words (__mempcpy,
__thread, TYPENAME).
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]