This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH [SPU]: assist with sysroot building
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Dec 2006 14:42:28 +1100
- Subject: PATCH [SPU]: assist with sysroot building
This little patch assists with building the SPU and PowerPC compilers
with a common sysroot and has been present and tested in our tree for
some time. Okay for the trunk?
2006-12-15 Ulrich Weigand <uweigand@de.ibm.com>
* config/spu/spu-elf.h (STANDARD_STARTFILE_PREFIX_1): Define.
(STANDARD_STARTFILE_PREFIX_2): Likewise.
(STANDARD_STARTFILE_PREFIX_3): Likewise.
* config/spu/t-spu-elf (NATIVE_SYSTEM_HEADER_DIR): Set.
(STMP_FIXINC): Suppress running fixincludes on newlib headers.
Thanks,
Ben
Index: config/spu/spu-elf.h
===================================================================
--- config/spu/spu-elf.h (revision 119869)
+++ config/spu/spu-elf.h (working copy)
@@ -24,7 +24,18 @@
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
+/* Add sysroot prefixes. The following macros are used only when building
+ the compiler with --with-sysroot. They have the effect of allowing to
+ build a pair of PPU and SPU cross-compilers with a common sysroot; the
+ SPU compiler will search for its files in ${sysroot}/usr/spu/include
+ and ${sysroot}/usr/spu/lib. */
+
+#undef STANDARD_STARTFILE_PREFIX_1
+#define STANDARD_STARTFILE_PREFIX_1 ""
+#undef STANDARD_STARTFILE_PREFIX_2
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/spu/lib/"
+#undef STANDARD_INCLUDE_DIR
+#define STANDARD_INCLUDE_DIR "/usr/spu/include"
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
Index: config/spu/t-spu-elf
===================================================================
--- config/spu/t-spu-elf (revision 119869)
+++ config/spu/t-spu-elf (working copy)
@@ -15,6 +15,13 @@
# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
+# Define system directory to match STANDARD_INCLUDE_DIR in spu-elf.h,
+# allowing combined SPU/PPU sysroot builds.
+NATIVE_SYSTEM_HEADER_DIR = /usr/spu/include
+
+# Suppress running fixincludes to avoid build problems due to non-existent
+# sysroot include directory; newlib includes don't need fixing anyway.
+STMP_FIXINC =
# Suppress building libgcc1.a
LIBGCC1 =