2008-03-18 10:41:39 +00:00
|
|
|
require gcc-configure-common.inc
|
|
|
|
|
Share gcc work directories
This patched is derived from Richard, make gcc use the shared source
directory during the different building:
1) Make gcc-cross, gcc-cross-initial, gcc-cross-intermediate and
gcc-runtime share the same source directory.
2) The source directory is ${TMPDIR}/work-shared/gcc-${PV}, for example:
tmp/work-shared/gcc-4.5.1
3) Fix do_clean to clean the shared source directory and stamps
4) gcc uses sed and creates config files against ${S} which means the
directory should not be shared. Change the way to make it work:
* The configure option --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS}
can replace the sed command, see the code in configure:
if test "x$with_headers" != x; then
glibc_header_dir=$with_headers
This has the same effect as the sed command:
sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\": ...
so add the --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} to
gcc-configure-cross.inc( not add to gcc-configure-common.inc, since
not all the gcc building need this, the one which has its own do_configure
doesn't need it).
* Move t-oe from ${T} to ${B}/gcc, so that the patched Makefile.in
can read it easily, please see the commit for gcc-4.5.1 and
gcc-4.6.0.
* Use the defaults.h in ${B}/gcc instead of ${S}/gcc, and the patched
configure.ac(configure) can read it correctly, please see the
commit for gcc-4.5.1 and gcc-4.6.0.
* The gcc-crosssdk.inc used sed to edit ${S}/config/*/linux*.h
to change the GLIBC_DYNAMIC_LINKER, which made the source
incompatible. To make the source compatible:
- Use:
sed -i ${S}/gcc/config/*/linux*.h -e \
's#\(GLIBC_DYNAMIC_LINKER[^ ]*\)\( *"/lib.*\)#\1 SYSTEMLIBS_DIR\2#'
so entries in the files that look like:
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
would become
#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR"/ld-linux-x86-64.so.2"
and we define SYSTEMLIBS_DIR in defaults.h.
NOTE:
#define GLIBC_DYNAMIC_LINKER64 (SYSTEMLIBS_DIR "/ld-linux-x86-64.so.2")
doesn't work in in the following define:
#define LINUX_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
so use
#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR"/ld-linux-x86-64.so.2"
5) Add do_configure_prepend to gcc-configure-common.inc and remove the
one in gcc-crosssdk.inc, this makes it easy to share the source,
otherwise we need do extra changes in gcc-configure-sdk.inc.
6) Use "cat > file <_EOF" to replace the "echo > file"
(From OE-Core rev: 934d38530c9a67562e53d4034aee5531f0f26750)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 20:31:04 +00:00
|
|
|
EXTRA_OECONF += " --enable-poison-system-directories \
|
|
|
|
"
|
2010-09-03 17:38:59 +00:00
|
|
|
|
2011-10-07 13:19:15 +00:00
|
|
|
INHIBIT_DEFAULT_DEPS = "1"
|
|
|
|
|
2012-04-10 01:56:59 +00:00
|
|
|
EXTRA_OECONF_PATHS = " \
|
2012-04-13 04:35:14 +00:00
|
|
|
--with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \
|
2011-12-16 22:33:37 +00:00
|
|
|
--with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
|
2007-11-12 11:25:30 +00:00
|
|
|
--with-sysroot=${STAGING_DIR_TARGET} \
|
|
|
|
--with-build-sysroot=${STAGING_DIR_TARGET}"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
do_compile_prepend () {
|
|
|
|
export CC="${BUILD_CC}"
|
|
|
|
export AR_FOR_TARGET="${TARGET_SYS}-ar"
|
|
|
|
export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
|
|
|
|
export LD_FOR_TARGET="${TARGET_SYS}-ld"
|
|
|
|
export NM_FOR_TARGET="${TARGET_SYS}-nm"
|
|
|
|
export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
|
2012-03-28 14:22:44 +00:00
|
|
|
export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
|
|
|
|
export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
|
|
|
|
export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
|
|
|
|
export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
LIBGCCS_VAR = "-lgcc_s"
|
|
|
|
LIBGCCS_VAR_avr32 = ""
|