This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] PR other/32154 (Was: [m32c] build libstdc++; combined builds, libssp, and libgloss)
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, newlib at sourceware dot org
- Date: Sun, 10 Jun 2007 23:50:52 +0200
- Subject: [PATCH] PR other/32154 (Was: [m32c] build libstdc++; combined builds, libssp, and libgloss)
- References: <200604190055.k3J0t3UF032396@greed.delorie.com> <20070531111003.GV5690@sygehus.dk> <200705311603.l4VG3LH7013326@greed.delorie.com>
On Thu, May 31, 2007 at 12:03:21PM -0400, DJ Delorie wrote:
>
> > Why don't we do this for all the newlib targets, instead of just
> > for m32c-*-*? Is there a particular reason for not doing so when
> > --with-newlib is specified?
>
> Not all targets have their files in the same location, but otherwise,
> I suppose we could add *some* generalization here.
This patch allows newlib targets to configure libstdc++ without the
dreaded message "Link tests are not allowed after GCC_NO_EXECUTABLES" in a
combined tree.
M32c-unknown-elf was already supported, and I have tested that it still
configures, builds and tests for c,c++ and objc and that fortran is still
broken (PR target/32055). Target-libjava was unsupported for all cross
target triplets that I tried.
Mipsisa64-unknown-elf doesn't try to link in any startup code or anything
by default and thus doesn't fail. This hasn't changed and c,c++,objc and
fortran still configures and builds.
I have tested that c,c++,objc and fortran now configures and builds on
arm-unknown-elf, v850-unknown-elf and sh-unknown-elf. Additionally,
fr30-unknown-elf configured and built for c,c++,objc and fortran, but there
seems to be no simulator any more.
I also bootstrapped i686-pc-linux-gnu and checked that none of the -L and
-B options for libgloss crept in by inspecting config.log.
2007-06-10 Rask Ingemann Lambertsen <rask@sygehus.dk>
PR other/32154
* configure.ac: For libgloss targets, point the linker to the linker
script, startup code and simulator library.
* configure: Regenerate.
Index: configure.ac
===================================================================
--- configure.ac (revision 125029)
+++ configure.ac (working copy)
@@ -2275,6 +2275,57 @@
# for any libc-related directories first (so make it the last -B
# switch).
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
+
+ # If we're building libgloss, find the startup file, simulator library
+ # and linker script.
+ case " $target_configdirs " in
+ *" libgloss "*)
+ case "$target" in
+ i[[3456]]86-*-elf* | i[[3456]]86-*-coff*)
+ libgloss_dir=i386
+ ;;
+ m68hc11-*-* | m6811-*-* | m68hc12-*-* | m6812-*-*)
+ libgloss_dir=m68hc11
+ ;;
+ fido-*-* | m68*-*-*)
+ libgloss_dir=m68k
+ ;;
+ hppa*-*-pro*)
+ libgloss_dir=pa
+ ;;
+ sparclet-*-aout* | sparc-*-elf* | sparc64-*-elf* | sparc86x-*-* | sparclite-*-*)
+ libgloss_dir=sparc
+ ;;
+ sh*-*-pe | mips*-*-pe | *arm-wince-pe)
+ libgloss_dir=wince
+ ;;
+ mips*-*-*)
+ libgloss_dir=mips
+ ;;
+ powerpc-*-*|powerpcle-*-*)
+ libgloss_dir=rs6000
+ ;;
+ cris-*-* | crisv32-*-*)
+ libgloss_dir=cris
+ ;;
+ frv*-*-*)
+ libgloss_dir=frv
+ ;;
+ strongarm-*-elf | strongarm-*-coff | arm*-*-elf | arm*-*-coff | ep9312-*-elf | ep9312-*-coff | xscale-*-elf | xscale-*-coff | *arm-*-*)
+ libgloss_dir=arm
+ ;;
+ *)
+ libgloss_dir=`echo $target | sed -e 's/-.*//'`
+ ;;
+ esac
+ # Look for startup file, simulator library and maybe linker script.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
+ # Look for libnosys.a in case the target needs it.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
+ # Most targets have the linker script in the source directory.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
+ ;;
+ esac
;;
esac
;;
@@ -2308,16 +2359,6 @@
# Search for other target-specific linker scripts and such.
case "${target}" in
- m32c-*-* )
- if test -d ${srcdir}/libgloss/m32c; then
- # This is for crt0.o
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c'
- # This is for r8c.ld
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c'
- # This is for libnosys.a
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
- fi
- ;;
mep*)
FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
;;
--
Rask Ingemann Lambertsen