tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
--sysroot support
Hi all,
newer versions of binutils and GCC have a feature called sysroot,
enabled by passing down --sysroot=$D. This essentially allows prefixes
most builtin path names with $D. Attached patch enables this for
src/tools. It also removes the installation of GCC's own headers since
at least stddef.h doesn't work correctly without patches. The GCC
changes are a bit more nasty since the configure option doesn't allow
enabling it without also hard-coding a value.
This allows compiling a hello world with
i486--netbsdelf-gcc --sysroot=$DESTDIR hello.c
without having to worry about the many details like the combination of
-nostdinc, -nostdlib, -isysroot, -B etc.
A current build on Linux doesn't change at all with this patch, so I am
reasonable sure that it doesn't create a regression. Patches for using
this can follow later, but I would like to get the support into PCC
first.
Comments?
Joerg
Index: gnu/dist/gcc4/gcc/Makefile.in
===================================================================
RCS file: /home/joerg/repo/netbsd/src/gnu/dist/gcc4/gcc/Makefile.in,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.in
--- gnu/dist/gcc4/gcc/Makefile.in 12 Aug 2008 10:09:31 -0000 1.8
+++ gnu/dist/gcc4/gcc/Makefile.in 21 Mar 2011 07:26:56 -0000
@@ -3138,19 +3138,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H)
# Using basename would be simpler, but some systems don't have it.
# The touch command is here to workaround an AIX/Linux NFS bug.
-if [ -d include ] ; then true; else mkdir include; chmod a+rx include;
fi
- for file in .. $(USER_H); do \
- if [ X$$file != X.. ]; then \
- realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
- $(STAMP) include/$$realfile; \
- rm -f include/$$realfile; \
- cp $$file include; \
- chmod a+r include/$$realfile; \
- fi; \
- done
- rm -f include/limits.h
- cp xlimits.h include/limits.h
cp $(UNWIND_H) include/unwind.h
- chmod a+r include/limits.h
# Install the README
rm -f include/README
cp $(srcdir)/../fixincludes/README-fixinc include/README
Index: tools/binutils/Makefile
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tools/binutils/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- tools/binutils/Makefile 20 Nov 2009 22:51:29 -0000 1.18
+++ tools/binutils/Makefile 21 Mar 2011 09:08:14 -0000
@@ -9,7 +9,8 @@ GNUHOSTDIST= ${.CURDIR}/../../external/g
BRANDING?= \
--with-pkgversion="NetBSD Binutils nb1" \
- --with-bugurl="http://www.NetBSD.org/support/send-pr.html"
+ --with-bugurl="http://www.NetBSD.org/support/send-pr.html" \
+ --with-lib-path="=/usr/lib" --with-sysroot
.else
BRANDING?=
.endif
Index: tools/gcc/Makefile
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tools/gcc/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- tools/gcc/Makefile 23 Dec 2009 20:17:13 -0000 1.34
+++ tools/gcc/Makefile 21 Mar 2011 05:23:38 -0000
@@ -34,9 +34,12 @@ CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
--enable-languages="${GCC_LANGUAGES}"
+GCC_CPPFLAGS= -DNETBSD_TOOLS -DTARGET_SYSTEM_ROOT=0 \
+ -DTARGET_SYSTEM_ROOT_RELOCATABLE
+
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
- EXTRA_PARTS= CPPFLAGS=-DNETBSD_TOOLS \
+ EXTRA_PARTS= CPPFLAGS=${GCC_CPPFLAGS:Q} \
AR=${HOST_AR:Q} RANLIB=${HOST_RANLIB:Q}
CONFIGURE_ENV+= gcc_cv_libc_provides_ssp=yes
Home |
Main Index |
Thread Index |
Old Index