2013-12-19 15:13:01 +00:00
|
|
|
SUMMARY = "GNU cc and gcc C compilers"
|
2008-03-18 10:41:39 +00:00
|
|
|
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
|
|
|
|
|
2014-04-27 00:23:07 +00:00
|
|
|
BPN = "gcc"
|
|
|
|
|
2008-03-18 10:41:39 +00:00
|
|
|
def get_gcc_fpu_setting(bb, d):
|
2012-07-04 03:21:07 +00:00
|
|
|
if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
|
2012-05-01 05:00:17 +00:00
|
|
|
return "--with-float=hard"
|
2012-03-03 10:59:25 +00:00
|
|
|
if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
|
2008-03-18 10:41:39 +00:00
|
|
|
return "--with-float=soft"
|
2012-03-03 10:59:25 +00:00
|
|
|
if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]:
|
2011-07-19 17:41:32 +00:00
|
|
|
return "--enable-e500_double"
|
2008-03-18 10:41:39 +00:00
|
|
|
return ""
|
|
|
|
|
2013-10-02 13:06:19 +00:00
|
|
|
get_gcc_fpu_setting[vardepvalue] = "${@get_gcc_fpu_setting(bb, d)}"
|
|
|
|
|
2010-07-30 21:05:16 +00:00
|
|
|
def get_gcc_mips_plt_setting(bb, d):
|
2014-04-24 18:59:19 +00:00
|
|
|
if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
|
2010-07-30 21:05:16 +00:00
|
|
|
return "--with-mips-plt"
|
|
|
|
return ""
|
|
|
|
|
2011-11-16 01:01:59 +00:00
|
|
|
def get_gcc_multiarch_setting(bb, d):
|
2012-06-09 22:19:24 +00:00
|
|
|
target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
|
2011-12-01 00:01:56 +00:00
|
|
|
multiarch_options = {
|
|
|
|
"i586": "--enable-targets=all",
|
|
|
|
"powerpc": "--enable-targets=powerpc64",
|
2013-11-11 04:43:51 +00:00
|
|
|
"mips": "--enable-targets=all",
|
2011-12-01 00:01:56 +00:00
|
|
|
"sparc": "--enable-targets=all",
|
|
|
|
}
|
|
|
|
|
2014-04-24 18:59:19 +00:00
|
|
|
if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
|
2011-12-01 00:01:56 +00:00
|
|
|
if target_arch in multiarch_options :
|
|
|
|
return multiarch_options[target_arch]
|
2011-11-16 01:01:59 +00:00
|
|
|
return ""
|
|
|
|
|
gcc: enable multilib for target gcc
- add a task to setup multilib configuration for target gcc
- this commit adapts Nitin Kamble's work to gcc 4.7
- use a hash for storing arch-dependent multilib options
- patch gcc in order to use the multilib config files from the
build directory
Tests:
root@qemux86-64:~# gcc -m64 t.c -o t
root@qemux86-64:~# file t
t: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !
root@qemux86-64:~# gcc -m32 t.c -o t
root@qemux86-64:~# file t
t: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !
[YOCTO #1369]
(From OE-Core rev: b26819c85881e82ee1b5c68840011e78c321f18e)
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 11:46:20 +00:00
|
|
|
# this is used by the multilib setup of gcc
|
|
|
|
def get_tune_parameters(tune, d):
|
|
|
|
availtunes = d.getVar('AVAILTUNES', True)
|
|
|
|
if tune not in availtunes.split():
|
2013-02-26 21:58:42 +00:00
|
|
|
bb.error('The tune: %s is not one of the available tunes: %s', tune or None, availtunes)
|
gcc: enable multilib for target gcc
- add a task to setup multilib configuration for target gcc
- this commit adapts Nitin Kamble's work to gcc 4.7
- use a hash for storing arch-dependent multilib options
- patch gcc in order to use the multilib config files from the
build directory
Tests:
root@qemux86-64:~# gcc -m64 t.c -o t
root@qemux86-64:~# file t
t: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !
root@qemux86-64:~# gcc -m32 t.c -o t
root@qemux86-64:~# file t
t: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
root@qemux86-64:~# ./t
Hello World !
[YOCTO #1369]
(From OE-Core rev: b26819c85881e82ee1b5c68840011e78c321f18e)
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 11:46:20 +00:00
|
|
|
|
|
|
|
localdata = bb.data.createCopy(d)
|
|
|
|
override = ':tune-' + tune
|
|
|
|
localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
|
|
|
|
bb.data.update_data(localdata)
|
|
|
|
|
|
|
|
retdict = {}
|
|
|
|
retdict['tune'] = tune
|
|
|
|
retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
|
|
|
|
retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
|
|
|
|
# BASELIB is used by the multilib code to change library paths
|
|
|
|
retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
|
|
|
|
retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
|
|
|
|
retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
|
|
|
|
retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
|
|
|
|
retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
|
|
|
|
retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
|
|
|
|
return retdict
|
|
|
|
|
2013-03-18 00:01:22 +00:00
|
|
|
get_tune_parameters[vardepsexclude] = "AVAILTUNES"
|
|
|
|
|
2012-09-24 22:24:42 +00:00
|
|
|
DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
|
2008-03-18 10:41:39 +00:00
|
|
|
|
2011-02-11 12:04:12 +00:00
|
|
|
MIRRORS =+ "\
|
2012-09-20 20:54:35 +00:00
|
|
|
${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
|
|
|
|
${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
|
|
|
|
${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
|
2011-02-11 12:04:12 +00:00
|
|
|
"
|
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}"
|
2011-08-21 09:52:55 +00:00
|
|
|
S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${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
|
|
|
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
|
|
|
|
|
|
|
|
# SS means Shared Stamps directory
|
2011-08-09 17:51:44 +00:00
|
|
|
SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}"
|
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
|
|
|
do_fetch[stamp-base] = "${SS}"
|
|
|
|
do_unpack[stamp-base] = "${SS}"
|
|
|
|
do_patch[stamp-base] = "${SS}"
|
2012-09-21 13:18:05 +00:00
|
|
|
SSCLEAN = "${TMPDIR}/stamps/work-shared/gcc-[0-9]*-*"
|
2012-09-17 10:04:27 +00:00
|
|
|
do_fetch[stamp-base-clean] = "${SSCLEAN}"
|
|
|
|
do_unpack[stamp-base-clean] = "${SSCLEAN}"
|
2013-11-29 11:22:56 +00:00
|
|
|
do_unpack[umask] = "022"
|
2012-09-17 10:04:27 +00:00
|
|
|
do_patch[stamp-base-clean] = "${SSCLEAN}"
|
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
|
|
|
|
|
|
|
# SW means Shared Work directory
|
2011-08-09 17:51:44 +00:00
|
|
|
SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
|
2013-12-20 12:06:02 +00:00
|
|
|
SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
|
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
|
|
|
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}
|
2011-08-09 17:51:44 +00:00
|
|
|
do_clean[lockfiles] = "${SW}.clean.lock"
|
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
|
|
|
|
|
|
|
python workshared_clean () {
|
|
|
|
"""clear the source directory"""
|
2012-03-03 11:21:22 +00:00
|
|
|
dir = d.expand("${SW}")
|
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
|
|
|
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)
|
|
|
|
}
|
2012-01-19 19:22:44 +00:00
|
|
|
|
2012-01-24 12:14:19 +00:00
|
|
|
# We need to ensure that for the shared work directory, the do_patch singatures match
|
2012-01-24 14:38:31 +00:00
|
|
|
# The real WORKDIR location isn't a dependency for the shared workdir.
|
2012-01-24 12:14:19 +00:00
|
|
|
src_patches[vardepsexclude] = "WORKDIR"
|
2012-02-14 02:57:52 +00:00
|
|
|
should_apply[vardepsexclude] += "PN"
|