This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

gcc-3.4 cross support for non C languages


Hi!

cross for the following environment:
tgt=i686-pc-cygwin
host=$(gcc -dumpmachine) (ahhh: i686-gnu-linux):

host and target are using gcc-3.4.0 and binutils-2.14
release - quite current, so flaming a bit should be ok. :)

0. gcc (the compiler, not the collection) works like charm -
   that's what I really need.
 
hey, but where is the fun without
--enable-languages="c,c++,f77,java"

1. libstdc++-V3 does not build - ok but there is no
   option to disable it - which would be _reasonable_ for
   cross builds. (anyway, rm -rf ./libstdc++-v3 works)
   (Jesus, I discovered the manual --enable-maintainer-mode :)

This is a general design question: a "--strict-cross"
option is maybe interesting - to remove any _libraries_.
I want to optionally have raw meat on cross builds!

2. f77:

F77 builds fine but not the library. libU77 forgets
that we are building cross and tries to exec a test
excutable - the configure script seems not cross aware.
(cool, thanks for the wine window - I'm doing that
 all to not see crap crap-os compatibility layers,
 arghh!)

ok, rm -rf ./libf2c is the solution (should be obsoleted
by --strict-cross :)

3. Java (my favorite language after Klingon(*))

well, I did not even try to build the related library
and so I just started with rm -rf ./libjava -
which could be also avoided by introducing - guess -
--strict-cRoSs :)

Well, java is a problem, it builds ok but:
LANG=C ./gcj
gcj: libgcj.spec: No such file or directory

so my fix was maybe too hard - who cares - Java is broken
in general anyway - a working gcj environment would be just
an attempt to hide that important fact!
:)

I'm really happy that gcc (the compiler, not the collection)
works and that I don't need to build under <beeep> OS
by <ooops> corporation.
But I guess that "other" language cross support could be improved
(is this the nice word for fixed?) - I don't really care but I want
to let you know that. :)

Here my build-script (currently only with --strict-cross emulation):

----------------------------------------------------------------------
#! /bin/bash
#
# (c) 2004 by st.traby <stefan@hello-penguin.com>
# GPL, strict.
#
# include <sponsors.h> /* reiser support - now incompatible to Debian */
# include <qt.h>       /* qt.h   support - now incompatible to RedHat */
# include <windows.h>  /* win32  support - now incompatible to real world */
#
#
prefix=/usr/local/cygwin
tgt=i686-pc-cygwin
host=$(gcc -dumpmachine)
gcc_ver=3.4.0
binutils_ver=2.14

if [ -z "$host" ] ; then
  echo "warning can't determinate host, defaulting to 'i686-pc-linux'" 1>&2
  host=i686-pc-linux
fi


if [ \! -f binutils-"$binutils_ver".tar.bz2 -o \! -f gcc-"$gcc_ver".tar.bz2 ] ; then
  echo "need 'binutils-"$binutils_ver".tar.bz2' and 'gcc-"$gcc_ver".tar.bz2' in current directory."
  exit 1
fi
# ok, this check is cygwin specific but it should not.
if [ \! -f "$prefix/$tgt/lib/libcygwin.a" \
  -o \! -f "$prefix/$tgt/include/string.h"  ] ; then
  echo "you need to extract /usr/include and /lib of your cygwin installation to $prefix/$tgt/{include,lib} first."
  exit 1
fi

if [ \! -f "./binutils-$binutils_ver/build/build.ok" ] ; then
   rm -rf -- "./binutils-$binutils_ver/build"
   tar jxpf "./binutils-$binutils_ver.tar.bz2" || exit 1
   cd "binutils-$binutils_ver" || exit 1
   mkdir build && cd build || exit 1
   ../configure --prefix="$prefix" --exec-prefix="$prefix" \
      --target="$tgt" --host="$host" || exit 1
   make && make install || exit 1
   touch build.ok
   cd ../../
fi

PATH="$PATH:$prefix/bin:$prefix/$tgt/bin"
export PATH


if [ \! -f "./gcc-$gcc_ver/build/build.ok" ] ; then
   rm -rf -- "./gcc-$gcc_ver/build"
   tar jxpf "./gcc-$gcc_ver.tar.bz2" || exit 1
   cd "gcc-$gcc_ver" || exit 1
   # XXX this is the standard way to disable libstdc++ :)
   rm -rf ./libstdc++-v3
   # XXX this is "my standard procedure" to disable libjava :)
   rm -rf ./libjava
   # XXX this is the standard way to get rid of libU77 which ignores cross
   #     and starts up wine (tries to exec the cross binary) :)
   rm -rf ./libf2c
   mkdir build && cd build || exit 1
   ../configure --prefix="$prefix" --exec-prefix="$prefix" \
        --target="$tgt" --host="$host" --enable-haifa \
        --enable-languages="c,c++,f77,java" || exit 1
   make && make install || exit 1
   touch build.ok
   cd ../../
fi

cd "$prefix/$tgt/bin" || exit 1
for i in ../../bin/*; do
   if [ $i !=  ${i/$tgt-/} ]; then
      ln -s $i ${i/.*$tgt-/}
   fi
done
ln -s gcc cc
echo "-------------------------------------------------------"
echo "| successfully build and installed the cross-compiler"
echo "| under $prefix/$tgt"
echo "-------------------------------------------------------"
exit 0
----------------------------------------------------------------------

Ok, what did I wong beside beeing a complete idiot?
I'm not going for "checked cygwin compiler sources" or other
gcc-2.96 like stuff, it's a gcc release!

-- 

  ciao - 
    Stefan

(*) I had to say Klingon, ((((rms)))) would maybe sue me for telling
    the truth... :)


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