diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-common.inc | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-common.inc b/meta-microblaze/recipes-devtools/gcc/gcc-common.inc new file mode 100644 index 00000000..5ac82b1b --- /dev/null +++ b/meta-microblaze/recipes-devtools/gcc/gcc-common.inc | |||
@@ -0,0 +1,118 @@ | |||
1 | SUMMARY = "GNU cc and gcc C compilers" | ||
2 | HOMEPAGE = "http://www.gnu.org/software/gcc/" | ||
3 | DESCRIPTION = "The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system." | ||
4 | SECTION = "devel" | ||
5 | LICENSE = "GPL" | ||
6 | |||
7 | NATIVEDEPS = "" | ||
8 | |||
9 | CVE_PRODUCT = "gcc" | ||
10 | |||
11 | inherit autotools gettext texinfo | ||
12 | |||
13 | BPN = "gcc" | ||
14 | COMPILERDEP = "virtual/${TARGET_PREFIX}gcc:do_gcc_stash_builddir" | ||
15 | |||
16 | python extract_stashed_builddir () { | ||
17 | src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}") | ||
18 | dest = d.getVar("B") | ||
19 | oe.path.copyhardlinktree(src, dest) | ||
20 | staging_processfixme([src + "/fixmepath"], dest, d.getVar("RECIPE_SYSROOT"), d.getVar("RECIPE_SYSROOT_NATIVE"), d) | ||
21 | } | ||
22 | |||
23 | def get_gcc_float_setting(bb, d): | ||
24 | if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm": | ||
25 | return "--with-float=hard" | ||
26 | if d.getVar('TARGET_FPU') in [ 'soft' ]: | ||
27 | return "--with-float=soft" | ||
28 | if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]: | ||
29 | return "--enable-e500_double" | ||
30 | return "" | ||
31 | |||
32 | get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" | ||
33 | |||
34 | def get_gcc_x86_64_arch_setting(bb, d): | ||
35 | import re | ||
36 | march = re.match(r'^.*-march=([^\s]*)', d.getVar('TUNE_CCARGS')) | ||
37 | if march: | ||
38 | return "--with-arch=%s " % march.group(1) | ||
39 | # The earliest supported x86-64 CPU | ||
40 | return "--with-arch=core2" | ||
41 | |||
42 | get_gcc_x86_64_arch_setting[vardepvalue] = "${@get_gcc_x86_64_arch_setting(bb, d)}" | ||
43 | |||
44 | def get_gcc_mips_plt_setting(bb, d): | ||
45 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): | ||
46 | return "--with-mips-plt" | ||
47 | return "" | ||
48 | |||
49 | def get_gcc_ppc_plt_settings(bb, d): | ||
50 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): | ||
51 | return "--enable-secureplt" | ||
52 | return "" | ||
53 | |||
54 | def get_gcc_multiarch_setting(bb, d): | ||
55 | target_arch = d.getVar('TRANSLATED_TARGET_ARCH') | ||
56 | multiarch_options = { | ||
57 | "i586": "--enable-targets=all", | ||
58 | "i686": "--enable-targets=all", | ||
59 | "powerpc": "--enable-targets=powerpc64", | ||
60 | "powerpc64le": "--enable-targets=powerpcle", | ||
61 | "mips": "--enable-targets=all", | ||
62 | "sparc": "--enable-targets=all", | ||
63 | } | ||
64 | |||
65 | if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): | ||
66 | if target_arch in multiarch_options : | ||
67 | return multiarch_options[target_arch] | ||
68 | return "" | ||
69 | |||
70 | # this is used by the multilib setup of gcc | ||
71 | def get_tune_parameters(tune, d): | ||
72 | availtunes = d.getVar('AVAILTUNES') | ||
73 | if tune not in availtunes.split(): | ||
74 | bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes)) | ||
75 | |||
76 | localdata = bb.data.createCopy(d) | ||
77 | override = ':tune-' + tune | ||
78 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) | ||
79 | |||
80 | retdict = {} | ||
81 | retdict['tune'] = tune | ||
82 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS') | ||
83 | retdict['features'] = localdata.getVar('TUNE_FEATURES') | ||
84 | # BASELIB is used by the multilib code to change library paths | ||
85 | retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB') | ||
86 | retdict['arch'] = localdata.getVar('TUNE_ARCH') | ||
87 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION') | ||
88 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU') | ||
89 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH') | ||
90 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS') | ||
91 | return retdict | ||
92 | |||
93 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" | ||
94 | |||
95 | DEBIANNAME:${MLPREFIX}libgcc = "libgcc1" | ||
96 | |||
97 | MIRRORS =+ "\ | ||
98 | ${GNU_MIRROR}/gcc https://gcc.gnu.org/pub/gcc/releases/ \ | ||
99 | " | ||
100 | # | ||
101 | # Set some default values | ||
102 | # | ||
103 | gcclibdir = "${libdir}/gcc" | ||
104 | BINV = "${PV}" | ||
105 | #S = "${WORKDIR}/gcc-${PV}" | ||
106 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
107 | |||
108 | B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | ||
109 | |||
110 | target_includedir ?= "${includedir}" | ||
111 | target_libdir ?= "${libdir}" | ||
112 | target_base_libdir ?= "${base_libdir}" | ||
113 | target_prefix ?= "${prefix}" | ||
114 | |||
115 | # We need to ensure that for the shared work directory, the do_patch signatures match | ||
116 | # The real WORKDIR location isn't a dependency for the shared workdir. | ||
117 | src_patches[vardepsexclude] = "WORKDIR" | ||
118 | should_apply[vardepsexclude] += "PN" | ||