2008-03-18 10:41:39 +00:00
|
|
|
DESCRIPTION = "The GNU cc and gcc C compilers."
|
|
|
|
HOMEPAGE = "http://www.gnu.org/software/gcc/"
|
|
|
|
SECTION = "devel"
|
|
|
|
LICENSE = "GPL"
|
|
|
|
|
2010-03-31 11:09:14 +00:00
|
|
|
NATIVEDEPS = ""
|
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
inherit autotools gettext
|
|
|
|
|
|
|
|
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
|
|
|
|
|
|
|
|
def get_gcc_fpu_setting(bb, d):
|
|
|
|
if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
|
|
|
|
return "--with-float=soft"
|
2011-07-19 17:41:32 +00:00
|
|
|
if bb.data.getVar('TARGET_FPU', d, 1) in [ 'ppc-efd' ]:
|
|
|
|
return "--enable-e500_double"
|
2008-03-18 10:41:39 +00:00
|
|
|
return ""
|
|
|
|
|
2010-07-30 21:05:16 +00:00
|
|
|
def get_gcc_mips_plt_setting(bb, d):
|
|
|
|
if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'mips', 'mipsel' ] and 'mplt' in bb.data.getVar('DISTRO_FEATURES',d,1).split() :
|
|
|
|
return "--with-mips-plt"
|
|
|
|
return ""
|
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
# We really need HOST_SYS here for some packages and TARGET_SYS for others.
|
|
|
|
# For now, libgcc is most important so we fix for that - RP.
|
2008-07-18 08:55:57 +00:00
|
|
|
SHLIBSDIR = "${STAGING_DIR_TARGET}/shlibs"
|
2008-03-18 10:41:39 +00:00
|
|
|
|
|
|
|
DEBIANNAME_libgcc = "libgcc1"
|
|
|
|
|
2011-02-11 12:04:12 +00:00
|
|
|
MIRRORS =+ "\
|
|
|
|
${GNU_MIRROR}/gcc/releases/ ftp://gcc.gnu.org/pub/gcc/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc/ http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc/releases/ http://gcc.get-software.com/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc/ http://gcc.get-software.com/releases/ \n \
|
|
|
|
"
|
2008-03-18 10:41:39 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Set some default values
|
|
|
|
#
|
|
|
|
gcclibdir = "${libdir}/gcc"
|
|
|
|
BINV = "${PV}"
|
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
|
|
|
#S = "${WORKDIR}/gcc-${PV}"
|
|
|
|
S = "${TMPDIR}/work-shared/gcc-${PV}/gcc-${PV}"
|
|
|
|
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
|
|
|
|
|
|
|
|
# SS means Shared Stamps directory
|
|
|
|
SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}"
|
|
|
|
do_fetch[stamp-base] = "${SS}"
|
|
|
|
do_unpack[stamp-base] = "${SS}"
|
|
|
|
do_patch[stamp-base] = "${SS}"
|
|
|
|
|
|
|
|
# SW means Shared Work directory
|
|
|
|
SW = "${TMPDIR}/work-shared/gcc-${PV}"
|
|
|
|
WORKDIR_task-unpack = "${SW}"
|
|
|
|
WORKDIR_task-patch = "${SW}"
|
2008-03-18 10:41:39 +00:00
|
|
|
|
2010-01-28 21:46:51 +00:00
|
|
|
target_includedir ?= "${includedir}"
|
|
|
|
target_libdir ?= "${libdir}"
|
|
|
|
target_base_libdir ?= "${base_libdir}"
|
|
|
|
target_prefix ?= "${prefix}"
|
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
|
|
|
|
|
|
|
CLEANFUNCS += "workshared_clean"
|
|
|
|
# The do_clean should be exclusive since share ${S}
|
|
|
|
do_clean[lockfiles] = "${TMPDIR}/stamps/work-shared/gcc-${PV}.clean.lock"
|
|
|
|
|
|
|
|
python workshared_clean () {
|
|
|
|
"""clear the source directory"""
|
|
|
|
dir = bb.data.expand("${SW}", d)
|
|
|
|
bb.note("Removing " + dir)
|
|
|
|
oe.path.remove(dir)
|
|
|
|
|
|
|
|
"""clear the the stamps in work-shared"""
|
|
|
|
dir = "%s.*" % bb.data.expand(d.getVarFlag('do_fetch', 'stamp-base', True), d)
|
|
|
|
bb.note("Removing " + dir)
|
|
|
|
oe.path.remove(dir)
|
|
|
|
}
|