2008-03-18 10:41:39 +00:00
|
|
|
#
|
|
|
|
# Build the list of lanaguages to build.
|
|
|
|
#
|
|
|
|
# These can be overridden by the version specific .inc file.
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
# Java (gcj doesn't work on all architectures)
|
2006-12-28 23:22:59 +00:00
|
|
|
JAVA ?= ",java"
|
|
|
|
JAVA_arm ?= ""
|
|
|
|
JAVA_armeb ?= ""
|
|
|
|
JAVA_mipsel ?= ""
|
|
|
|
JAVA_sh3 ?= ""
|
2008-03-18 10:41:39 +00:00
|
|
|
# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
|
2006-12-28 23:22:59 +00:00
|
|
|
FORTRAN ?= ",f77"
|
|
|
|
LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
|
2010-07-30 21:05:16 +00:00
|
|
|
# disable --enable-target-optspace for powerpc SPE
|
|
|
|
# at -Os libgcc.so.1 creates references into
|
|
|
|
# hidden symbols in libgcc.a which linker complains
|
|
|
|
# when linking shared libraries further in the build like (gnutls)
|
|
|
|
|
2010-09-25 02:16:26 +00:00
|
|
|
SPECIAL_ARCH_LIST = "powerpc"
|
2010-09-16 05:51:09 +00:00
|
|
|
OPTSPACE = ${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2008-05-16 09:06:00 +00:00
|
|
|
EXTRA_OECONF_BASE ?= ""
|
|
|
|
EXTRA_OECONF_PATHS ?= ""
|
2010-03-31 16:28:08 +00:00
|
|
|
EXTRA_OECONF_INITIAL ?= ""
|
|
|
|
EXTRA_OECONF_INTERMEDIATE ?= ""
|
2008-05-16 09:06:00 +00:00
|
|
|
|
2010-07-23 13:34:22 +00:00
|
|
|
GCCMULTILIB = "--disable-multilib"
|
2009-09-17 00:04:09 +00:00
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-languages=${LANGUAGES} \
|
|
|
|
--enable-threads=posix \
|
2009-09-17 00:04:09 +00:00
|
|
|
${GCCMULTILIB} \
|
2005-08-31 10:45:47 +00:00
|
|
|
--enable-c99 \
|
|
|
|
--enable-long-long \
|
|
|
|
--enable-symvers=gnu \
|
|
|
|
--enable-libstdcxx-pch \
|
|
|
|
--program-prefix=${TARGET_PREFIX} \
|
2010-07-30 21:05:16 +00:00
|
|
|
${OPTSPACE} \
|
2008-05-16 09:06:00 +00:00
|
|
|
${EXTRA_OECONF_BASE} \
|
|
|
|
${EXTRA_OECONF_FPU} \
|
2010-07-30 21:05:16 +00:00
|
|
|
${EXTRA_OECONF_PATHS} \
|
|
|
|
${@get_gcc_mips_plt_setting(bb, d)}"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
# Build uclibc compilers without cxa_atexit support
|
|
|
|
EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
|
|
|
|
EXTRA_OECONF_append_linux-gnueabi = " --enable-__cxa_atexit"
|
|
|
|
EXTRA_OECONF_append_linux-uclibc = " --disable-__cxa_atexit"
|
|
|
|
EXTRA_OECONF_append_linux-uclibcgnueabi = " --disable-__cxa_atexit"
|
2008-05-16 09:06:00 +00:00
|
|
|
EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}"
|
2005-08-31 10:45:47 +00:00
|
|
|
CPPFLAGS = ""
|
|
|
|
|
|
|
|
# Used by configure to define additional values for FLAGS_FOR_TARGET -
|
|
|
|
# passed to all the compilers.
|
2008-05-16 09:06:00 +00:00
|
|
|
ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}"
|
2005-08-31 10:45:47 +00:00
|
|
|
EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
|
|
|
|
|
2009-09-17 14:23:29 +00:00
|
|
|
SYSTEMHEADERS = "${target_includedir}"
|
2010-07-15 09:19:12 +00:00
|
|
|
SYSTEMLIBS = "${target_base_libdir}/"
|
2009-09-17 14:23:29 +00:00
|
|
|
SYSTEMLIBS1 = "${target_libdir}/"
|
2009-09-17 00:05:15 +00:00
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
do_configure () {
|
|
|
|
# Setup these vars for cross building only
|
|
|
|
# ... because foo_FOR_TARGET apparently gets misinterpreted inside the
|
|
|
|
# gcc build stuff when the build is producing a cross compiler - i.e.
|
|
|
|
# when the 'current' target is the 'host' system, and the host is not
|
|
|
|
# the target (because the build is actually making a cross compiler!)
|
|
|
|
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
|
|
|
|
export CC_FOR_TARGET="${CC}"
|
|
|
|
export GCC_FOR_TARGET="${CC}"
|
|
|
|
export CXX_FOR_TARGET="${CXX}"
|
|
|
|
export AS_FOR_TARGET="${HOST_PREFIX}as"
|
|
|
|
export LD_FOR_TARGET="${HOST_PREFIX}ld"
|
|
|
|
export NM_FOR_TARGET="${HOST_PREFIX}nm"
|
|
|
|
export AR_FOR_TARGET="${HOST_PREFIX}ar"
|
2006-12-28 23:22:59 +00:00
|
|
|
export GFORTRAN_FOR_TARGET="gfortran"
|
2005-08-31 10:45:47 +00:00
|
|
|
export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
|
|
|
|
fi
|
|
|
|
export CC_FOR_BUILD="${BUILD_CC}"
|
|
|
|
export CXX_FOR_BUILD="${BUILD_CXX}"
|
|
|
|
export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
|
|
|
|
export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
|
|
|
|
export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
|
|
|
|
export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
|
|
|
|
export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
|
|
|
|
(cd ${S} && gnu-configize) || die "failure running gnu-configize"
|
2009-09-17 00:05:15 +00:00
|
|
|
|
gcc: fix check for target libc ssp support
gcc uses hardcoded path "${with-build-sysroot}/usr/include" to check target
libc ssp support. Based on GLIBC version strings in features.h in that search
path, gcc knows whether target (e)glibc implements stack protector itself.
However this breaks meta-toolchain, which actually has target libc headers
installed under {with-build-sysroot}/opt/... This way features.h is not found
and thus gcc-crosssdk-intermediate thinks that target (e)glibc doesn't support ssp.
Later when building eglibc-nativesdk, undefined reference to "__stack_chk_guard"
occurs which was caused by:
o eglibc do_configure found that gcc-crosssdk-intermediate supports ssp,
and thus enable -fstack-protector for nscd
o eglibc itself supports stack smash proctection for some architectures such
as i386, x86-64, etc. It's expected to use its own method to provide stack
protection, instead of relying on gcc. So eglibc rtld.os doesn't export
__stack_chk_guard to other modules
o then when installing nscd objects, gcc-crosssdk-intermediate sees the
flag "-fstack-protector", while it thought this eglibc doesn't implement
ssp itself, so gcc turns to the alternative to find a valid
__stack_chk_guard exported. eglibc doesn'g export it, while
gcc-crosssdk-intermediate itself disables libssp.
Then the undefined reference happens. If enabling libssp for gcc-crosssdk-
intermediate, it may also work-around this issue. But the ideal fix is still
to replace hard coded path with the actual one where target libc gets installed.
glibc-nativesdk doesn't encounter this issue because it thinks gcc doesn't
support ssp, and thus doesn't enable "-fstack-protector" for nscd. Don't know
the reason yet
This fix [BUGID #366]
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2010-09-29 00:54:33 +00:00
|
|
|
# teach gcc to find correct target includedir when checking libc ssp support
|
|
|
|
sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure.ac
|
|
|
|
sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure
|
|
|
|
|
2009-09-17 00:05:15 +00:00
|
|
|
# splice our idea of where the headers live into gcc's world
|
|
|
|
echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe
|
|
|
|
sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new
|
|
|
|
mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in
|
|
|
|
cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new
|
|
|
|
echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#endif" >> ${S}/gcc/defaults.h.new
|
2010-07-15 09:19:12 +00:00
|
|
|
echo "#ifndef STANDARD_STARTFILE_PREFIX_1" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#define STANDARD_STARTFILE_PREFIX_1 \"${SYSTEMLIBS}\"" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#endif" >> ${S}/gcc/defaults.h.new
|
2009-09-17 00:05:15 +00:00
|
|
|
echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#endif" >> ${S}/gcc/defaults.h.new
|
|
|
|
echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new
|
|
|
|
mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h
|
2005-08-31 10:45:47 +00:00
|
|
|
oe_runconf
|
|
|
|
}
|
2008-03-18 10:41:39 +00:00
|
|
|
|