This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix --without-headers for sh targets
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 8 Apr 2005 22:34:38 -0500
- Subject: Fix --without-headers for sh targets
- Organization: wh0rd.org
find attached a minor patch to fix building gcc-3.4 for sh targets and using
the --without-headers configure option
verified gcc-3.4.3 was broken as is the gcc-3.4-20050401 snapshot ... and cvs
shows that the gcc-3_4-branch could still use this
for reference, method to reproduce:
$ tar jxf binutils-2.15.94.0.1.tar.bz2 -C ~/
$ cd ~/binutils-2.15.94.0.1
$ ./configure --prefix=/usr/local --target=sh-linux
$ make
$ sudo make install
$ tar jxf gcc-3.4-20050401.tar.bz2 -C ~/
$ cd ~/gcc-3.4-20050401
$ /configure --target=sh-linux --disable-werror --enable-languages=c
--disable-shared --disable-threads --without-headers
$ make
/home/vapier/gcc-3.4-20050401/gcc/xgcc -B/home/vapier/gcc-3.4-20050401/gcc/
-B/usr/local/sh-linux/bin/ -B/usr/local/sh-linux/lib/
-isystem /usr/local/sh-linux/include -isystem /usr/local/sh-linux/sys-include
-O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic
-DNO_FPSCR_VALUES -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc
-I. -I. -I. -I./. -I./../include -DL_muldi3 -c ./libgcc2.c -o
libgcc/./_muldi3.o
In file included from ./tm.h:10,
from ./libgcc2.c:43:
./config/sh/linux.h:149:20: signal.h: No such file or directory
./config/sh/linux.h:150:26: sys/ucontext.h: No such file or directory
make[2]: *** [libgcc/./_muldi3.o] Error 1
-mike
--- gcc/config/sh/linux.h
+++ gcc/config/sh/linux.h
@@ -154,6 +154,7 @@
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
+#ifndef inhibit_libc
#ifdef IN_LIBGCC2
#include <signal.h>
#include <sys/ucontext.h>
@@ -304,6 +305,7 @@
#endif /* defined (__SH5__) */
#endif /* IN_LIBGCC2 */
+#endif /* inhibit_libc */
/* For SH3 and SH4, we use a slot of the unwind frame which correspond
to a fake register number 16 as a placeholder for the return address