diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2021-12-01 12:49:46 -0800 |
---|---|---|
committer | Mark Hatle <mark.hatle@xilinx.com> | 2022-01-14 11:21:32 -0800 |
commit | 454ca5b55f82bcc10ec63dc1b6726c5007769843 (patch) | |
tree | 89017b4b892a62182cfbae86a0c9ab2a3b8dfee8 /meta-microblaze/recipes-devtools | |
parent | 945ff460fdc5b68b67e0edd11e91976feb0fb4b6 (diff) | |
download | meta-xilinx-454ca5b55f82bcc10ec63dc1b6726c5007769843.tar.gz |
Revert "gcc: Import gatesgarth version, converted to new variable syntax"
This reverts commit 2c819946b5258291d1725dabb3f5180d36971bd6.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-microblaze/recipes-devtools')
69 files changed, 0 insertions, 7082 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-10.2.inc b/meta-microblaze/recipes-devtools/gcc/gcc-10.2.inc deleted file mode 100644 index 6fdcd07d..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-10.2.inc +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | require gcc-common.inc | ||
2 | |||
3 | # Third digit in PV should be incremented after a minor release | ||
4 | |||
5 | PV = "10.2.0" | ||
6 | |||
7 | # BINV should be incremented to a revision after a minor gcc release | ||
8 | |||
9 | BINV = "10.2.0" | ||
10 | |||
11 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:" | ||
12 | |||
13 | DEPENDS =+ "mpfr gmp libmpc zlib flex-native" | ||
14 | NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native" | ||
15 | |||
16 | LICENSE = "GPL-3.0-with-GCC-exception & GPLv3" | ||
17 | |||
18 | LIC_FILES_CHKSUM = "\ | ||
19 | file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | ||
20 | file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ | ||
21 | file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ | ||
22 | file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \ | ||
23 | file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \ | ||
24 | " | ||
25 | |||
26 | BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz" | ||
27 | #RELEASE ?= "93a49d2d2292893b9b7f38132df949c70942838c" | ||
28 | #BASEURI ?= "https://github.com/gcc-mirror/gcc/archive/${RELEASE}.zip;downloadfilename=gcc-${PV}-${RELEASE}.zip" | ||
29 | SRC_URI = "\ | ||
30 | ${BASEURI} \ | ||
31 | file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ | ||
32 | file://0002-gcc-poison-system-directories.patch \ | ||
33 | file://0003-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \ | ||
34 | file://0004-64-bit-multilib-hack.patch \ | ||
35 | file://0005-optional-libstdc.patch \ | ||
36 | file://0006-COLLECT_GCC_OPTIONS.patch \ | ||
37 | file://0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \ | ||
38 | file://0008-fortran-cross-compile-hack.patch \ | ||
39 | file://0009-cpp-honor-sysroot.patch \ | ||
40 | file://0010-MIPS64-Default-to-N64-ABI.patch \ | ||
41 | file://0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \ | ||
42 | file://0012-gcc-Fix-argument-list-too-long-error.patch \ | ||
43 | file://0013-Disable-sdt.patch \ | ||
44 | file://0014-libtool.patch \ | ||
45 | file://0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \ | ||
46 | file://0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch \ | ||
47 | file://0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \ | ||
48 | file://0018-export-CPP.patch \ | ||
49 | file://0019-Ensure-target-gcc-headers-can-be-included.patch \ | ||
50 | file://0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch \ | ||
51 | file://0021-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \ | ||
52 | file://0022-aarch64-Add-support-for-musl-ldso.patch \ | ||
53 | file://0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch \ | ||
54 | file://0024-handle-sysroot-support-for-nativesdk-gcc.patch \ | ||
55 | file://0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ | ||
56 | file://0026-Fix-various-_FOR_BUILD-and-related-variables.patch \ | ||
57 | file://0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ | ||
58 | file://0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \ | ||
59 | file://0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ | ||
60 | file://0030-sync-gcc-stddef.h-with-musl.patch \ | ||
61 | file://0031-fix-segmentation-fault-in-precompiled-header-generat.patch \ | ||
62 | file://0032-Fix-for-testsuite-failure.patch \ | ||
63 | file://0033-Re-introduce-spe-commandline-options.patch \ | ||
64 | file://0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \ | ||
65 | file://0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ | ||
66 | file://0036-mingw32-Enable-operation_not_supported.patch \ | ||
67 | file://0037-libatomic-Do-not-enforce-march-on-aarch64.patch \ | ||
68 | file://0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch \ | ||
69 | file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \ | ||
70 | file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \ | ||
71 | file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch \ | ||
72 | file://0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch \ | ||
73 | " | ||
74 | SRC_URI[sha256sum] = "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c" | ||
75 | |||
76 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
77 | # For dev release snapshotting | ||
78 | #S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${RELEASE}" | ||
79 | #B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | ||
80 | |||
81 | # Language Overrides | ||
82 | FORTRAN = "" | ||
83 | JAVA = "" | ||
84 | |||
85 | LTO = "--enable-lto" | ||
86 | SSP ?= "--disable-libssp" | ||
87 | SSP:mingw32 = "--enable-libssp" | ||
88 | |||
89 | EXTRA_OECONF_BASE = "\ | ||
90 | ${LTO} \ | ||
91 | ${SSP} \ | ||
92 | --enable-libitm \ | ||
93 | --disable-bootstrap \ | ||
94 | --with-system-zlib \ | ||
95 | ${@'--with-linker-hash-style=${LINKER_HASH_STYLE}' if '${LINKER_HASH_STYLE}' else ''} \ | ||
96 | --enable-linker-build-id \ | ||
97 | --with-ppl=no \ | ||
98 | --with-cloog=no \ | ||
99 | --enable-checking=release \ | ||
100 | --enable-cheaders=c_global \ | ||
101 | --without-isl \ | ||
102 | " | ||
103 | |||
104 | EXTRA_OECONF_INITIAL = "\ | ||
105 | --disable-libgomp \ | ||
106 | --disable-libitm \ | ||
107 | --disable-libquadmath \ | ||
108 | --with-system-zlib \ | ||
109 | --disable-lto \ | ||
110 | --disable-plugin \ | ||
111 | --enable-linker-build-id \ | ||
112 | --enable-decimal-float=no \ | ||
113 | --without-isl \ | ||
114 | --disable-libssp \ | ||
115 | " | ||
116 | |||
117 | EXTRA_OECONF_PATHS = "\ | ||
118 | --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \ | ||
119 | --with-sysroot=/not/exist \ | ||
120 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
121 | " | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-common.inc b/meta-microblaze/recipes-devtools/gcc/gcc-common.inc deleted file mode 100644 index 45259a5b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-common.inc +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | SUMMARY = "GNU cc and gcc C compilers" | ||
2 | HOMEPAGE = "http://www.gnu.org/software/gcc/" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPL" | ||
5 | |||
6 | NATIVEDEPS = "" | ||
7 | |||
8 | CVE_PRODUCT = "gcc" | ||
9 | |||
10 | inherit autotools gettext texinfo | ||
11 | |||
12 | BPN = "gcc" | ||
13 | COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir" | ||
14 | COMPILERDEP:class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk: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_mips_plt_setting(bb, d): | ||
35 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): | ||
36 | return "--with-mips-plt" | ||
37 | return "" | ||
38 | |||
39 | def get_gcc_ppc_plt_settings(bb, d): | ||
40 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): | ||
41 | return "--enable-secureplt" | ||
42 | return "" | ||
43 | |||
44 | def get_gcc_multiarch_setting(bb, d): | ||
45 | target_arch = d.getVar('TRANSLATED_TARGET_ARCH') | ||
46 | multiarch_options = { | ||
47 | "i586": "--enable-targets=all", | ||
48 | "i686": "--enable-targets=all", | ||
49 | "powerpc": "--enable-targets=powerpc64", | ||
50 | "powerpc64le": "--enable-targets=powerpcle", | ||
51 | "mips": "--enable-targets=all", | ||
52 | "sparc": "--enable-targets=all", | ||
53 | } | ||
54 | |||
55 | if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): | ||
56 | if target_arch in multiarch_options : | ||
57 | return multiarch_options[target_arch] | ||
58 | return "" | ||
59 | |||
60 | # this is used by the multilib setup of gcc | ||
61 | def get_tune_parameters(tune, d): | ||
62 | availtunes = d.getVar('AVAILTUNES') | ||
63 | if tune not in availtunes.split(): | ||
64 | bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes)) | ||
65 | |||
66 | localdata = bb.data.createCopy(d) | ||
67 | override = ':tune-' + tune | ||
68 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) | ||
69 | |||
70 | retdict = {} | ||
71 | retdict['tune'] = tune | ||
72 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS') | ||
73 | retdict['features'] = localdata.getVar('TUNE_FEATURES') | ||
74 | # BASELIB is used by the multilib code to change library paths | ||
75 | retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB') | ||
76 | retdict['arch'] = localdata.getVar('TUNE_ARCH') | ||
77 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION') | ||
78 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU') | ||
79 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH') | ||
80 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS') | ||
81 | return retdict | ||
82 | |||
83 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" | ||
84 | |||
85 | DEBIANNAME:${MLPREFIX}libgcc = "libgcc1" | ||
86 | |||
87 | MIRRORS =+ "\ | ||
88 | ${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \ | ||
89 | ${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \ | ||
90 | ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \ | ||
91 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
92 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
93 | " | ||
94 | # | ||
95 | # Set some default values | ||
96 | # | ||
97 | gcclibdir = "${libdir}/gcc" | ||
98 | BINV = "${PV}" | ||
99 | #S = "${WORKDIR}/gcc-${PV}" | ||
100 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
101 | |||
102 | B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | ||
103 | |||
104 | target_includedir ?= "${includedir}" | ||
105 | target_libdir ?= "${libdir}" | ||
106 | target_base_libdir ?= "${base_libdir}" | ||
107 | target_prefix ?= "${prefix}" | ||
108 | |||
109 | # We need to ensure that for the shared work directory, the do_patch signatures match | ||
110 | # The real WORKDIR location isn't a dependency for the shared workdir. | ||
111 | src_patches[vardepsexclude] = "WORKDIR" | ||
112 | should_apply[vardepsexclude] += "PN" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-configure-common.inc b/meta-microblaze/recipes-devtools/gcc/gcc-configure-common.inc deleted file mode 100644 index dba25eb7..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-configure-common.inc +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | require gcc-multilib-config.inc | ||
2 | require gcc-shared-source.inc | ||
3 | # | ||
4 | # Build the list of lanaguages to build. | ||
5 | # | ||
6 | # These can be overridden by the version specific .inc file. | ||
7 | |||
8 | # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran' | ||
9 | FORTRAN ?= ",f77" | ||
10 | LANGUAGES ?= "c,c++${FORTRAN}" | ||
11 | |||
12 | EXTRA_OECONF_BASE ?= "" | ||
13 | EXTRA_OECONF_PATHS ?= "" | ||
14 | |||
15 | GCCMULTILIB ?= "--disable-multilib" | ||
16 | GCCTHREADS ?= "posix" | ||
17 | |||
18 | GCCPIE ??= "" | ||
19 | |||
20 | SYMVERS_CONF ?= "--enable-symvers=gnu" | ||
21 | |||
22 | EXTRA_OECONF = "\ | ||
23 | ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \ | ||
24 | --with-gnu-ld \ | ||
25 | --enable-shared \ | ||
26 | --enable-languages=${LANGUAGES} \ | ||
27 | --enable-threads=${GCCTHREADS} \ | ||
28 | ${GCCMULTILIB} \ | ||
29 | ${GCCPIE} \ | ||
30 | --enable-c99 \ | ||
31 | --enable-long-long \ | ||
32 | ${SYMVERS_CONF} \ | ||
33 | --enable-libstdcxx-pch \ | ||
34 | --program-prefix=${TARGET_PREFIX} \ | ||
35 | --without-local-prefix \ | ||
36 | --disable-install-libiberty \ | ||
37 | ${EXTRA_OECONF_BASE} \ | ||
38 | ${EXTRA_OECONF_GCC_FLOAT} \ | ||
39 | ${EXTRA_OECONF_PATHS} \ | ||
40 | ${@get_gcc_mips_plt_setting(bb, d)} \ | ||
41 | ${@get_gcc_ppc_plt_settings(bb, d)} \ | ||
42 | ${@get_gcc_multiarch_setting(bb, d)} \ | ||
43 | " | ||
44 | |||
45 | # glibc version is a minimum controlling whether features are enabled. | ||
46 | # Doesn't need to track glibc exactly | ||
47 | EXTRA_OECONF:append:libc-glibc = " --with-glibc-version=2.28 " | ||
48 | |||
49 | # Set this here since GCC configure won't auto-detect and enable | ||
50 | # initfini-arry when cross compiling. | ||
51 | EXTRA_OECONF:append = " --enable-initfini-array" | ||
52 | |||
53 | export gcc_cv_collect2_libs = 'none required' | ||
54 | # We need to set gcc_cv_collect2_libs else there is cross-compilation badness | ||
55 | # in the config.log files (which might not get generated until do_compile | ||
56 | # hence being missed by the insane do_configure check). | ||
57 | |||
58 | EXTRA_OECONF:append:linux = " --enable-__cxa_atexit" | ||
59 | |||
60 | EXTRA_OECONF:append:mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
61 | EXTRA_OECONF:append:mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
62 | EXTRA_OECONF:append:mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
63 | EXTRA_OECONF:append:mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
64 | EXTRA_OECONF:append:mipsisa32r6el = " --with-abi=32 --with-arch=mips32r6" | ||
65 | EXTRA_OECONF:append:mipsisa32r6 = " --with-abi=32 --with-arch=mips32r6" | ||
66 | EXTRA_OECONF:append:mipsisa64r6el = " --with-abi=64 --with-arch-64=mips64r6" | ||
67 | EXTRA_OECONF:append:mipsisa64r6 = " --with-abi=64 --with-arch-64=mips64r6" | ||
68 | |||
69 | EXTRA_OECONF_GCC_FLOAT ??= "" | ||
70 | CPPFLAGS = "" | ||
71 | |||
72 | SYSTEMHEADERS = "${target_includedir}" | ||
73 | SYSTEMLIBS = "${target_base_libdir}/" | ||
74 | SYSTEMLIBS1 = "${target_libdir}/" | ||
75 | |||
76 | do_configure:prepend () { | ||
77 | # teach gcc to find correct target includedir when checking libc ssp support | ||
78 | mkdir -p ${B}/gcc | ||
79 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe | ||
80 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new | ||
81 | cat >>${B}/gcc/defaults.h.new <<_EOF | ||
82 | #define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}" | ||
83 | #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" | ||
84 | #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" | ||
85 | #define SYSTEMLIBS_DIR "${SYSTEMLIBS}" | ||
86 | #endif /* ! GCC_DEFAULTS_H */ | ||
87 | _EOF | ||
88 | mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h | ||
89 | } | ||
90 | |||
91 | do_configure () { | ||
92 | # Setup these vars for cross building only | ||
93 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | ||
94 | # gcc build stuff when the build is producing a cross compiler - i.e. | ||
95 | # when the 'current' target is the 'host' system, and the host is not | ||
96 | # the target (because the build is actually making a cross compiler!) | ||
97 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then | ||
98 | export CC_FOR_TARGET="${CC}" | ||
99 | export GCC_FOR_TARGET="${CC}" | ||
100 | export CXX_FOR_TARGET="${CXX}" | ||
101 | export AS_FOR_TARGET="${HOST_PREFIX}as" | ||
102 | export LD_FOR_TARGET="${HOST_PREFIX}ld" | ||
103 | export NM_FOR_TARGET="${HOST_PREFIX}nm" | ||
104 | export AR_FOR_TARGET="${HOST_PREFIX}ar" | ||
105 | export GFORTRAN_FOR_TARGET="gfortran" | ||
106 | export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib" | ||
107 | fi | ||
108 | export CC_FOR_BUILD="${BUILD_CC}" | ||
109 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
110 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
111 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
112 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
113 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
114 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
115 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
116 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
117 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
118 | |||
119 | |||
120 | oe_runconf | ||
121 | } | ||
122 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian.inc deleted file mode 100644 index 12310335..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian.inc +++ /dev/null | |||
@@ -1,181 +0,0 @@ | |||
1 | inherit cross-canadian | ||
2 | |||
3 | SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)" | ||
4 | PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
5 | |||
6 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc" | ||
7 | |||
8 | GCCMULTILIB = "--enable-multilib" | ||
9 | |||
10 | require gcc-configure-common.inc | ||
11 | |||
12 | EXTRA_OECONF_PATHS = "\ | ||
13 | --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ | ||
14 | --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ | ||
15 | --with-sysroot=/not/exist \ | ||
16 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
17 | " | ||
18 | # We have to point gcc at a sysroot but we don't need to rebuild if this changes | ||
19 | # e.g. we switch between different machines with different tunes. | ||
20 | EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH" | ||
21 | TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" | ||
22 | get_gcc_float_setting[vardepvalue] = "" | ||
23 | |||
24 | # | ||
25 | # gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky | ||
26 | # for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse. | ||
27 | # | ||
28 | export AR_FOR_TARGET = "${TARGET_PREFIX}ar" | ||
29 | export AS_FOR_TARGET = "${TARGET_PREFIX}as" | ||
30 | export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool" | ||
31 | export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" | ||
32 | export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" | ||
33 | export GCC_FOR_TARGET = "${TARGET_PREFIX}gcc" | ||
34 | export LD_FOR_TARGET = "${TARGET_PREFIX}ld" | ||
35 | export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo" | ||
36 | export NM_FOR_TARGET = "${TARGET_PREFIX}nm" | ||
37 | export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump" | ||
38 | export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" | ||
39 | export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip" | ||
40 | export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" | ||
41 | |||
42 | # | ||
43 | # We need to override this and make sure the compiler can find staging | ||
44 | # | ||
45 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" | ||
46 | |||
47 | do_configure () { | ||
48 | export CC_FOR_BUILD="${BUILD_CC}" | ||
49 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
50 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
51 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
52 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
53 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
54 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
55 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
56 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
57 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
58 | oe_runconf | ||
59 | } | ||
60 | |||
61 | do_compile () { | ||
62 | oe_runmake all-host configure-target-libgcc | ||
63 | (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) | ||
64 | } | ||
65 | |||
66 | PACKAGES = "${PN}-dbg ${PN} ${PN}-doc" | ||
67 | |||
68 | FILES:${PN} = "\ | ||
69 | ${exec_prefix}/bin/* \ | ||
70 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \ | ||
71 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
72 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
73 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \ | ||
74 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
75 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
76 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \ | ||
77 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \ | ||
78 | ${includedir}/c++/${BINV} \ | ||
79 | ${prefix}/${TARGET_SYS}/bin/* \ | ||
80 | ${prefix}/${TARGET_SYS}/lib/* \ | ||
81 | ${prefix}/${TARGET_SYS}${target_includedir}/* \ | ||
82 | " | ||
83 | INSANE_SKIP:${PN} += "dev-so" | ||
84 | |||
85 | FILES:${PN}-doc = "\ | ||
86 | ${infodir} \ | ||
87 | ${mandir} \ | ||
88 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
89 | " | ||
90 | |||
91 | EXEEXT = "" | ||
92 | |||
93 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
94 | BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" | ||
95 | |||
96 | do_install () { | ||
97 | ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h ) | ||
98 | oe_runmake 'DESTDIR=${D}' install-host | ||
99 | |||
100 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
101 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
102 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
103 | rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
104 | |||
105 | # We care about g++ not c++ | ||
106 | rm -f ${D}${bindir}/*c++ | ||
107 | |||
108 | # We don't care about the gcc-<version> copies | ||
109 | rm -f ${D}${bindir}/*gcc-${BINV}* | ||
110 | |||
111 | # Cleanup empty directories which are not shipped | ||
112 | # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted | ||
113 | # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686 | ||
114 | local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}" | ||
115 | for i in $empty_dirs; do | ||
116 | [ -d $i ] && rmdir --ignore-fail-on-non-empty $i | ||
117 | done | ||
118 | |||
119 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
120 | # found. | ||
121 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
122 | install -d $dest | ||
123 | suffix=${EXEEXT} | ||
124 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
125 | if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then | ||
126 | continue | ||
127 | fi | ||
128 | |||
129 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix | ||
130 | done | ||
131 | t=real-ld | ||
132 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld$suffix $dest$t$suffix | ||
133 | |||
134 | # libquadmath headers need to be available in the gcc libexec dir | ||
135 | install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
136 | cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
137 | cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
138 | |||
139 | chown -R root:root ${D} | ||
140 | |||
141 | cross_canadian_bindirlinks | ||
142 | |||
143 | for i in linux ${CANADIANEXTRAOS} | ||
144 | do | ||
145 | for v in ${CANADIANEXTRAVENDOR} | ||
146 | do | ||
147 | d=${D}${bindir}/../${TARGET_ARCH}$v-$i | ||
148 | install -d $d | ||
149 | for j in ${TARGET_PREFIX}gcc${EXEEXT} ${TARGET_PREFIX}g++${EXEEXT} | ||
150 | do | ||
151 | p=${TARGET_ARCH}$v-$i-`echo $j | sed -e s,${TARGET_PREFIX},,` | ||
152 | case $i in | ||
153 | *musl*) | ||
154 | rm -rf $d/$p | ||
155 | echo "#!/usr/bin/env sh" > $d/$p | ||
156 | echo "exec \`dirname \$0\`/../${TARGET_SYS}/$j -mmusl \$@" >> $d/$p | ||
157 | chmod 0755 $d/$p | ||
158 | ;; | ||
159 | *) | ||
160 | ;; | ||
161 | esac | ||
162 | done | ||
163 | done | ||
164 | done | ||
165 | } | ||
166 | |||
167 | ELFUTILS = "nativesdk-elfutils" | ||
168 | DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" | ||
169 | RDEPENDS:${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" | ||
170 | |||
171 | SYSTEMHEADERS = "${target_includedir}/" | ||
172 | SYSTEMLIBS = "${target_base_libdir}/" | ||
173 | SYSTEMLIBS1 = "${target_libdir}/" | ||
174 | |||
175 | EXTRA_OECONF += "--enable-poison-system-directories" | ||
176 | EXTRA_OECONF:remove:elf = "--with-sysroot=/not/exist" | ||
177 | EXTRA_OECONF:remove:eabi = "--with-sysroot=/not/exist" | ||
178 | EXTRA_OECONF:append:elf = " --without-headers --with-newlib" | ||
179 | EXTRA_OECONF:append:eabi = " --without-headers --with-newlib" | ||
180 | # gcc 4.7 needs -isystem | ||
181 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian_10.2.bb deleted file mode 100644 index bf53c5cd..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-cross-canadian_10.2.bb +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require gcc-cross-canadian.inc | ||
3 | |||
4 | |||
5 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-cross.inc b/meta-microblaze/recipes-devtools/gcc/gcc-cross.inc deleted file mode 100644 index b8424bfc..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-cross.inc +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | inherit cross | ||
2 | |||
3 | INHIBIT_DEFAULT_DEPS = "1" | ||
4 | EXTRADEPENDS = "" | ||
5 | DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS} ${NATIVEDEPS}" | ||
6 | PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | ||
7 | python () { | ||
8 | if d.getVar("TARGET_OS").startswith("linux"): | ||
9 | d.setVar("EXTRADEPENDS", "linux-libc-headers") | ||
10 | } | ||
11 | |||
12 | PN = "gcc-cross-${TARGET_ARCH}" | ||
13 | |||
14 | # Ignore how TARGET_ARCH is computed. | ||
15 | TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}" | ||
16 | |||
17 | require gcc-configure-common.inc | ||
18 | |||
19 | # While we want the 'gnu' hash style, we explicitly set it to sysv here to | ||
20 | # ensure that any recipe which doesn't obey our LDFLAGS (which also set it to | ||
21 | # gnu) will hit a QA failure. | ||
22 | LINKER_HASH_STYLE ?= "sysv" | ||
23 | |||
24 | EXTRA_OECONF += "--enable-poison-system-directories" | ||
25 | EXTRA_OECONF:append:sh4 = " \ | ||
26 | --with-multilib-list= \ | ||
27 | --enable-incomplete-targets \ | ||
28 | " | ||
29 | |||
30 | EXTRA_OECONF += "\ | ||
31 | --with-system-zlib \ | ||
32 | " | ||
33 | |||
34 | EXTRA_OECONF:append:libc-baremetal = " --without-headers" | ||
35 | EXTRA_OECONF:remove:libc-baremetal = "--enable-threads=posix" | ||
36 | EXTRA_OECONF:remove:libc-newlib = "--enable-threads=posix" | ||
37 | |||
38 | EXTRA_OECONF_PATHS = "\ | ||
39 | --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ | ||
40 | --with-sysroot=/not/exist \ | ||
41 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
42 | " | ||
43 | |||
44 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" | ||
45 | |||
46 | |||
47 | do_configure:prepend () { | ||
48 | install -d ${RECIPE_SYSROOT}${target_includedir} | ||
49 | touch ${RECIPE_SYSROOT}${target_includedir}/limits.h | ||
50 | } | ||
51 | |||
52 | do_compile () { | ||
53 | export CC="${BUILD_CC}" | ||
54 | export AR_FOR_TARGET="${TARGET_SYS}-ar" | ||
55 | export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib" | ||
56 | export LD_FOR_TARGET="${TARGET_SYS}-ld" | ||
57 | export NM_FOR_TARGET="${TARGET_SYS}-nm" | ||
58 | export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc" | ||
59 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
60 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
61 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
62 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
63 | |||
64 | # Prevent native/host sysroot path from being used in configargs.h header, | ||
65 | # as it will be rewritten when used by other sysroots preventing support | ||
66 | # for gcc plugins | ||
67 | oe_runmake configure-gcc | ||
68 | sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h | ||
69 | sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h | ||
70 | |||
71 | # Prevent sysroot/workdir paths from being used in checksum-options. | ||
72 | # checksum-options is used to generate a checksum which is embedded into | ||
73 | # the output binary. | ||
74 | oe_runmake TARGET-gcc=checksum-options all-gcc | ||
75 | sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options | ||
76 | sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/checksum-options | ||
77 | |||
78 | oe_runmake all-host configure-target-libgcc | ||
79 | (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) | ||
80 | } | ||
81 | |||
82 | INHIBIT_PACKAGE_STRIP = "1" | ||
83 | |||
84 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
85 | BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" | ||
86 | |||
87 | do_install () { | ||
88 | ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h ) | ||
89 | oe_runmake 'DESTDIR=${D}' install-host | ||
90 | |||
91 | install -d ${D}${target_base_libdir} | ||
92 | install -d ${D}${target_libdir} | ||
93 | |||
94 | # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 | ||
95 | # gfortran is fully backwards compatible. This is a safe and practical solution. | ||
96 | if [ -n "${@d.getVar('FORTRAN')}" ]; then | ||
97 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true | ||
98 | fortsymlinks="g77 gfortran" | ||
99 | fi | ||
100 | |||
101 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
102 | # found. These need to be relative paths so they work in different locations. | ||
103 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
104 | install -d $dest | ||
105 | for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do | ||
106 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t | ||
107 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t | ||
108 | done | ||
109 | |||
110 | # Remove things we don't need but keep share/java | ||
111 | for d in info man share/doc share/locale share/man share/info; do | ||
112 | rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d | ||
113 | done | ||
114 | |||
115 | # libquadmath headers need to be available in the gcc libexec dir | ||
116 | install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
117 | cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
118 | cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
119 | |||
120 | find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f | ||
121 | } | ||
122 | |||
123 | do_package[noexec] = "1" | ||
124 | do_packagedata[noexec] = "1" | ||
125 | do_package_write_ipk[noexec] = "1" | ||
126 | do_package_write_rpm[noexec] = "1" | ||
127 | do_package_write_deb[noexec] = "1" | ||
128 | |||
129 | inherit chrpath | ||
130 | |||
131 | python gcc_stash_builddir_fixrpaths() { | ||
132 | # rewrite rpaths, breaking hardlinks as required | ||
133 | process_dir("/", d.getVar("BUILDDIRSTASH"), d, break_hardlinks = True) | ||
134 | } | ||
135 | |||
136 | BUILDDIRSTASH = "${WORKDIR}/stashed-builddir/build" | ||
137 | do_gcc_stash_builddir[dirs] = "${B}" | ||
138 | do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}" | ||
139 | do_gcc_stash_builddir[postfuncs] += "gcc_stash_builddir_fixrpaths" | ||
140 | do_gcc_stash_builddir () { | ||
141 | dest=${BUILDDIRSTASH} | ||
142 | hardlinkdir . $dest | ||
143 | # Makefile does move-if-change which can end up with 'timestamp' as file contents so break links to those files | ||
144 | rm $dest/gcc/include/*.h | ||
145 | cp gcc/include/*.h $dest/gcc/include/ | ||
146 | } | ||
147 | addtask do_gcc_stash_builddir after do_compile before do_install | ||
148 | SSTATETASKS += "do_gcc_stash_builddir" | ||
149 | do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}" | ||
150 | do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}" | ||
151 | do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}" | ||
152 | |||
153 | python do_gcc_stash_builddir_setscene () { | ||
154 | sstate_setscene(d) | ||
155 | } | ||
156 | addtask do_gcc_stash_builddir_setscene | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-cross_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-cross_10.2.bb deleted file mode 100644 index b43cca0c..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-cross_10.2.bb +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require gcc-cross.inc | ||
3 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk.inc b/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk.inc deleted file mode 100644 index bd2e71d6..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk.inc +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | inherit crosssdk | ||
2 | |||
3 | PN = "gcc-crosssdk-${SDK_SYS}" | ||
4 | |||
5 | SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include" | ||
6 | SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/" | ||
7 | SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/" | ||
8 | |||
9 | GCCMULTILIB = "--disable-multilib" | ||
10 | |||
11 | DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}" | ||
12 | PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk_10.2.bb deleted file mode 100644 index 40a6c4fe..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-crosssdk_10.2.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-cross_${PV}.bb | ||
2 | require gcc-crosssdk.inc | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-multilib-config.inc b/meta-microblaze/recipes-devtools/gcc/gcc-multilib-config.inc deleted file mode 100644 index e90580d1..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-multilib-config.inc +++ /dev/null | |||
@@ -1,235 +0,0 @@ | |||
1 | # following code modifies these definitions in the gcc config | ||
2 | # MULTILIB_OPTIONS | ||
3 | # MULTILIB_DIRNAMES | ||
4 | # MULTILIB_OSDIRNAMES | ||
5 | # GLIBC_DYNAMIC_LINKER32 | ||
6 | # GLIBC_DYNAMIC_LINKER64 | ||
7 | # GLIBC_DYNAMIC_LINKERX32 | ||
8 | # GLIBC_DYNAMIC_LINKERN32 | ||
9 | # For more information on use of these variables look at these files in the gcc source code | ||
10 | # gcc/config/i386/t-linux64 | ||
11 | # gcc/config/mips/t-linux64 | ||
12 | # gcc/config/rs6000/t-linux64 | ||
13 | # gcc/config/i386/linux64.h | ||
14 | # gcc/config/mips/linux64.h | ||
15 | # gcc/config/rs6000/linux64.h | ||
16 | |||
17 | MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64" | ||
18 | |||
19 | python gcc_multilib_setup() { | ||
20 | import re | ||
21 | import shutil | ||
22 | import glob | ||
23 | |||
24 | srcdir = d.getVar('S') | ||
25 | builddir = d.getVar('B') | ||
26 | src_conf_dir = '%s/gcc/config' % srcdir | ||
27 | build_conf_dir = '%s/gcc/config' % builddir | ||
28 | |||
29 | bb.utils.remove(build_conf_dir, True) | ||
30 | ml_globs = ('%s/*/t-linux64' % src_conf_dir, | ||
31 | '%s/*/linux64.h' % src_conf_dir, | ||
32 | '%s/aarch64/t-aarch64' % src_conf_dir, | ||
33 | '%s/aarch64/aarch64.h' % src_conf_dir, | ||
34 | '%s/aarch64/aarch64-cores.def' % src_conf_dir, | ||
35 | '%s/*/linux.h' % src_conf_dir, | ||
36 | '%s/linux.h' % src_conf_dir) | ||
37 | |||
38 | # copy the target multilib config files to ${B} | ||
39 | for ml_glob in ml_globs: | ||
40 | for fn in glob.glob(ml_glob): | ||
41 | rel_path = os.path.relpath(fn, src_conf_dir) | ||
42 | parent_dir = os.path.dirname(rel_path) | ||
43 | bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir)) | ||
44 | bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path)) | ||
45 | |||
46 | pn = d.getVar('PN') | ||
47 | multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split() | ||
48 | if not multilibs and pn != "nativesdk-gcc": | ||
49 | return | ||
50 | |||
51 | mlprefix = d.getVar('MLPREFIX') | ||
52 | |||
53 | if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc": | ||
54 | return | ||
55 | |||
56 | |||
57 | def write_config(root, files, options, dirnames, osdirnames): | ||
58 | for ml_conf_file in files: | ||
59 | with open(root + '/' + ml_conf_file, 'r') as f: | ||
60 | filelines = f.readlines() | ||
61 | # recreate multilib configuration variables | ||
62 | substs = [ | ||
63 | (r'^(\s*(MULTILIB_OPTIONS\s*=).*)$', r'\2 %s' % '/'.join(options)), | ||
64 | (r'^(\s*MULTILIB_OPTIONS\s*\+=.*)$', ''), | ||
65 | (r'^(\s*(MULTILIB_DIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(dirnames)), | ||
66 | (r'^(\s*MULTILIB_DIRNAMES\s*\+=.*)$', ''), | ||
67 | (r'^(\s*(MULTILIB_OSDIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(osdirnames)), | ||
68 | (r'^(\s*MULTILIB_OSDIRNAMES\s*\+=.*)$', ''), | ||
69 | ] | ||
70 | |||
71 | for (i, line) in enumerate(filelines): | ||
72 | for subst in substs: | ||
73 | line = re.sub(subst[0], subst[1], line) | ||
74 | filelines[i] = line | ||
75 | |||
76 | with open(root + '/' + ml_conf_file, 'w') as f: | ||
77 | f.write(''.join(filelines)) | ||
78 | |||
79 | def write_headers(root, files, libdir32, libdir64, libdirx32, libdirn32): | ||
80 | def wrap_libdir(libdir): | ||
81 | if libdir.find('SYSTEMLIBS_DIR') != -1: | ||
82 | return '"%r"' | ||
83 | else: | ||
84 | return '"/%s/"' % libdir | ||
85 | |||
86 | for ml_conf_file in files: | ||
87 | fn = root + '/' + ml_conf_file | ||
88 | if not os.path.exists(fn): | ||
89 | continue | ||
90 | with open(fn, 'r') as f: | ||
91 | filelines = f.readlines() | ||
92 | |||
93 | # replace lines like | ||
94 | # #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" | ||
95 | # by | ||
96 | # #define GLIBC_DYNAMIC_LINKER32 "/lib/" "ld-linux.so.2" | ||
97 | # this is needed to put the correct dynamic loader path in the generated binaries | ||
98 | substs = [ | ||
99 | (r'^(#define\s*GLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$', | ||
100 | r'\1' + wrap_libdir(libdir32) + r'\3'), | ||
101 | (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\"\S+\")$', | ||
102 | r'\1' + wrap_libdir(libdir64) + r'\3'), | ||
103 | (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$', | ||
104 | r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'), | ||
105 | (r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$', | ||
106 | r'\1' + wrap_libdir(libdirx32) + r'\3'), | ||
107 | (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$', | ||
108 | r'\1' + wrap_libdir(libdirn32) + r'\3'), | ||
109 | (r'^(#define\s*UCLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$', | ||
110 | r'\1' + wrap_libdir(libdir32) + r'\3'), | ||
111 | (r'^(#define\s*UCLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$', | ||
112 | r'\1' + wrap_libdir(libdir64) + r'\3'), | ||
113 | (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$', | ||
114 | r'\1' + wrap_libdir(libdirn32) + r'\3'), | ||
115 | (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$', | ||
116 | r'\1' + wrap_libdir(libdir32) + r'\3'), | ||
117 | ] | ||
118 | |||
119 | for (i, line) in enumerate(filelines): | ||
120 | for subst in substs: | ||
121 | line = re.sub(subst[0], subst[1], line) | ||
122 | filelines[i] = line | ||
123 | |||
124 | with open(root + '/' + ml_conf_file, 'w') as f: | ||
125 | f.write(''.join(filelines)) | ||
126 | |||
127 | |||
128 | gcc_target_config_files = { | ||
129 | 'x86_64' : ['gcc/config/i386/t-linux64'], | ||
130 | 'i586' : ['gcc/config/i386/t-linux64'], | ||
131 | 'i686' : ['gcc/config/i386/t-linux64'], | ||
132 | 'mips' : ['gcc/config/mips/t-linux64'], | ||
133 | 'mips64' : ['gcc/config/mips/t-linux64'], | ||
134 | 'powerpc' : ['gcc/config/rs6000/t-linux64'], | ||
135 | 'powerpc64' : ['gcc/config/rs6000/t-linux64'], | ||
136 | 'aarch64' : ['gcc/config/aarch64/t-aarch64'], | ||
137 | 'arm' : ['gcc/config/aarch64/t-aarch64'], | ||
138 | } | ||
139 | |||
140 | gcc_header_config_files = { | ||
141 | 'x86_64' : ['gcc/config/i386/linux64.h'], | ||
142 | 'i586' : ['gcc/config/i386/linux64.h'], | ||
143 | 'i686' : ['gcc/config/i386/linux64.h'], | ||
144 | 'mips' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], | ||
145 | 'mips64' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], | ||
146 | 'powerpc' : ['gcc/config/rs6000/linux64.h'], | ||
147 | 'powerpc64' : ['gcc/config/rs6000/linux64.h'], | ||
148 | 'aarch64' : ['gcc/config/aarch64/aarch64.h'], | ||
149 | 'arm' : ['gcc/config/aarch64/aarch64.h'], | ||
150 | } | ||
151 | |||
152 | libdir32 = 'SYSTEMLIBS_DIR' | ||
153 | libdir64 = 'SYSTEMLIBS_DIR' | ||
154 | libdirx32 = 'SYSTEMLIBS_DIR' | ||
155 | libdirn32 = 'SYSTEMLIBS_DIR' | ||
156 | |||
157 | |||
158 | target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix | ||
159 | else d.getVar('TARGET_ARCH')) | ||
160 | if pn == "nativesdk-gcc": | ||
161 | header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")] | ||
162 | write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32) | ||
163 | return | ||
164 | |||
165 | if target_arch not in gcc_target_config_files: | ||
166 | bb.warn('gcc multilib setup is not supported for TARGET_ARCH=' + target_arch) | ||
167 | return | ||
168 | |||
169 | target_config_files = gcc_target_config_files[target_arch] | ||
170 | header_config_files = gcc_header_config_files[target_arch] | ||
171 | |||
172 | ml_list = ['DEFAULTTUNE_MULTILIB_ORIGINAL' if mlprefix else 'DEFAULTTUNE'] | ||
173 | mltunes = [('DEFAULTTUNE:virtclass-multilib-%s' % ml) for ml in multilibs] | ||
174 | if mlprefix: | ||
175 | mlindex = 0 | ||
176 | for ml in multilibs: | ||
177 | if mlprefix == ml + '-': | ||
178 | break | ||
179 | mlindex += 1 | ||
180 | |||
181 | ml_list.extend(mltunes[:mlindex] + ['DEFAULTTUNE'] + mltunes[(mlindex + 1):]) | ||
182 | else: | ||
183 | ml_list.extend(mltunes) | ||
184 | |||
185 | options = [] | ||
186 | dirnames = [] | ||
187 | osdirnames = [] | ||
188 | optsets = [] | ||
189 | |||
190 | for ml in ml_list: | ||
191 | tune = d.getVar(ml) | ||
192 | if not tune: | ||
193 | bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml) | ||
194 | continue | ||
195 | tune_parameters = get_tune_parameters(tune, d) | ||
196 | |||
197 | tune_baselib = tune_parameters['baselib'] | ||
198 | if not tune_baselib: | ||
199 | bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune) | ||
200 | continue | ||
201 | |||
202 | if tune_baselib == 'lib64': | ||
203 | libdir64 = tune_baselib | ||
204 | elif tune_baselib == 'libx32': | ||
205 | libdirx32 = tune_baselib | ||
206 | elif tune_baselib == 'lib32': | ||
207 | libdirn32 = tune_baselib | ||
208 | elif tune_baselib == 'lib': | ||
209 | libdir32 = tune_baselib | ||
210 | else: | ||
211 | bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune)) | ||
212 | |||
213 | # take out '-' mcpu='s and march='s from parameters | ||
214 | opts = [] | ||
215 | whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST") or "").split() | ||
216 | for i in d.expand(tune_parameters['ccargs']).split(): | ||
217 | if i in whitelist: | ||
218 | # Need to strip '-' from option | ||
219 | opts.append(i[1:]) | ||
220 | options.append(" ".join(opts)) | ||
221 | |||
222 | if tune_baselib == 'lib': | ||
223 | dirnames.append('32') # /lib => 32bit lib | ||
224 | else: | ||
225 | dirnames.append(tune_baselib.replace('lib', '')) | ||
226 | osdirnames.append('../' + tune_baselib) | ||
227 | |||
228 | write_config(builddir, target_config_files, options, dirnames, osdirnames) | ||
229 | write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32) | ||
230 | } | ||
231 | |||
232 | gcc_multilib_setup[cleandirs] = "${B}/gcc/config" | ||
233 | gcc_multilib_setup[vardepsexclude] = "SDK_ARCH" | ||
234 | |||
235 | EXTRACONFFUNCS += "gcc_multilib_setup" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-runtime.inc b/meta-microblaze/recipes-devtools/gcc/gcc-runtime.inc deleted file mode 100644 index ef3872a6..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-runtime.inc +++ /dev/null | |||
@@ -1,316 +0,0 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | SUMMARY = "Runtime libraries from GCC" | ||
4 | |||
5 | # Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3" | ||
6 | # All gcc-runtime packages are now covered by the runtime exception. | ||
7 | LICENSE = "GPL-3.0-with-GCC-exception" | ||
8 | |||
9 | CXXFLAGS:remove = "-fvisibility-inlines-hidden" | ||
10 | |||
11 | EXTRA_OECONF_PATHS = "\ | ||
12 | --with-gxx-include-dir=${includedir}/c++/${BINV} \ | ||
13 | --with-sysroot=/not/exist \ | ||
14 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
15 | " | ||
16 | |||
17 | EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu" | ||
18 | EXTRA_OECONF:append = " --cache-file=${B}/config.cache" | ||
19 | EXTRA_OECONF:append:libc-newlib = " --with-newlib" | ||
20 | |||
21 | # Disable ifuncs for libatomic on arm conflicts -march/-mcpu | ||
22 | EXTRA_OECONF:append:arm = " libat_cv_have_ifunc=no " | ||
23 | EXTRA_OECONF:append:armeb = " libat_cv_have_ifunc=no " | ||
24 | |||
25 | DISABLE_STATIC:class-nativesdk ?= "" | ||
26 | |||
27 | # Newlib does not support symbol versioning on libsdtcc++ | ||
28 | SYMVERS_CONF:libc-newlib = "" | ||
29 | |||
30 | # Building with thumb enabled on armv6t fails | ||
31 | ARM_INSTRUCTION_SET:armv6 = "arm" | ||
32 | |||
33 | RUNTIMELIBITM = "libitm" | ||
34 | RUNTIMELIBITM:arc = "" | ||
35 | RUNTIMELIBITM:mipsarch = "" | ||
36 | RUNTIMELIBITM:nios2 = "" | ||
37 | RUNTIMELIBITM:microblaze = "" | ||
38 | RUNTIMELIBITM:riscv32 = "" | ||
39 | RUNTIMELIBITM:riscv64 = "" | ||
40 | RUNTIMELIBSSP ?= "" | ||
41 | RUNTIMELIBSSP:mingw32 ?= "libssp" | ||
42 | |||
43 | RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ | ||
44 | ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \ | ||
45 | " | ||
46 | # Only build libstdc++ for newlib | ||
47 | RUNTIMETARGET:libc-newlib = "libstdc++-v3" | ||
48 | |||
49 | # libiberty | ||
50 | # libgfortran needs separate recipe due to libquadmath dependency | ||
51 | |||
52 | SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | ||
53 | SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" | ||
54 | |||
55 | DEBUG_PREFIX_MAP:class-target = " \ | ||
56 | -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \ | ||
57 | -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \ | ||
58 | -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \ | ||
59 | -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \ | ||
60 | -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \ | ||
61 | -fdebug-prefix-map=${B}=${SLIB_NEW} \ | ||
62 | " | ||
63 | |||
64 | do_configure () { | ||
65 | export CXX="${CXX} -nostdinc++ -nostdlib++" | ||
66 | for d in libgcc ${RUNTIMETARGET}; do | ||
67 | echo "Configuring $d" | ||
68 | rm -rf ${B}/${TARGET_SYS}/$d/ | ||
69 | mkdir -p ${B}/${TARGET_SYS}/$d/ | ||
70 | cd ${B}/${TARGET_SYS}/$d/ | ||
71 | chmod a+x ${S}/$d/configure | ||
72 | relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")} | ||
73 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
74 | if [ "$d" = "libgcc" ]; then | ||
75 | (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) | ||
76 | fi | ||
77 | done | ||
78 | } | ||
79 | EXTRACONFFUNCS += "extract_stashed_builddir" | ||
80 | do_configure[depends] += "${COMPILERDEP}" | ||
81 | |||
82 | do_compile () { | ||
83 | for d in libgcc ${RUNTIMETARGET}; do | ||
84 | cd ${B}/${TARGET_SYS}/$d/ | ||
85 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ | ||
86 | done | ||
87 | } | ||
88 | |||
89 | do_install () { | ||
90 | for d in ${RUNTIMETARGET}; do | ||
91 | cd ${B}/${TARGET_SYS}/$d/ | ||
92 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install | ||
93 | done | ||
94 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then | ||
95 | install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
96 | mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
97 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include | ||
98 | fi | ||
99 | rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir | ||
100 | rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir | ||
101 | rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir | ||
102 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then | ||
103 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
104 | fi | ||
105 | if [ -d ${D}${infodir} ]; then | ||
106 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} | ||
107 | fi | ||
108 | } | ||
109 | |||
110 | do_install:append:class-target () { | ||
111 | if [ "${TARGET_OS}" = "linux-gnuspe" ]; then | ||
112 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux | ||
113 | fi | ||
114 | |||
115 | if [ "${TARGET_OS}" = "linux-gnun32" ]; then | ||
116 | if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then | ||
117 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux | ||
118 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/32 | ||
119 | elif [ "${MULTILIB_VARIANTS}" != "" ]; then | ||
120 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux | ||
121 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32 | ||
122 | else | ||
123 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux | ||
124 | fi | ||
125 | elif [ "${TARGET_OS}" = "linux-gnux32" ]; then | ||
126 | if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then | ||
127 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux | ||
128 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux/x32 | ||
129 | elif [ "${MULTILIB_VARIANTS}" != "" ]; then | ||
130 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux | ||
131 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux/32 | ||
132 | else | ||
133 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux | ||
134 | fi | ||
135 | elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then | ||
136 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS} | ||
137 | ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits | ||
138 | ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext | ||
139 | fi | ||
140 | |||
141 | if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then | ||
142 | ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32 | ||
143 | fi | ||
144 | |||
145 | if [ "${TCLIBC}" != "glibc" ]; then | ||
146 | case "${TARGET_OS}" in | ||
147 | "linux-musl" | "linux-*spe") extra_target_os="linux";; | ||
148 | "linux-musleabi") extra_target_os="linux-gnueabi";; | ||
149 | *) extra_target_os="linux";; | ||
150 | esac | ||
151 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
152 | fi | ||
153 | chown -R root:root ${D} | ||
154 | } | ||
155 | |||
156 | INHIBIT_DEFAULT_DEPS = "1" | ||
157 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc" | ||
158 | PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" | ||
159 | |||
160 | BBCLASSEXTEND = "nativesdk" | ||
161 | |||
162 | PACKAGES = "\ | ||
163 | ${PN}-dbg \ | ||
164 | libstdc++ \ | ||
165 | libstdc++-precompile-dev \ | ||
166 | libstdc++-dev \ | ||
167 | libstdc++-staticdev \ | ||
168 | libg2c \ | ||
169 | libg2c-dev \ | ||
170 | libssp \ | ||
171 | libssp-dev \ | ||
172 | libssp-staticdev \ | ||
173 | libquadmath \ | ||
174 | libquadmath-dev \ | ||
175 | libquadmath-staticdev \ | ||
176 | libgomp \ | ||
177 | libgomp-dev \ | ||
178 | libgomp-staticdev \ | ||
179 | libatomic \ | ||
180 | libatomic-dev \ | ||
181 | libatomic-staticdev \ | ||
182 | libitm \ | ||
183 | libitm-dev \ | ||
184 | libitm-staticdev \ | ||
185 | " | ||
186 | # The base package doesn't exist, so we clear the recommends. | ||
187 | RRECOMMENDS:${PN}-dbg = "" | ||
188 | |||
189 | # include python debugging scripts | ||
190 | FILES:${PN}-dbg += "\ | ||
191 | ${libdir}/libstdc++.*-gdb.py \ | ||
192 | ${datadir}/gcc-${BINV}/python/libstdcxx \ | ||
193 | " | ||
194 | |||
195 | FILES:libg2c = "${target_libdir}/libg2c.so.*" | ||
196 | SUMMARY:libg2c = "Companion runtime library for g77" | ||
197 | FILES:libg2c-dev = "\ | ||
198 | ${libdir}/libg2c.so \ | ||
199 | ${libdir}/libg2c.a \ | ||
200 | ${libdir}/libfrtbegin.a \ | ||
201 | " | ||
202 | SUMMARY:libg2c-dev = "Companion runtime library for g77 - development files" | ||
203 | |||
204 | FILES:libstdc++ = "${libdir}/libstdc++.so.*" | ||
205 | SUMMARY:libstdc++ = "GNU standard C++ library" | ||
206 | FILES:libstdc++-dev = "\ | ||
207 | ${includedir}/c++/ \ | ||
208 | ${libdir}/libstdc++.so \ | ||
209 | ${libdir}/libstdc++*.la \ | ||
210 | ${libdir}/libsupc++.la \ | ||
211 | " | ||
212 | SUMMARY:libstdc++-dev = "GNU standard C++ library - development files" | ||
213 | FILES:libstdc++-staticdev = "\ | ||
214 | ${libdir}/libstdc++*.a \ | ||
215 | ${libdir}/libsupc++.a \ | ||
216 | " | ||
217 | SUMMARY:libstdc++-staticdev = "GNU standard C++ library - static development files" | ||
218 | |||
219 | FILES:libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch" | ||
220 | SUMMARY:libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files" | ||
221 | |||
222 | FILES:libssp = "${libdir}/libssp.so.*" | ||
223 | SUMMARY:libssp = "GNU stack smashing protection library" | ||
224 | FILES:libssp-dev = "\ | ||
225 | ${libdir}/libssp*.so \ | ||
226 | ${libdir}/libssp*_nonshared.a \ | ||
227 | ${libdir}/libssp*.la \ | ||
228 | ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \ | ||
229 | " | ||
230 | SUMMARY:libssp-dev = "GNU stack smashing protection library - development files" | ||
231 | FILES:libssp-staticdev = "${libdir}/libssp*.a" | ||
232 | SUMMARY:libssp-staticdev = "GNU stack smashing protection library - static development files" | ||
233 | |||
234 | FILES:libquadmath = "${libdir}/libquadmath*.so.*" | ||
235 | SUMMARY:libquadmath = "GNU quad-precision math library" | ||
236 | FILES:libquadmath-dev = "\ | ||
237 | ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \ | ||
238 | ${libdir}/libquadmath*.so \ | ||
239 | ${libdir}/libquadmath.la \ | ||
240 | " | ||
241 | SUMMARY:libquadmath-dev = "GNU quad-precision math library - development files" | ||
242 | FILES:libquadmath-staticdev = "${libdir}/libquadmath.a" | ||
243 | SUMMARY:libquadmath-staticdev = "GNU quad-precision math library - static development files" | ||
244 | |||
245 | FILES:libgomp = "${libdir}/libgomp*${SOLIBS}" | ||
246 | SUMMARY:libgomp = "GNU OpenMP parallel programming library" | ||
247 | FILES:libgomp-dev = "\ | ||
248 | ${libdir}/libgomp*${SOLIBSDEV} \ | ||
249 | ${libdir}/libgomp*.la \ | ||
250 | ${libdir}/libgomp.spec \ | ||
251 | ${libdir}/${TARGET_SYS}/${BINV}/include/acc_prof.h \ | ||
252 | ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \ | ||
253 | ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \ | ||
254 | " | ||
255 | SUMMARY:libgomp-dev = "GNU OpenMP parallel programming library - development files" | ||
256 | FILES:libgomp-staticdev = "${libdir}/libgomp*.a" | ||
257 | SUMMARY:libgomp-staticdev = "GNU OpenMP parallel programming library - static development files" | ||
258 | |||
259 | FILES:libatomic = "${libdir}/libatomic.so.*" | ||
260 | SUMMARY:libatomic = "GNU C++11 atomics support library" | ||
261 | FILES:libatomic-dev = "\ | ||
262 | ${libdir}/libatomic.so \ | ||
263 | ${libdir}/libatomic.la \ | ||
264 | " | ||
265 | SUMMARY:libatomic-dev = "GNU C++11 atomics support library - development files" | ||
266 | FILES:libatomic-staticdev = "${libdir}/libatomic.a" | ||
267 | SUMMARY:libatomic-staticdev = "GNU C++11 atomics support library - static development files" | ||
268 | |||
269 | FILES:libitm = "${libdir}/libitm.so.*" | ||
270 | SUMMARY:libitm = "GNU transactional memory support library" | ||
271 | FILES:libitm-dev = "\ | ||
272 | ${libdir}/libitm.so \ | ||
273 | ${libdir}/libitm.la \ | ||
274 | ${libdir}/libitm.spec \ | ||
275 | " | ||
276 | SUMMARY:libitm-dev = "GNU transactional memory support library - development files" | ||
277 | FILES:libitm-staticdev = "${libdir}/libitm.a" | ||
278 | SUMMARY:libitm-staticdev = "GNU transactional memory support library - static development files" | ||
279 | |||
280 | require gcc-testsuite.inc | ||
281 | |||
282 | EXTRA_OEMAKE:prepend:task-check = "${PARALLEL_MAKE} " | ||
283 | |||
284 | MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}" | ||
285 | # prettyprinters and xmethods require gdb tooling | ||
286 | MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp" | ||
287 | MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'" | ||
288 | |||
289 | # specific host and target dependencies required for test suite running | ||
290 | do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot" | ||
291 | do_check[depends] += "virtual/libc:do_populate_sysroot" | ||
292 | # only depend on qemu if targeting linux user execution | ||
293 | do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}" | ||
294 | # extend the recipe sysroot to include the built libraries (for qemu usermode) | ||
295 | do_check[prefuncs] += "extend_recipe_sysroot" | ||
296 | do_check[prefuncs] += "check_prepare" | ||
297 | do_check[dirs] = "${WORKDIR}/dejagnu ${B}" | ||
298 | do_check[nostamp] = "1" | ||
299 | do_check() { | ||
300 | export DEJAGNU="${WORKDIR}/dejagnu/site.exp" | ||
301 | |||
302 | # HACK: this works around the configure setting CXX with -nostd* args | ||
303 | sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1) | ||
304 | |||
305 | if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then | ||
306 | # qemu user has issues allocating large amounts of memory | ||
307 | export G_SLICE=always-malloc | ||
308 | # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory | ||
309 | ulimit -m 4194304 | ||
310 | ulimit -v 10485760 | ||
311 | fi | ||
312 | |||
313 | oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}" | ||
314 | } | ||
315 | addtask check after do_compile do_populate_sysroot | ||
316 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-runtime_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-runtime_10.2.bb deleted file mode 100644 index dd430b57..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-runtime_10.2.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require gcc-runtime.inc | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers.inc b/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers.inc deleted file mode 100644 index c78d5214..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers.inc +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | LICENSE = "NCSA | MIT" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "\ | ||
6 | file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \ | ||
7 | " | ||
8 | |||
9 | EXTRA_OECONF_PATHS = "\ | ||
10 | --with-sysroot=/not/exist \ | ||
11 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
12 | " | ||
13 | |||
14 | do_configure () { | ||
15 | rm -rf ${B}/${TARGET_SYS}/libsanitizer/ | ||
16 | mkdir -p ${B}/${TARGET_SYS}/libsanitizer/ | ||
17 | cd ${B}/${TARGET_SYS}/libsanitizer/ | ||
18 | chmod a+x ${S}/libsanitizer/configure | ||
19 | relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/${TARGET_SYS}/libsanitizer")} | ||
20 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
21 | # Easiest way to stop bad RPATHs getting into the library since we have a | ||
22 | # broken libtool here | ||
23 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libsanitizer/libtool | ||
24 | # Link to the sysroot's libstdc++ instead of one gcc thinks it just built | ||
25 | sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/${TARGET_SYS}/libsanitizer/*/Makefile | ||
26 | } | ||
27 | EXTRACONFFUNCS += "extract_stashed_builddir" | ||
28 | do_configure[depends] += "${COMPILERDEP}" | ||
29 | |||
30 | do_compile () { | ||
31 | cd ${B}/${TARGET_SYS}/libsanitizer/ | ||
32 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ | ||
33 | } | ||
34 | |||
35 | do_install () { | ||
36 | cd ${B}/${TARGET_SYS}/libsanitizer/ | ||
37 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install | ||
38 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then | ||
39 | install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
40 | mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
41 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include | ||
42 | fi | ||
43 | if [ -d ${D}${infodir} ]; then | ||
44 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} | ||
45 | fi | ||
46 | chown -R root:root ${D} | ||
47 | } | ||
48 | |||
49 | INHIBIT_DEFAULT_DEPS = "1" | ||
50 | ALLOW_EMPTY:${PN} = "1" | ||
51 | DEPENDS = "virtual/crypt gcc-runtime virtual/${TARGET_PREFIX}gcc" | ||
52 | |||
53 | # used to fix ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
54 | DEBUG_OPTIMIZATION:append = " -Wno-error" | ||
55 | |||
56 | BBCLASSEXTEND = "nativesdk" | ||
57 | |||
58 | PACKAGES = "${PN} ${PN}-dbg" | ||
59 | PACKAGES += "libasan libubsan liblsan libtsan" | ||
60 | PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev" | ||
61 | PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev" | ||
62 | |||
63 | RDEPENDS:libasan += "libstdc++" | ||
64 | RDEPENDS:libubsan += "libstdc++" | ||
65 | RDEPENDS:liblsan += "libstdc++" | ||
66 | RDEPENDS:libtsan += "libstdc++" | ||
67 | RDEPENDS:libasan-dev += "${PN}" | ||
68 | RDEPENDS:libubsan-dev += "${PN}" | ||
69 | RDEPENDS:liblsan-dev += "${PN}" | ||
70 | RDEPENDS:libtsan-dev += "${PN}" | ||
71 | RRECOMMENDS:${PN} += "libasan libubsan" | ||
72 | RRECOMMENDS:${PN}:append:x86 = " liblsan" | ||
73 | RRECOMMENDS:${PN}:append:x86-64 = " liblsan libtsan" | ||
74 | RRECOMMENDS:${PN}:append:powerpc64 = " liblsan libtsan" | ||
75 | RRECOMMENDS:${PN}:append:aarch64 = " liblsan libtsan" | ||
76 | |||
77 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
78 | do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
79 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" | ||
80 | |||
81 | # Only x86, powerpc, sparc, s390, arm, and aarch64 are supported | ||
82 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|sparc|s390|arm|aarch64).*-linux' | ||
83 | # musl is currently broken entirely | ||
84 | COMPATIBLE_HOST:libc-musl = 'null' | ||
85 | |||
86 | FILES:libasan += "${libdir}/libasan.so.*" | ||
87 | FILES:libasan-dev += "\ | ||
88 | ${libdir}/libasan_preinit.o \ | ||
89 | ${libdir}/libasan.so \ | ||
90 | ${libdir}/libasan.la \ | ||
91 | " | ||
92 | FILES:libasan-staticdev += "${libdir}/libasan.a" | ||
93 | |||
94 | FILES:libubsan += "${libdir}/libubsan.so.*" | ||
95 | FILES:libubsan-dev += "\ | ||
96 | ${libdir}/libubsan.so \ | ||
97 | ${libdir}/libubsan.la \ | ||
98 | " | ||
99 | FILES:libubsan-staticdev += "${libdir}/libubsan.a" | ||
100 | |||
101 | FILES:liblsan += "${libdir}/liblsan.so.*" | ||
102 | FILES:liblsan-dev += "\ | ||
103 | ${libdir}/liblsan.so \ | ||
104 | ${libdir}/liblsan.la \ | ||
105 | ${libdir}/liblsan_preinit.o \ | ||
106 | " | ||
107 | FILES:liblsan-staticdev += "${libdir}/liblsan.a" | ||
108 | |||
109 | FILES:libtsan += "${libdir}/libtsan.so.*" | ||
110 | FILES:libtsan-dev += "\ | ||
111 | ${libdir}/libtsan.so \ | ||
112 | ${libdir}/libtsan.la \ | ||
113 | ${libdir}/libtsan_*.o \ | ||
114 | " | ||
115 | FILES:libtsan-staticdev += "${libdir}/libtsan.a" | ||
116 | |||
117 | FILES:${PN} = "${libdir}/*.spec ${libdir}/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers_10.2.bb deleted file mode 100644 index 8bda2cca..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-sanitizers_10.2.bb +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require gcc-sanitizers.inc | ||
3 | |||
4 | # Building with thumb enabled on armv4t armv5t fails with | ||
5 | # sanitizer_linux.s:5749: Error: lo register required -- `ldr ip,[sp],#8' | ||
6 | ARM_INSTRUCTION_SET:armv4 = "arm" | ||
7 | ARM_INSTRUCTION_SET:armv5 = "arm" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-shared-source.inc b/meta-microblaze/recipes-devtools/gcc/gcc-shared-source.inc deleted file mode 100644 index aac4b493..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-shared-source.inc +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | do_fetch() { | ||
2 | : | ||
3 | } | ||
4 | do_fetch[noexec] = "1" | ||
5 | deltask do_unpack | ||
6 | deltask do_patch | ||
7 | |||
8 | SRC_URI = "" | ||
9 | |||
10 | do_configure[depends] += "gcc-source-${PV}:do_preconfigure" | ||
11 | do_populate_lic[depends] += "gcc-source-${PV}:do_unpack" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-source.inc b/meta-microblaze/recipes-devtools/gcc/gcc-source.inc deleted file mode 100644 index 03bab978..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-source.inc +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | deltask do_configure | ||
2 | deltask do_compile | ||
3 | deltask do_install | ||
4 | deltask do_populate_sysroot | ||
5 | deltask do_populate_lic | ||
6 | RM_WORK_EXCLUDE += "${PN}" | ||
7 | |||
8 | inherit nopackages | ||
9 | |||
10 | PN = "gcc-source-${PV}" | ||
11 | WORKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}" | ||
12 | SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:" | ||
13 | |||
14 | STAMP = "${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}" | ||
15 | STAMPCLEAN = "${STAMPS_DIR}/work-shared/gcc-${PV}-*" | ||
16 | |||
17 | INHIBIT_DEFAULT_DEPS = "1" | ||
18 | DEPENDS = "" | ||
19 | PACKAGES = "" | ||
20 | |||
21 | |||
22 | # This needs to be Python to avoid lots of shell variables becoming dependencies. | ||
23 | python do_preconfigure () { | ||
24 | import subprocess | ||
25 | cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize') | ||
26 | subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) | ||
27 | # See 0044-gengtypes.patch, we need to regenerate this file | ||
28 | bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c")) | ||
29 | cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure") | ||
30 | subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) | ||
31 | |||
32 | # Easiest way to stop bad RPATHs getting into the library since we have a | ||
33 | # broken libtool here (breaks cross-canadian and target at least) | ||
34 | cmd = d.expand("sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure") | ||
35 | subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) | ||
36 | } | ||
37 | addtask do_preconfigure after do_patch | ||
38 | do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot" | ||
39 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-source_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc-source_10.2.bb deleted file mode 100644 index b890fa33..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-source_10.2.bb +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require recipes-devtools/gcc/gcc-source.inc | ||
3 | |||
4 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-target.inc b/meta-microblaze/recipes-devtools/gcc/gcc-target.inc deleted file mode 100644 index 81815209..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-target.inc +++ /dev/null | |||
@@ -1,257 +0,0 @@ | |||
1 | GCCMULTILIB = "--enable-multilib" | ||
2 | require gcc-configure-common.inc | ||
3 | |||
4 | EXTRA_OECONF_PATHS = "\ | ||
5 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
6 | " | ||
7 | |||
8 | EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu" | ||
9 | |||
10 | # Configure gcc running on the target to default to an architecture which will | ||
11 | # be compatible with that of gcc-runtime (which is cross compiled to be target | ||
12 | # specific). For example, for ARM, ARMv6+ adds atomic instructions that may | ||
13 | # affect the ABI in the gcc-runtime libs. Since we can't rely on gcc on the | ||
14 | # target to always be passed -march etc, its built-in default needs to be safe. | ||
15 | |||
16 | ARMFPARCHEXT ?= "" | ||
17 | |||
18 | EXTRA_OECONF:append:armv6:class-target = " --with-arch=armv6${ARMFPARCHEXT}" | ||
19 | EXTRA_OECONF:append:armv7a:class-target = " --with-arch=armv7-a${ARMFPARCHEXT}" | ||
20 | EXTRA_OECONF:append:armv7ve:class-target = " --with-arch=armv7ve${ARMFPARCHEXT}" | ||
21 | EXTRA_OECONF:append:arc:class-target = " --with-cpu=${TUNE_PKGARCH}" | ||
22 | EXTRA_OECONF:append:x86-64:class-target = " --with-arch=native" | ||
23 | |||
24 | # libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is | ||
25 | # set in subdir gcc, so subdir libcc1 can't use it, export it here to | ||
26 | # fix the problem. | ||
27 | export gcc_cv_objdump = "${TARGET_PREFIX}objdump" | ||
28 | |||
29 | EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}" | ||
30 | |||
31 | PACKAGES = "\ | ||
32 | ${PN} ${PN}-plugins ${PN}-symlinks \ | ||
33 | g++ g++-symlinks \ | ||
34 | cpp cpp-symlinks \ | ||
35 | g77 g77-symlinks \ | ||
36 | gfortran gfortran-symlinks \ | ||
37 | gcov gcov-symlinks \ | ||
38 | ${PN}-doc \ | ||
39 | ${PN}-dev \ | ||
40 | ${PN}-dbg \ | ||
41 | " | ||
42 | |||
43 | FILES:${PN} = "\ | ||
44 | ${bindir}/${TARGET_PREFIX}gcc* \ | ||
45 | ${bindir}/${TARGET_PREFIX}lto* \ | ||
46 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2* \ | ||
47 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \ | ||
48 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \ | ||
49 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \ | ||
50 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \ | ||
51 | ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ | ||
52 | ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \ | ||
53 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \ | ||
54 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include \ | ||
55 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ | ||
56 | " | ||
57 | INSANE_SKIP:${PN} += "dev-so" | ||
58 | RRECOMMENDS:${PN} += "\ | ||
59 | libssp \ | ||
60 | libssp-dev \ | ||
61 | " | ||
62 | RDEPENDS:${PN} += "cpp" | ||
63 | |||
64 | FILES:${PN}-dev = "\ | ||
65 | ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \ | ||
66 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \ | ||
67 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \ | ||
68 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \ | ||
69 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \ | ||
70 | " | ||
71 | FILES:${PN}-symlinks = "\ | ||
72 | ${bindir}/cc \ | ||
73 | ${bindir}/gcc \ | ||
74 | ${bindir}/gccbug \ | ||
75 | " | ||
76 | |||
77 | FILES:${PN}-plugins = "\ | ||
78 | ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \ | ||
79 | " | ||
80 | ALLOW_EMPTY:${PN}-plugins = "1" | ||
81 | |||
82 | FILES:g77 = "\ | ||
83 | ${bindir}/${TARGET_PREFIX}g77 \ | ||
84 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \ | ||
85 | " | ||
86 | FILES:g77-symlinks = "\ | ||
87 | ${bindir}/g77 \ | ||
88 | ${bindir}/f77 \ | ||
89 | " | ||
90 | RRECOMMENDS:g77 = "\ | ||
91 | libg2c \ | ||
92 | libg2c-dev \ | ||
93 | " | ||
94 | |||
95 | FILES:gfortran = "\ | ||
96 | ${bindir}/${TARGET_PREFIX}gfortran \ | ||
97 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \ | ||
98 | " | ||
99 | RRECOMMENDS:gfortran = "\ | ||
100 | libquadmath \ | ||
101 | libquadmath-dev \ | ||
102 | " | ||
103 | FILES:gfortran-symlinks = "\ | ||
104 | ${bindir}/gfortran \ | ||
105 | ${bindir}/f95" | ||
106 | |||
107 | FILES:cpp = "\ | ||
108 | ${bindir}/${TARGET_PREFIX}cpp* \ | ||
109 | ${base_libdir}/cpp \ | ||
110 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1" | ||
111 | FILES:cpp-symlinks = "${bindir}/cpp" | ||
112 | |||
113 | FILES:gcov = "${bindir}/${TARGET_PREFIX}gcov* \ | ||
114 | ${bindir}/${TARGET_PREFIX}gcov-tool* \ | ||
115 | " | ||
116 | FILES:gcov-symlinks = "${bindir}/gcov \ | ||
117 | ${bindir}/gcov-tool \ | ||
118 | " | ||
119 | |||
120 | FILES:g++ = "\ | ||
121 | ${bindir}/${TARGET_PREFIX}g++* \ | ||
122 | ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \ | ||
123 | " | ||
124 | FILES:g++-symlinks = "\ | ||
125 | ${bindir}/c++ \ | ||
126 | ${bindir}/g++ \ | ||
127 | " | ||
128 | RRECOMMENDS:g++ = "\ | ||
129 | libstdc++ \ | ||
130 | libstdc++-dev \ | ||
131 | libatomic \ | ||
132 | libatomic-dev \ | ||
133 | " | ||
134 | |||
135 | FILES:${PN}-doc = "\ | ||
136 | ${infodir} \ | ||
137 | ${mandir} \ | ||
138 | ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ | ||
139 | " | ||
140 | |||
141 | do_compile () { | ||
142 | # Prevent full target sysroot path from being used in configargs.h header, | ||
143 | # as it will be rewritten when used by other sysroots preventing support | ||
144 | # for gcc plugins. Additionally the path is embeddeded into the output | ||
145 | # binary, this prevents building a reproducible binary. | ||
146 | oe_runmake configure-gcc | ||
147 | sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h | ||
148 | sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h | ||
149 | |||
150 | # Prevent sysroot/workdir paths from being used in checksum-options. | ||
151 | # checksum-options is used to generate a checksum which is embedded into | ||
152 | # the output binary. | ||
153 | oe_runmake TARGET-gcc=checksum-options all-gcc | ||
154 | sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options | ||
155 | sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/checksum-options | ||
156 | |||
157 | oe_runmake all-host | ||
158 | } | ||
159 | |||
160 | do_install () { | ||
161 | oe_runmake 'DESTDIR=${D}' install-host | ||
162 | |||
163 | # Add unwind.h, it comes from libgcc which we don't want to build again | ||
164 | install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ | ||
165 | |||
166 | # Info dir listing isn't interesting at this point so remove it if it exists. | ||
167 | if [ -e "${D}${infodir}/dir" ]; then | ||
168 | rm -f ${D}${infodir}/dir | ||
169 | fi | ||
170 | |||
171 | # Cleanup some of the ${libdir}{,exec}/gcc stuff ... | ||
172 | rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
173 | rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools | ||
174 | rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la | ||
175 | rmdir ${D}${includedir} | ||
176 | rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
177 | |||
178 | # Hack around specs file assumptions | ||
179 | test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs | ||
180 | |||
181 | # Cleanup manpages.. | ||
182 | rm -rf ${D}${mandir}/man7 | ||
183 | |||
184 | # Don't package details about the build host | ||
185 | rm -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/plugin/include/auto-build.h | ||
186 | rm -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/plugin/include/bconfig.h | ||
187 | |||
188 | cd ${D}${bindir} | ||
189 | |||
190 | # We care about g++ not c++ | ||
191 | rm -f *c++* | ||
192 | |||
193 | # We don't care about the gcc-<version> ones for this | ||
194 | rm -f *gcc-?.?* | ||
195 | |||
196 | # Not sure why we end up with these but we don't want them... | ||
197 | rm -f ${TARGET_PREFIX}${TARGET_PREFIX}* | ||
198 | |||
199 | # Symlinks so we can use these trivially on the target | ||
200 | if [ -e ${TARGET_PREFIX}g77 ]; then | ||
201 | ln -sf ${TARGET_PREFIX}g77 g77 || true | ||
202 | ln -sf g77 f77 || true | ||
203 | fi | ||
204 | if [ -e ${TARGET_PREFIX}gfortran ]; then | ||
205 | ln -sf ${TARGET_PREFIX}gfortran gfortran || true | ||
206 | ln -sf gfortran f95 || true | ||
207 | fi | ||
208 | ln -sf ${TARGET_PREFIX}g++ g++ | ||
209 | ln -sf ${TARGET_PREFIX}gcc gcc | ||
210 | ln -sf ${TARGET_PREFIX}cpp cpp | ||
211 | ln -sf ${TARGET_PREFIX}gcov gcov | ||
212 | ln -sf ${TARGET_PREFIX}gcov-tool gcov-tool | ||
213 | install -d ${D}${base_libdir} | ||
214 | ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp | ||
215 | ln -sf g++ c++ | ||
216 | ln -sf gcc cc | ||
217 | |||
218 | chown -R root:root ${D} | ||
219 | } | ||
220 | |||
221 | do_install:append () { | ||
222 | # | ||
223 | # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header | ||
224 | # files and places the modified files into | ||
225 | # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the | ||
226 | # build not deterministic. The following code prunes all those headers | ||
227 | # except those under include-fixed/linux, *limits.h and README, yielding | ||
228 | # the same include-fixed folders no matter what sysroot | ||
229 | |||
230 | include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed" | ||
231 | for f in $(find ${include_fixed} -type f); do | ||
232 | case $f in | ||
233 | */include-fixed/linux/*) | ||
234 | continue | ||
235 | ;; | ||
236 | */include-fixed/*limits.h) | ||
237 | continue | ||
238 | ;; | ||
239 | */include-fixed/README) | ||
240 | continue | ||
241 | ;; | ||
242 | *) | ||
243 | # remove file and directory if empty | ||
244 | bbdebug 2 "Pruning $f" | ||
245 | rm $f | ||
246 | find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \; | ||
247 | ;; | ||
248 | esac | ||
249 | done | ||
250 | } | ||
251 | |||
252 | # Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross | ||
253 | # and one from here. These can confuse gcc cross where includes use #include_next | ||
254 | # and builds track file dependencies (e.g. perl and its makedepends code). | ||
255 | # For determinism we don't install this ever and rely on the copy from gcc-cross. | ||
256 | # [YOCTO #7287] | ||
257 | SYSROOT_DIRS_BLACKLIST += "${libdir}/gcc" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-testsuite.inc b/meta-microblaze/recipes-devtools/gcc/gcc-testsuite.inc deleted file mode 100644 index f68fec58..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc-testsuite.inc +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | inherit qemu | ||
2 | |||
3 | TOOLCHAIN_TEST_TARGET ??= "user" | ||
4 | TOOLCHAIN_TEST_HOST ??= "localhost" | ||
5 | TOOLCHAIN_TEST_HOST_USER ??= "root" | ||
6 | TOOLCHAIN_TEST_HOST_PORT ??= "2222" | ||
7 | |||
8 | MAKE_CHECK_BOARDFLAGS ??= "" | ||
9 | MAKE_CHECK_BOARDARGS ??= "--target_board=${TOOLCHAIN_TEST_TARGET}${MAKE_CHECK_BOARDFLAGS}" | ||
10 | |||
11 | python () { | ||
12 | # Provide the targets compiler args via targets options. This allows dejagnu to | ||
13 | # correctly mark incompatible tests as UNSUPPORTED (e.g. needs soft-float | ||
14 | # but running on hard-float target). | ||
15 | # | ||
16 | # These options are called "multilib_flags" within the gcc test suite. Most | ||
17 | # architectures handle these options in a sensible way such that tests that | ||
18 | # are incompatible with the provided multilib are marked as UNSUPPORTED. | ||
19 | # | ||
20 | # Note: multilib flags are added to the compile command after the args | ||
21 | # provided by any test (through dg-options), CFLAGS_FOR_TARGET is always | ||
22 | # added to the compile command before any other args but is not interpted | ||
23 | # as options like multilib flags. | ||
24 | # | ||
25 | # i686, x86-64 and aarch64 are special, since most toolchains built for | ||
26 | # these targets don't do multilib the tests do not get correctly marked as | ||
27 | # UNSUPPORTED. More importantly the test suite itself does not handle | ||
28 | # overriding the multilib flags where it could (like other archs do). As | ||
29 | # such do not pass the target compiler args for these targets. | ||
30 | args = d.getVar("TUNE_CCARGS").split() | ||
31 | if d.getVar("TUNE_ARCH") in ["i686", "x86_64", "aarch64"]: | ||
32 | args = [] | ||
33 | d.setVar("MAKE_CHECK_BOARDFLAGS", ("/" + "/".join(args)) if len(args) != 0 else "") | ||
34 | } | ||
35 | |||
36 | python check_prepare() { | ||
37 | def generate_qemu_linux_user_config(d): | ||
38 | content = [] | ||
39 | content.append('load_generic_config "sim"') | ||
40 | content.append('load_base_board_description "basic-sim"') | ||
41 | content.append('process_multilib_options ""') | ||
42 | |||
43 | # qemu args | ||
44 | qemu_binary = qemu_target_binary(d) | ||
45 | if not qemu_binary: | ||
46 | bb.fatal("Missing target qemu linux-user binary") | ||
47 | |||
48 | args = [] | ||
49 | # QEMU_OPTIONS is not always valid due to -cross recipe | ||
50 | args += ["-r", d.getVar("OLDEST_KERNEL")] | ||
51 | # enable all valid instructions, since the test suite itself does not | ||
52 | # limit itself to the target cpu options. | ||
53 | # - valid for x86*, powerpc, arm, arm64 | ||
54 | if qemu_binary.lstrip("qemu-") in ["x86_64", "i386", "ppc", "arm", "aarch64"]: | ||
55 | args += ["-cpu", "max"] | ||
56 | |||
57 | sysroot = d.getVar("RECIPE_SYSROOT") | ||
58 | args += ["-L", sysroot] | ||
59 | # lib paths are static here instead of using $libdir since this is used by a -cross recipe | ||
60 | libpaths = [sysroot + "/usr/lib", sysroot + "/lib"] | ||
61 | args += ["-E", "LD_LIBRARY_PATH={0}".format(":".join(libpaths))] | ||
62 | |||
63 | content.append('set_board_info is_simulator 1') | ||
64 | content.append('set_board_info sim "{0}"'.format(qemu_binary)) | ||
65 | content.append('set_board_info sim,options "{0}"'.format(" ".join(args))) | ||
66 | |||
67 | # target build/test config | ||
68 | content.append('set_board_info target_install {%s}' % d.getVar("TARGET_SYS")) | ||
69 | content.append('set_board_info ldscript ""') | ||
70 | #content.append('set_board_info needs_status_wrapper 1') # qemu-linux-user return codes work, and abort works fine | ||
71 | content.append('set_board_info gcc,stack_size 16834') | ||
72 | content.append('set_board_info gdb,nosignals 1') | ||
73 | content.append('set_board_info gcc,timeout 60') | ||
74 | |||
75 | return "\n".join(content) | ||
76 | |||
77 | def generate_remote_ssh_linux_config(d): | ||
78 | content = [] | ||
79 | content.append('load_generic_config "unix"') | ||
80 | content.append('process_multilib_options ""') | ||
81 | content.append("set_board_info hostname {0}".format(d.getVar("TOOLCHAIN_TEST_HOST"))) | ||
82 | content.append("set_board_info username {0}".format(d.getVar("TOOLCHAIN_TEST_HOST_USER"))) | ||
83 | |||
84 | port = d.getVar("TOOLCHAIN_TEST_HOST_PORT") | ||
85 | content.append("set_board_info rsh_prog \"/usr/bin/ssh -p {0} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no\"".format(port)) | ||
86 | content.append("set_board_info rcp_prog \"/usr/bin/scp -P {0} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no\"".format(port)) | ||
87 | |||
88 | return "\n".join(content) | ||
89 | |||
90 | dejagnudir = d.expand("${WORKDIR}/dejagnu") | ||
91 | if not os.path.isdir(dejagnudir): | ||
92 | os.makedirs(dejagnudir) | ||
93 | |||
94 | # write out target qemu board config | ||
95 | with open(os.path.join(dejagnudir, "user.exp"), "w") as f: | ||
96 | f.write(generate_qemu_linux_user_config(d)) | ||
97 | |||
98 | # write out target ssh board config | ||
99 | with open(os.path.join(dejagnudir, "ssh.exp"), "w") as f: | ||
100 | f.write(generate_remote_ssh_linux_config(d)) | ||
101 | |||
102 | # generate site.exp to provide boards | ||
103 | with open(os.path.join(dejagnudir, "site.exp"), "w") as f: | ||
104 | f.write("lappend boards_dir {0}\n".format(dejagnudir)) | ||
105 | f.write("set CFLAGS_FOR_TARGET \"{0}\"\n".format(d.getVar("TOOLCHAIN_OPTIONS"))) | ||
106 | } | ||
107 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch deleted file mode 100644 index c060accd..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From fd2ec4542fd2975e6d3f2f1c1a2639945a84f9e1 Mon Sep 17 00:00:00 2001 | ||
5 | From: Jakub Jelinek <jakub@redhat.com> | ||
6 | Date: Mon, 3 Aug 2020 22:55:28 +0200 | ||
7 | Subject: [PATCH] aarch64: Fix up __aarch64_cas16_acq_rel fallback | ||
8 | |||
9 | As mentioned in the PR, the fallback path when LSE is unavailable writes | ||
10 | incorrect registers to the memory if the previous content compares equal | ||
11 | to x0, x1 - it writes copy of x0, x1 from the start of function, but it | ||
12 | should write x2, x3. | ||
13 | |||
14 | 2020-08-03 Jakub Jelinek <jakub@redhat.com> | ||
15 | |||
16 | PR target/96402 | ||
17 | * config/aarch64/lse.S (__aarch64_cas16_acq_rel): Use x2, x3 instead | ||
18 | of x(tmp0), x(tmp1) in STXP arguments. | ||
19 | |||
20 | * gcc.target/aarch64/pr96402.c: New test. | ||
21 | |||
22 | (cherry picked from commit 90b43856fdff7d96d93d22970eca8a86c56e0ddc) | ||
23 | --- | ||
24 | gcc/testsuite/gcc.target/aarch64/pr96402.c | 16 ++++++++++++++++ | ||
25 | libgcc/config/aarch64/lse.S | 2 +- | ||
26 | 2 files changed, 17 insertions(+), 1 deletion(-) | ||
27 | create mode 100644 gcc/testsuite/gcc.target/aarch64/pr96402.c | ||
28 | |||
29 | diff --git a/gcc/testsuite/gcc.target/aarch64/pr96402.c b/gcc/testsuite/gcc.target/aarch64/pr96402.c | ||
30 | new file mode 100644 | ||
31 | index 00000000000..fa2dddfac15 | ||
32 | --- /dev/null | ||
33 | +++ b/gcc/testsuite/gcc.target/aarch64/pr96402.c | ||
34 | @@ -0,0 +1,16 @@ | ||
35 | +/* PR target/96402 */ | ||
36 | +/* { dg-do run { target int128 } } */ | ||
37 | +/* { dg-options "-moutline-atomics" } */ | ||
38 | + | ||
39 | +int | ||
40 | +main () | ||
41 | +{ | ||
42 | + __int128 a = 0; | ||
43 | + __sync_val_compare_and_swap (&a, (__int128) 0, (__int128) 1); | ||
44 | + if (a != 1) | ||
45 | + __builtin_abort (); | ||
46 | + __sync_val_compare_and_swap (&a, (__int128) 1, (((__int128) 0xdeadbeeffeedbac1ULL) << 64) | 0xabadcafe00c0ffeeULL); | ||
47 | + if (a != ((((__int128) 0xdeadbeeffeedbac1ULL) << 64) | 0xabadcafe00c0ffeeULL)) | ||
48 | + __builtin_abort (); | ||
49 | + return 0; | ||
50 | +} | ||
51 | diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S | ||
52 | index 64691c601c1..c8fbfbce4fd 100644 | ||
53 | --- a/libgcc/config/aarch64/lse.S | ||
54 | +++ b/libgcc/config/aarch64/lse.S | ||
55 | @@ -203,7 +203,7 @@ STARTFN NAME(cas) | ||
56 | cmp x0, x(tmp0) | ||
57 | ccmp x1, x(tmp1), #0, eq | ||
58 | bne 1f | ||
59 | - STXP w(tmp2), x(tmp0), x(tmp1), [x4] | ||
60 | + STXP w(tmp2), x2, x3, [x4] | ||
61 | cbnz w(tmp2), 0b | ||
62 | 1: ret | ||
63 | |||
64 | -- | ||
65 | 2.26.2 | ||
66 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch deleted file mode 100644 index 73de4c75..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch +++ /dev/null | |||
@@ -1,202 +0,0 @@ | |||
1 | CVE: CVE-2020-13844 | ||
2 | Upstream-Status: Backport | ||
3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
4 | |||
5 | From 1ff243934ac443b5f58cd02a5012ce58ecc31fb2 Mon Sep 17 00:00:00 2001 | ||
6 | From: Matthew Malcomson <matthew.malcomson@arm.com> | ||
7 | Date: Thu, 9 Jul 2020 09:11:58 +0100 | ||
8 | Subject: [PATCH 1/3] aarch64: New Straight Line Speculation (SLS) mitigation | ||
9 | flags | ||
10 | |||
11 | Here we introduce the flags that will be used for straight line speculation. | ||
12 | |||
13 | The new flag introduced is `-mharden-sls=`. | ||
14 | This flag can take arguments of `none`, `all`, or a comma seperated list of one | ||
15 | or more of `retbr` or `blr`. | ||
16 | `none` indicates no special mitigation of the straight line speculation | ||
17 | vulnerability. | ||
18 | `all` requests all mitigations currently implemented. | ||
19 | `retbr` requests that the RET and BR instructions have a speculation barrier | ||
20 | inserted after them. | ||
21 | `blr` requests that BLR instructions are replaced by a BL to a function stub | ||
22 | using a BR with a speculation barrier after it. | ||
23 | |||
24 | Setting this on a per-function basis using attributes or the like is not | ||
25 | enabled, but may be in the future. | ||
26 | |||
27 | gcc/ChangeLog: | ||
28 | |||
29 | 2020-06-02 Matthew Malcomson <matthew.malcomson@arm.com> | ||
30 | |||
31 | * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p): | ||
32 | New. | ||
33 | (aarch64_harden_sls_blr_p): New. | ||
34 | * config/aarch64/aarch64.c (enum aarch64_sls_hardening_type): | ||
35 | New. | ||
36 | (aarch64_harden_sls_retbr_p): New. | ||
37 | (aarch64_harden_sls_blr_p): New. | ||
38 | (aarch64_validate_sls_mitigation): New. | ||
39 | (aarch64_override_options): Parse options for SLS mitigation. | ||
40 | * config/aarch64/aarch64.opt (-mharden-sls): New option. | ||
41 | * doc/invoke.texi: Document new option. | ||
42 | --- | ||
43 | gcc/config/aarch64/aarch64-protos.h | 3 ++ | ||
44 | gcc/config/aarch64/aarch64.c | 76 +++++++++++++++++++++++++++++++++++++ | ||
45 | gcc/config/aarch64/aarch64.opt | 4 ++ | ||
46 | gcc/doc/invoke.texi | 12 ++++++ | ||
47 | 4 files changed, 95 insertions(+) | ||
48 | |||
49 | diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h | ||
50 | index 723d9ba..eb5f4b4 100644 | ||
51 | --- a/gcc/config/aarch64/aarch64-protos.h | ||
52 | +++ b/gcc/config/aarch64/aarch64-protos.h | ||
53 | @@ -781,4 +781,7 @@ extern const atomic_ool_names aarch64_ool_ldeor_names; | ||
54 | |||
55 | tree aarch64_resolve_overloaded_builtin_general (location_t, tree, void *); | ||
56 | |||
57 | +extern bool aarch64_harden_sls_retbr_p (void); | ||
58 | +extern bool aarch64_harden_sls_blr_p (void); | ||
59 | + | ||
60 | #endif /* GCC_AARCH64_PROTOS_H */ | ||
61 | diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c | ||
62 | index b86434a..437a9cf 100644 | ||
63 | --- a/gcc/config/aarch64/aarch64.c | ||
64 | +++ b/gcc/config/aarch64/aarch64.c | ||
65 | @@ -14494,6 +14494,79 @@ aarch64_validate_mcpu (const char *str, const struct processor **res, | ||
66 | return false; | ||
67 | } | ||
68 | |||
69 | +/* Straight line speculation indicators. */ | ||
70 | +enum aarch64_sls_hardening_type | ||
71 | +{ | ||
72 | + SLS_NONE = 0, | ||
73 | + SLS_RETBR = 1, | ||
74 | + SLS_BLR = 2, | ||
75 | + SLS_ALL = 3, | ||
76 | +}; | ||
77 | +static enum aarch64_sls_hardening_type aarch64_sls_hardening; | ||
78 | + | ||
79 | +/* Return whether we should mitigatate Straight Line Speculation for the RET | ||
80 | + and BR instructions. */ | ||
81 | +bool | ||
82 | +aarch64_harden_sls_retbr_p (void) | ||
83 | +{ | ||
84 | + return aarch64_sls_hardening & SLS_RETBR; | ||
85 | +} | ||
86 | + | ||
87 | +/* Return whether we should mitigatate Straight Line Speculation for the BLR | ||
88 | + instruction. */ | ||
89 | +bool | ||
90 | +aarch64_harden_sls_blr_p (void) | ||
91 | +{ | ||
92 | + return aarch64_sls_hardening & SLS_BLR; | ||
93 | +} | ||
94 | + | ||
95 | +/* As of yet we only allow setting these options globally, in the future we may | ||
96 | + allow setting them per function. */ | ||
97 | +static void | ||
98 | +aarch64_validate_sls_mitigation (const char *const_str) | ||
99 | +{ | ||
100 | + char *token_save = NULL; | ||
101 | + char *str = NULL; | ||
102 | + | ||
103 | + if (strcmp (const_str, "none") == 0) | ||
104 | + { | ||
105 | + aarch64_sls_hardening = SLS_NONE; | ||
106 | + return; | ||
107 | + } | ||
108 | + if (strcmp (const_str, "all") == 0) | ||
109 | + { | ||
110 | + aarch64_sls_hardening = SLS_ALL; | ||
111 | + return; | ||
112 | + } | ||
113 | + | ||
114 | + char *str_root = xstrdup (const_str); | ||
115 | + str = strtok_r (str_root, ",", &token_save); | ||
116 | + if (!str) | ||
117 | + error ("invalid argument given to %<-mharden-sls=%>"); | ||
118 | + | ||
119 | + int temp = SLS_NONE; | ||
120 | + while (str) | ||
121 | + { | ||
122 | + if (strcmp (str, "blr") == 0) | ||
123 | + temp |= SLS_BLR; | ||
124 | + else if (strcmp (str, "retbr") == 0) | ||
125 | + temp |= SLS_RETBR; | ||
126 | + else if (strcmp (str, "none") == 0 || strcmp (str, "all") == 0) | ||
127 | + { | ||
128 | + error ("%<%s%> must be by itself for %<-mharden-sls=%>", str); | ||
129 | + break; | ||
130 | + } | ||
131 | + else | ||
132 | + { | ||
133 | + error ("invalid argument %<%s%> for %<-mharden-sls=%>", str); | ||
134 | + break; | ||
135 | + } | ||
136 | + str = strtok_r (NULL, ",", &token_save); | ||
137 | + } | ||
138 | + aarch64_sls_hardening = (aarch64_sls_hardening_type) temp; | ||
139 | + free (str_root); | ||
140 | +} | ||
141 | + | ||
142 | /* Parses CONST_STR for branch protection features specified in | ||
143 | aarch64_branch_protect_types, and set any global variables required. Returns | ||
144 | the parsing result and assigns LAST_STR to the last processed token from | ||
145 | @@ -14738,6 +14811,9 @@ aarch64_override_options (void) | ||
146 | selected_arch = NULL; | ||
147 | selected_tune = NULL; | ||
148 | |||
149 | + if (aarch64_harden_sls_string) | ||
150 | + aarch64_validate_sls_mitigation (aarch64_harden_sls_string); | ||
151 | + | ||
152 | if (aarch64_branch_protection_string) | ||
153 | aarch64_validate_mbranch_protection (aarch64_branch_protection_string); | ||
154 | |||
155 | diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt | ||
156 | index d99d14c..5170361 100644 | ||
157 | --- a/gcc/config/aarch64/aarch64.opt | ||
158 | +++ b/gcc/config/aarch64/aarch64.opt | ||
159 | @@ -71,6 +71,10 @@ mgeneral-regs-only | ||
160 | Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Save | ||
161 | Generate code which uses only the general registers. | ||
162 | |||
163 | +mharden-sls= | ||
164 | +Target RejectNegative Joined Var(aarch64_harden_sls_string) | ||
165 | +Generate code to mitigate against straight line speculation. | ||
166 | + | ||
167 | mfix-cortex-a53-835769 | ||
168 | Target Report Var(aarch64_fix_a53_err835769) Init(2) Save | ||
169 | Workaround for ARM Cortex-A53 Erratum number 835769. | ||
170 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi | ||
171 | index a2794a6..bd5b77a 100644 | ||
172 | --- a/gcc/doc/invoke.texi | ||
173 | +++ b/gcc/doc/invoke.texi | ||
174 | @@ -696,6 +696,7 @@ Objective-C and Objective-C++ Dialects}. | ||
175 | -msign-return-address=@var{scope} @gol | ||
176 | -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf} | ||
177 | +@var{b-key}]|@var{bti} @gol | ||
178 | +-mharden-sls=@var{opts} @gol | ||
179 | -march=@var{name} -mcpu=@var{name} -mtune=@var{name} @gol | ||
180 | -moverride=@var{string} -mverbose-cost-dump @gol | ||
181 | -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{sysreg} @gol | ||
182 | @@ -17065,6 +17066,17 @@ functions. The optional argument @samp{b-key} can be used to sign the functions | ||
183 | with the B-key instead of the A-key. | ||
184 | @samp{bti} turns on branch target identification mechanism. | ||
185 | |||
186 | +@item -mharden-sls=@var{opts} | ||
187 | +@opindex mharden-sls | ||
188 | +Enable compiler hardening against straight line speculation (SLS). | ||
189 | +@var{opts} is a comma-separated list of the following options: | ||
190 | +@table @samp | ||
191 | +@item retbr | ||
192 | +@item blr | ||
193 | +@end table | ||
194 | +In addition, @samp{-mharden-sls=all} enables all SLS hardening while | ||
195 | +@samp{-mharden-sls=none} disables all SLS hardening. | ||
196 | + | ||
197 | @item -msve-vector-bits=@var{bits} | ||
198 | @opindex msve-vector-bits | ||
199 | Specify the number of bits in an SVE vector register. This option only has | ||
200 | -- | ||
201 | 2.7.4 | ||
202 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch deleted file mode 100644 index 82ae9f8d..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From f2a5dc3bc7e5727d6bf77e1c6e8a31a6f000883d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 08:37:11 +0400 | ||
4 | Subject: [PATCH] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | |||
8 | Upstream-Status: Inappropriate [embedded specific] | ||
9 | --- | ||
10 | configure | 2 +- | ||
11 | configure.ac | 2 +- | ||
12 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/configure b/configure | ||
15 | index 4cc938ebb7d..226a64939d1 100755 | ||
16 | --- a/configure | ||
17 | +++ b/configure | ||
18 | @@ -7722,7 +7722,7 @@ fi | ||
19 | # for target_alias and gcc doesn't manage it consistently. | ||
20 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
21 | |||
22 | -FLAGS_FOR_TARGET= | ||
23 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
24 | case " $target_configdirs " in | ||
25 | *" newlib "*) | ||
26 | case " $target_configargs " in | ||
27 | diff --git a/configure.ac b/configure.ac | ||
28 | index c78d9cbea62..f024f4bac9b 100644 | ||
29 | --- a/configure.ac | ||
30 | +++ b/configure.ac | ||
31 | @@ -3227,7 +3227,7 @@ fi | ||
32 | # for target_alias and gcc doesn't manage it consistently. | ||
33 | target_configargs="--cache-file=./config.cache ${target_configargs}" | ||
34 | |||
35 | -FLAGS_FOR_TARGET= | ||
36 | +FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" | ||
37 | case " $target_configdirs " in | ||
38 | *" newlib "*) | ||
39 | case " $target_configargs " in | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch deleted file mode 100644 index addecb4b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch +++ /dev/null | |||
@@ -1,208 +0,0 @@ | |||
1 | From 2824d2418605e092899117e77bc8ebf332321807 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jakub Jelinek <jakub@redhat.com> | ||
3 | Date: Fri, 15 Jan 2021 13:12:59 +0100 | ||
4 | Subject: [PATCH] libatomic, libgomp, libitc: Fix bootstrap [PR70454] | ||
5 | |||
6 | The recent changes to error on mixing -march=i386 and -fcf-protection broke | ||
7 | bootstrap. This patch changes lib{atomic,gomp,itm} configury, so that it | ||
8 | only adds -march=i486 to flags if really needed (i.e. when 486 or later isn't | ||
9 | on by default already). Similarly, it will not use ifuncs if -mcx16 | ||
10 | (or -march=i686 for 32-bit) is on by default. | ||
11 | |||
12 | 2021-01-15 Jakub Jelinek <jakub@redhat.com> | ||
13 | |||
14 | PR target/70454 | ||
15 | libatomic/ | ||
16 | * configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to | ||
17 | be added through preprocessor check on | ||
18 | __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. Determine if try_ifunc is needed | ||
19 | based on preprocessor check on __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 | ||
20 | or __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8. | ||
21 | libgomp/ | ||
22 | * configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to | ||
23 | be added through preprocessor check on | ||
24 | __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. | ||
25 | libitm/ | ||
26 | * configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to | ||
27 | be added through preprocessor check on | ||
28 | __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. | ||
29 | |||
30 | Upstream-Status: Backport [master post 10.x release] | ||
31 | --- | ||
32 | libatomic/configure.tgt | 56 +++++++++++++++++++++++------------------ | ||
33 | libgomp/configure.tgt | 35 +++++++++++--------------- | ||
34 | libitm/configure.tgt | 37 +++++++++++++-------------- | ||
35 | 3 files changed, 64 insertions(+), 64 deletions(-) | ||
36 | |||
37 | diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt | ||
38 | index 5dd0926d20..6ea082a29b 100644 | ||
39 | --- a/libatomic/configure.tgt | ||
40 | +++ b/libatomic/configure.tgt | ||
41 | @@ -81,32 +81,40 @@ case "${target_cpu}" in | ||
42 | ARCH=sparc | ||
43 | ;; | ||
44 | |||
45 | - i[3456]86) | ||
46 | - case " ${CC} ${CFLAGS} " in | ||
47 | - *" -m64 "*|*" -mx32 "*) | ||
48 | - ;; | ||
49 | - *) | ||
50 | - if test -z "$with_arch"; then | ||
51 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
52 | - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
53 | - fi | ||
54 | - esac | ||
55 | - ARCH=x86 | ||
56 | - # ??? Detect when -march=i686 is already enabled. | ||
57 | - try_ifunc=yes | ||
58 | - ;; | ||
59 | - x86_64) | ||
60 | - case " ${CC} ${CFLAGS} " in | ||
61 | - *" -m32 "*) | ||
62 | + i[3456]86 | x86_64) | ||
63 | + cat > conftestx.c <<EOF | ||
64 | +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 | ||
65 | +#error need -march=i486 | ||
66 | +#endif | ||
67 | +EOF | ||
68 | + if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then | ||
69 | + : | ||
70 | + else | ||
71 | + if test "${target_cpu}" = x86_64; then | ||
72 | XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
73 | - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
74 | - ;; | ||
75 | - *) | ||
76 | - ;; | ||
77 | - esac | ||
78 | + else | ||
79 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
80 | + fi | ||
81 | + XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
82 | + fi | ||
83 | + cat > conftestx.c <<EOF | ||
84 | +#ifdef __x86_64__ | ||
85 | +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 | ||
86 | +#error need -mcx16 | ||
87 | +#endif | ||
88 | +#else | ||
89 | +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 | ||
90 | +#error need -march=i686 | ||
91 | +#endif | ||
92 | +#endif | ||
93 | +EOF | ||
94 | + if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then | ||
95 | + try_ifunc=no | ||
96 | + else | ||
97 | + try_ifunc=yes | ||
98 | + fi | ||
99 | + rm -f conftestx.c | ||
100 | ARCH=x86 | ||
101 | - # ??? Detect when -mcx16 is already enabled. | ||
102 | - try_ifunc=yes | ||
103 | ;; | ||
104 | |||
105 | *) ARCH="${target_cpu}" ;; | ||
106 | diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt | ||
107 | index 4790a31e39..761ef2a7db 100644 | ||
108 | --- a/libgomp/configure.tgt | ||
109 | +++ b/libgomp/configure.tgt | ||
110 | @@ -70,28 +70,23 @@ if test x$enable_linux_futex = xyes; then | ||
111 | ;; | ||
112 | |||
113 | # Note that bare i386 is not included here. We need cmpxchg. | ||
114 | - i[456]86-*-linux*) | ||
115 | + i[456]86-*-linux* | x86_64-*-linux*) | ||
116 | config_path="linux/x86 linux posix" | ||
117 | - case " ${CC} ${CFLAGS} " in | ||
118 | - *" -m64 "*|*" -mx32 "*) | ||
119 | - ;; | ||
120 | - *) | ||
121 | - if test -z "$with_arch"; then | ||
122 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
123 | - fi | ||
124 | - esac | ||
125 | - ;; | ||
126 | - | ||
127 | - # Similar jiggery-pokery for x86_64 multilibs, except here we | ||
128 | - # can't rely on the --with-arch configure option, since that | ||
129 | - # applies to the 64-bit side. | ||
130 | - x86_64-*-linux*) | ||
131 | - config_path="linux/x86 linux posix" | ||
132 | - case " ${CC} ${CFLAGS} " in | ||
133 | - *" -m32 "*) | ||
134 | + cat > conftestx.c <<EOF | ||
135 | +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 | ||
136 | +#error need -march=i486 | ||
137 | +#endif | ||
138 | +EOF | ||
139 | + if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then | ||
140 | + : | ||
141 | + else | ||
142 | + if test "${target_cpu}" = x86_64; then | ||
143 | XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
144 | - ;; | ||
145 | - esac | ||
146 | + else | ||
147 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
148 | + fi | ||
149 | + fi | ||
150 | + rm -f conftestx.c | ||
151 | ;; | ||
152 | |||
153 | # Note that sparcv7 and sparcv8 is not included here. We need cas. | ||
154 | diff --git a/libitm/configure.tgt b/libitm/configure.tgt | ||
155 | index 04109160e9..ca62bac627 100644 | ||
156 | --- a/libitm/configure.tgt | ||
157 | +++ b/libitm/configure.tgt | ||
158 | @@ -58,16 +58,23 @@ case "${target_cpu}" in | ||
159 | |||
160 | arm*) ARCH=arm ;; | ||
161 | |||
162 | - i[3456]86) | ||
163 | - case " ${CC} ${CFLAGS} " in | ||
164 | - *" -m64 "*|*" -mx32 "*) | ||
165 | - ;; | ||
166 | - *) | ||
167 | - if test -z "$with_arch"; then | ||
168 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
169 | - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
170 | - fi | ||
171 | - esac | ||
172 | + i[3456]86 | x86_64) | ||
173 | + cat > conftestx.c <<EOF | ||
174 | +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 | ||
175 | +#error need -march=i486 | ||
176 | +#endif | ||
177 | +EOF | ||
178 | + if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then | ||
179 | + : | ||
180 | + else | ||
181 | + if test "${target_cpu}" = x86_64; then | ||
182 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
183 | + else | ||
184 | + XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" | ||
185 | + fi | ||
186 | + XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
187 | + fi | ||
188 | + rm -f conftestx.c | ||
189 | XCFLAGS="${XCFLAGS} -mrtm" | ||
190 | ARCH=x86 | ||
191 | ;; | ||
192 | @@ -102,16 +109,6 @@ case "${target_cpu}" in | ||
193 | ARCH=sparc | ||
194 | ;; | ||
195 | |||
196 | - x86_64) | ||
197 | - case " ${CC} ${CFLAGS} " in | ||
198 | - *" -m32 "*) | ||
199 | - XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" | ||
200 | - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" | ||
201 | - ;; | ||
202 | - esac | ||
203 | - XCFLAGS="${XCFLAGS} -mrtm" | ||
204 | - ARCH=x86 | ||
205 | - ;; | ||
206 | s390|s390x) | ||
207 | XCFLAGS="${XCFLAGS} -mzarch -mhtm" | ||
208 | ARCH=s390 | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch deleted file mode 100644 index 823cc8b6..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch +++ /dev/null | |||
@@ -1,607 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From b1204d16e1ec96a4aa89e44de8990e2499ffdb22 Mon Sep 17 00:00:00 2001 | ||
5 | From: Matthew Malcomson <matthew.malcomson@arm.com> | ||
6 | Date: Thu, 9 Jul 2020 09:11:59 +0100 | ||
7 | Subject: [PATCH 2/3] aarch64: Introduce SLS mitigation for RET and BR | ||
8 | instructions | ||
9 | |||
10 | Instructions following RET or BR are not necessarily executed. In order | ||
11 | to avoid speculation past RET and BR we can simply append a speculation | ||
12 | barrier. | ||
13 | |||
14 | Since these speculation barriers will not be architecturally executed, | ||
15 | they are not expected to add a high performance penalty. | ||
16 | |||
17 | The speculation barrier is to be SB when targeting architectures which | ||
18 | have this enabled, and DSB SY + ISB otherwise. | ||
19 | |||
20 | We add tests for each of the cases where such an instruction was seen. | ||
21 | |||
22 | This is implemented by modifying each machine description pattern that | ||
23 | emits either a RET or a BR instruction. We choose not to use something | ||
24 | like `TARGET_ASM_FUNCTION_EPILOGUE` since it does not affect the | ||
25 | `indirect_jump`, `jump`, `sibcall_insn` and `sibcall_value_insn` | ||
26 | patterns and we find it preferable to implement the functionality in the | ||
27 | same way for every pattern. | ||
28 | |||
29 | There is one particular case which is slightly tricky. The | ||
30 | implementation of TARGET_ASM_TRAMPOLINE_TEMPLATE uses a BR which needs | ||
31 | to be mitigated against. The trampoline template is used *once* per | ||
32 | compilation unit, and the TRAMPOLINE_SIZE is exposed to the user via the | ||
33 | builtin macro __LIBGCC_TRAMPOLINE_SIZE__. | ||
34 | In the future we may implement function specific attributes to turn on | ||
35 | and off hardening on a per-function basis. | ||
36 | The fixed nature of the trampoline described above implies it will be | ||
37 | safer to ensure this speculation barrier is always used. | ||
38 | |||
39 | Testing: | ||
40 | Bootstrap and regtest done on aarch64-none-linux | ||
41 | Used a temporary hack(1) to use these options on every test in the | ||
42 | testsuite and a script to check that the output never emitted an | ||
43 | unmitigated RET or BR. | ||
44 | |||
45 | 1) Temporary hack was a change to the testsuite to always use | ||
46 | `-save-temps` and run a script on the assembly output of those | ||
47 | compilations which produced one to ensure every RET or BR is immediately | ||
48 | followed by a speculation barrier. | ||
49 | |||
50 | gcc/ChangeLog: | ||
51 | |||
52 | * config/aarch64/aarch64-protos.h (aarch64_sls_barrier): New. | ||
53 | * config/aarch64/aarch64.c (aarch64_output_casesi): Emit | ||
54 | speculation barrier after BR instruction if needs be. | ||
55 | (aarch64_trampoline_init): Handle ptr_mode value & adjust size | ||
56 | of code copied. | ||
57 | (aarch64_sls_barrier): New. | ||
58 | (aarch64_asm_trampoline_template): Add needed barriers. | ||
59 | * config/aarch64/aarch64.h (AARCH64_ISA_SB): New. | ||
60 | (TARGET_SB): New. | ||
61 | (TRAMPOLINE_SIZE): Account for barrier. | ||
62 | * config/aarch64/aarch64.md (indirect_jump, *casesi_dispatch, | ||
63 | simple_return, *do_return, *sibcall_insn, *sibcall_value_insn): | ||
64 | Emit barrier if needs be, also account for possible barrier using | ||
65 | "sls_length" attribute. | ||
66 | (sls_length): New attribute. | ||
67 | (length): Determine default using any non-default sls_length | ||
68 | value. | ||
69 | |||
70 | gcc/testsuite/ChangeLog: | ||
71 | |||
72 | * gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c: New test. | ||
73 | * gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c: | ||
74 | New test. | ||
75 | * gcc.target/aarch64/sls-mitigation/sls-mitigation.exp: New file. | ||
76 | * lib/target-supports.exp (check_effective_target_aarch64_asm_sb_ok): | ||
77 | New proc. | ||
78 | --- | ||
79 | gcc/config/aarch64/aarch64-protos.h | 1 + | ||
80 | gcc/config/aarch64/aarch64.c | 41 ++++++- | ||
81 | gcc/config/aarch64/aarch64.h | 10 +- | ||
82 | gcc/config/aarch64/aarch64.md | 76 +++++++++---- | ||
83 | .../aarch64/sls-mitigation/sls-miti-retbr-pacret.c | 21 ++++ | ||
84 | .../aarch64/sls-mitigation/sls-miti-retbr.c | 119 +++++++++++++++++++++ | ||
85 | .../aarch64/sls-mitigation/sls-mitigation.exp | 73 +++++++++++++ | ||
86 | gcc/testsuite/lib/target-supports.exp | 2 +- | ||
87 | 8 files changed, 318 insertions(+), 25 deletions(-) | ||
88 | create mode 100644 gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c | ||
89 | create mode 100644 gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c | ||
90 | create mode 100644 gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp | ||
91 | |||
92 | diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h | ||
93 | index eb5f4b4..ee0ffde 100644 | ||
94 | --- a/gcc/config/aarch64/aarch64-protos.h | ||
95 | +++ b/gcc/config/aarch64/aarch64-protos.h | ||
96 | @@ -781,6 +781,7 @@ extern const atomic_ool_names aarch64_ool_ldeor_names; | ||
97 | |||
98 | tree aarch64_resolve_overloaded_builtin_general (location_t, tree, void *); | ||
99 | |||
100 | +const char *aarch64_sls_barrier (int); | ||
101 | extern bool aarch64_harden_sls_retbr_p (void); | ||
102 | extern bool aarch64_harden_sls_blr_p (void); | ||
103 | |||
104 | diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c | ||
105 | index 437a9cf..44e3d1f 100644 | ||
106 | --- a/gcc/config/aarch64/aarch64.c | ||
107 | +++ b/gcc/config/aarch64/aarch64.c | ||
108 | @@ -10852,8 +10852,8 @@ aarch64_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) | ||
109 | static void | ||
110 | aarch64_asm_trampoline_template (FILE *f) | ||
111 | { | ||
112 | - int offset1 = 16; | ||
113 | - int offset2 = 20; | ||
114 | + int offset1 = 24; | ||
115 | + int offset2 = 28; | ||
116 | |||
117 | if (aarch64_bti_enabled ()) | ||
118 | { | ||
119 | @@ -10876,6 +10876,17 @@ aarch64_asm_trampoline_template (FILE *f) | ||
120 | } | ||
121 | asm_fprintf (f, "\tbr\t%s\n", reg_names [IP1_REGNUM]); | ||
122 | |||
123 | + /* We always emit a speculation barrier. | ||
124 | + This is because the same trampoline template is used for every nested | ||
125 | + function. Since nested functions are not particularly common or | ||
126 | + performant we don't worry too much about the extra instructions to copy | ||
127 | + around. | ||
128 | + This is not yet a problem, since we have not yet implemented function | ||
129 | + specific attributes to choose between hardening against straight line | ||
130 | + speculation or not, but such function specific attributes are likely to | ||
131 | + happen in the future. */ | ||
132 | + asm_fprintf (f, "\tdsb\tsy\n\tisb\n"); | ||
133 | + | ||
134 | /* The trampoline needs an extra padding instruction. In case if BTI is | ||
135 | enabled the padding instruction is replaced by the BTI instruction at | ||
136 | the beginning. */ | ||
137 | @@ -10890,10 +10901,14 @@ static void | ||
138 | aarch64_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) | ||
139 | { | ||
140 | rtx fnaddr, mem, a_tramp; | ||
141 | - const int tramp_code_sz = 16; | ||
142 | + const int tramp_code_sz = 24; | ||
143 | |||
144 | /* Don't need to copy the trailing D-words, we fill those in below. */ | ||
145 | - emit_block_move (m_tramp, assemble_trampoline_template (), | ||
146 | + /* We create our own memory address in Pmode so that `emit_block_move` can | ||
147 | + use parts of the backend which expect Pmode addresses. */ | ||
148 | + rtx temp = convert_memory_address (Pmode, XEXP (m_tramp, 0)); | ||
149 | + emit_block_move (gen_rtx_MEM (BLKmode, temp), | ||
150 | + assemble_trampoline_template (), | ||
151 | GEN_INT (tramp_code_sz), BLOCK_OP_NORMAL); | ||
152 | mem = adjust_address (m_tramp, ptr_mode, tramp_code_sz); | ||
153 | fnaddr = XEXP (DECL_RTL (fndecl), 0); | ||
154 | @@ -11084,6 +11099,8 @@ aarch64_output_casesi (rtx *operands) | ||
155 | output_asm_insn (buf, operands); | ||
156 | output_asm_insn (patterns[index][1], operands); | ||
157 | output_asm_insn ("br\t%3", operands); | ||
158 | + output_asm_insn (aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()), | ||
159 | + operands); | ||
160 | assemble_label (asm_out_file, label); | ||
161 | return ""; | ||
162 | } | ||
163 | @@ -22924,6 +22941,22 @@ aarch64_file_end_indicate_exec_stack () | ||
164 | #undef GNU_PROPERTY_AARCH64_FEATURE_1_BTI | ||
165 | #undef GNU_PROPERTY_AARCH64_FEATURE_1_AND | ||
166 | |||
167 | +/* Helper function for straight line speculation. | ||
168 | + Return what barrier should be emitted for straight line speculation | ||
169 | + mitigation. | ||
170 | + When not mitigating against straight line speculation this function returns | ||
171 | + an empty string. | ||
172 | + When mitigating against straight line speculation, use: | ||
173 | + * SB when the v8.5-A SB extension is enabled. | ||
174 | + * DSB+ISB otherwise. */ | ||
175 | +const char * | ||
176 | +aarch64_sls_barrier (int mitigation_required) | ||
177 | +{ | ||
178 | + return mitigation_required | ||
179 | + ? (TARGET_SB ? "sb" : "dsb\tsy\n\tisb") | ||
180 | + : ""; | ||
181 | +} | ||
182 | + | ||
183 | /* Target-specific selftests. */ | ||
184 | |||
185 | #if CHECKING_P | ||
186 | diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h | ||
187 | index 1ce23c6..c21015f 100644 | ||
188 | --- a/gcc/config/aarch64/aarch64.h | ||
189 | +++ b/gcc/config/aarch64/aarch64.h | ||
190 | @@ -281,6 +281,7 @@ extern unsigned aarch64_architecture_version; | ||
191 | #define AARCH64_ISA_F32MM (aarch64_isa_flags & AARCH64_FL_F32MM) | ||
192 | #define AARCH64_ISA_F64MM (aarch64_isa_flags & AARCH64_FL_F64MM) | ||
193 | #define AARCH64_ISA_BF16 (aarch64_isa_flags & AARCH64_FL_BF16) | ||
194 | +#define AARCH64_ISA_SB (aarch64_isa_flags & AARCH64_FL_SB) | ||
195 | |||
196 | /* Crypto is an optional extension to AdvSIMD. */ | ||
197 | #define TARGET_CRYPTO (TARGET_SIMD && AARCH64_ISA_CRYPTO) | ||
198 | @@ -378,6 +379,9 @@ extern unsigned aarch64_architecture_version; | ||
199 | #define TARGET_FIX_ERR_A53_835769_DEFAULT 1 | ||
200 | #endif | ||
201 | |||
202 | +/* SB instruction is enabled through +sb. */ | ||
203 | +#define TARGET_SB (AARCH64_ISA_SB) | ||
204 | + | ||
205 | /* Apply the workaround for Cortex-A53 erratum 835769. */ | ||
206 | #define TARGET_FIX_ERR_A53_835769 \ | ||
207 | ((aarch64_fix_a53_err835769 == 2) \ | ||
208 | @@ -1058,8 +1062,10 @@ typedef struct | ||
209 | |||
210 | #define RETURN_ADDR_RTX aarch64_return_addr | ||
211 | |||
212 | -/* BTI c + 3 insns + 2 pointer-sized entries. */ | ||
213 | -#define TRAMPOLINE_SIZE (TARGET_ILP32 ? 24 : 32) | ||
214 | +/* BTI c + 3 insns | ||
215 | + + sls barrier of DSB + ISB. | ||
216 | + + 2 pointer-sized entries. */ | ||
217 | +#define TRAMPOLINE_SIZE (24 + (TARGET_ILP32 ? 8 : 16)) | ||
218 | |||
219 | /* Trampolines contain dwords, so must be dword aligned. */ | ||
220 | #define TRAMPOLINE_ALIGNMENT 64 | ||
221 | diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md | ||
222 | index 8c8be3c..dda04ee 100644 | ||
223 | --- a/gcc/config/aarch64/aarch64.md | ||
224 | +++ b/gcc/config/aarch64/aarch64.md | ||
225 | @@ -407,10 +407,25 @@ | ||
226 | ;; Attribute that specifies whether the alternative uses MOVPRFX. | ||
227 | (define_attr "movprfx" "no,yes" (const_string "no")) | ||
228 | |||
229 | +;; Attribute to specify that an alternative has the length of a single | ||
230 | +;; instruction plus a speculation barrier. | ||
231 | +(define_attr "sls_length" "none,retbr,casesi" (const_string "none")) | ||
232 | + | ||
233 | (define_attr "length" "" | ||
234 | (cond [(eq_attr "movprfx" "yes") | ||
235 | (const_int 8) | ||
236 | - ] (const_int 4))) | ||
237 | + | ||
238 | + (eq_attr "sls_length" "retbr") | ||
239 | + (cond [(match_test "!aarch64_harden_sls_retbr_p ()") (const_int 4) | ||
240 | + (match_test "TARGET_SB") (const_int 8)] | ||
241 | + (const_int 12)) | ||
242 | + | ||
243 | + (eq_attr "sls_length" "casesi") | ||
244 | + (cond [(match_test "!aarch64_harden_sls_retbr_p ()") (const_int 16) | ||
245 | + (match_test "TARGET_SB") (const_int 20)] | ||
246 | + (const_int 24)) | ||
247 | + ] | ||
248 | + (const_int 4))) | ||
249 | |||
250 | ;; Strictly for compatibility with AArch32 in pipeline models, since AArch64 has | ||
251 | ;; no predicated insns. | ||
252 | @@ -447,8 +462,12 @@ | ||
253 | (define_insn "indirect_jump" | ||
254 | [(set (pc) (match_operand:DI 0 "register_operand" "r"))] | ||
255 | "" | ||
256 | - "br\\t%0" | ||
257 | - [(set_attr "type" "branch")] | ||
258 | + { | ||
259 | + output_asm_insn ("br\\t%0", operands); | ||
260 | + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()); | ||
261 | + } | ||
262 | + [(set_attr "type" "branch") | ||
263 | + (set_attr "sls_length" "retbr")] | ||
264 | ) | ||
265 | |||
266 | (define_insn "jump" | ||
267 | @@ -765,7 +784,7 @@ | ||
268 | "* | ||
269 | return aarch64_output_casesi (operands); | ||
270 | " | ||
271 | - [(set_attr "length" "16") | ||
272 | + [(set_attr "sls_length" "casesi") | ||
273 | (set_attr "type" "branch")] | ||
274 | ) | ||
275 | |||
276 | @@ -844,18 +863,23 @@ | ||
277 | [(return)] | ||
278 | "" | ||
279 | { | ||
280 | + const char *ret = NULL; | ||
281 | if (aarch64_return_address_signing_enabled () | ||
282 | && TARGET_ARMV8_3 | ||
283 | && !crtl->calls_eh_return) | ||
284 | { | ||
285 | if (aarch64_ra_sign_key == AARCH64_KEY_B) | ||
286 | - return "retab"; | ||
287 | + ret = "retab"; | ||
288 | else | ||
289 | - return "retaa"; | ||
290 | + ret = "retaa"; | ||
291 | } | ||
292 | - return "ret"; | ||
293 | + else | ||
294 | + ret = "ret"; | ||
295 | + output_asm_insn (ret, operands); | ||
296 | + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()); | ||
297 | } | ||
298 | - [(set_attr "type" "branch")] | ||
299 | + [(set_attr "type" "branch") | ||
300 | + (set_attr "sls_length" "retbr")] | ||
301 | ) | ||
302 | |||
303 | (define_expand "return" | ||
304 | @@ -867,8 +891,12 @@ | ||
305 | (define_insn "simple_return" | ||
306 | [(simple_return)] | ||
307 | "" | ||
308 | - "ret" | ||
309 | - [(set_attr "type" "branch")] | ||
310 | + { | ||
311 | + output_asm_insn ("ret", operands); | ||
312 | + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()); | ||
313 | + } | ||
314 | + [(set_attr "type" "branch") | ||
315 | + (set_attr "sls_length" "retbr")] | ||
316 | ) | ||
317 | |||
318 | (define_insn "*cb<optab><mode>1" | ||
319 | @@ -1066,10 +1094,16 @@ | ||
320 | (unspec:DI [(match_operand:DI 2 "const_int_operand")] UNSPEC_CALLEE_ABI) | ||
321 | (return)] | ||
322 | "SIBLING_CALL_P (insn)" | ||
323 | - "@ | ||
324 | - br\\t%0 | ||
325 | - b\\t%c0" | ||
326 | - [(set_attr "type" "branch, branch")] | ||
327 | + { | ||
328 | + if (which_alternative == 0) | ||
329 | + { | ||
330 | + output_asm_insn ("br\\t%0", operands); | ||
331 | + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()); | ||
332 | + } | ||
333 | + return "b\\t%c0"; | ||
334 | + } | ||
335 | + [(set_attr "type" "branch, branch") | ||
336 | + (set_attr "sls_length" "retbr,none")] | ||
337 | ) | ||
338 | |||
339 | (define_insn "*sibcall_value_insn" | ||
340 | @@ -1080,10 +1114,16 @@ | ||
341 | (unspec:DI [(match_operand:DI 3 "const_int_operand")] UNSPEC_CALLEE_ABI) | ||
342 | (return)] | ||
343 | "SIBLING_CALL_P (insn)" | ||
344 | - "@ | ||
345 | - br\\t%1 | ||
346 | - b\\t%c1" | ||
347 | - [(set_attr "type" "branch, branch")] | ||
348 | + { | ||
349 | + if (which_alternative == 0) | ||
350 | + { | ||
351 | + output_asm_insn ("br\\t%1", operands); | ||
352 | + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ()); | ||
353 | + } | ||
354 | + return "b\\t%c1"; | ||
355 | + } | ||
356 | + [(set_attr "type" "branch, branch") | ||
357 | + (set_attr "sls_length" "retbr,none")] | ||
358 | ) | ||
359 | |||
360 | ;; Call subroutine returning any type. | ||
361 | diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c | ||
362 | new file mode 100644 | ||
363 | index 0000000..fa1887a | ||
364 | --- /dev/null | ||
365 | +++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr-pacret.c | ||
366 | @@ -0,0 +1,21 @@ | ||
367 | +/* Avoid ILP32 since pacret is only available for LP64 */ | ||
368 | +/* { dg-do compile { target { ! ilp32 } } } */ | ||
369 | +/* { dg-additional-options "-mharden-sls=retbr -mbranch-protection=pac-ret -march=armv8.3-a" } */ | ||
370 | + | ||
371 | +/* Testing the do_return pattern for retaa and retab. */ | ||
372 | +long retbr_subcall(void); | ||
373 | +long retbr_do_return_retaa(void) | ||
374 | +{ | ||
375 | + return retbr_subcall()+1; | ||
376 | +} | ||
377 | + | ||
378 | +__attribute__((target("branch-protection=pac-ret+b-key"))) | ||
379 | +long retbr_do_return_retab(void) | ||
380 | +{ | ||
381 | + return retbr_subcall()+1; | ||
382 | +} | ||
383 | + | ||
384 | +/* Ensure there are no BR or RET instructions which are not directly followed | ||
385 | + by a speculation barrier. */ | ||
386 | +/* { dg-final { scan-assembler-not {\t(br|ret|retaa|retab)\tx[0-9][0-9]?\n\t(?!dsb\tsy\n\tisb)} } } */ | ||
387 | +/* { dg-final { scan-assembler-not {ret\t} } } */ | ||
388 | diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c | ||
389 | new file mode 100644 | ||
390 | index 0000000..76b8d03 | ||
391 | --- /dev/null | ||
392 | +++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-retbr.c | ||
393 | @@ -0,0 +1,119 @@ | ||
394 | +/* We ensure that -Wpedantic is off since it complains about the trampolines | ||
395 | + we explicitly want to test. */ | ||
396 | +/* { dg-additional-options "-mharden-sls=retbr -Wno-pedantic " } */ | ||
397 | +/* | ||
398 | + Ensure that the SLS hardening of RET and BR leaves no unprotected RET/BR | ||
399 | + instructions. | ||
400 | + */ | ||
401 | +typedef int (foo) (int, int); | ||
402 | +typedef void (bar) (int, int); | ||
403 | +struct sls_testclass { | ||
404 | + foo *x; | ||
405 | + bar *y; | ||
406 | + int left; | ||
407 | + int right; | ||
408 | +}; | ||
409 | + | ||
410 | +int | ||
411 | +retbr_sibcall_value_insn (struct sls_testclass x) | ||
412 | +{ | ||
413 | + return x.x(x.left, x.right); | ||
414 | +} | ||
415 | + | ||
416 | +void | ||
417 | +retbr_sibcall_insn (struct sls_testclass x) | ||
418 | +{ | ||
419 | + x.y(x.left, x.right); | ||
420 | +} | ||
421 | + | ||
422 | +/* Aim to test two different returns. | ||
423 | + One that introduces a tail call in the middle of the function, and one that | ||
424 | + has a normal return. */ | ||
425 | +int | ||
426 | +retbr_multiple_returns (struct sls_testclass x) | ||
427 | +{ | ||
428 | + int temp; | ||
429 | + if (x.left % 10) | ||
430 | + return x.x(x.left, 100); | ||
431 | + else if (x.right % 20) | ||
432 | + { | ||
433 | + return x.x(x.left * x.right, 100); | ||
434 | + } | ||
435 | + temp = x.left % x.right; | ||
436 | + temp *= 100; | ||
437 | + temp /= 2; | ||
438 | + return temp % 3; | ||
439 | +} | ||
440 | + | ||
441 | +void | ||
442 | +retbr_multiple_returns_void (struct sls_testclass x) | ||
443 | +{ | ||
444 | + if (x.left % 10) | ||
445 | + { | ||
446 | + x.y(x.left, 100); | ||
447 | + } | ||
448 | + else if (x.right % 20) | ||
449 | + { | ||
450 | + x.y(x.left * x.right, 100); | ||
451 | + } | ||
452 | + return; | ||
453 | +} | ||
454 | + | ||
455 | +/* Testing the casesi jump via register. */ | ||
456 | +__attribute__ ((optimize ("Os"))) | ||
457 | +int | ||
458 | +retbr_casesi_dispatch (struct sls_testclass x) | ||
459 | +{ | ||
460 | + switch (x.left) | ||
461 | + { | ||
462 | + case -5: | ||
463 | + return -2; | ||
464 | + case -3: | ||
465 | + return -1; | ||
466 | + case 0: | ||
467 | + return 0; | ||
468 | + case 3: | ||
469 | + return 1; | ||
470 | + case 5: | ||
471 | + break; | ||
472 | + default: | ||
473 | + __builtin_unreachable (); | ||
474 | + } | ||
475 | + return x.right; | ||
476 | +} | ||
477 | + | ||
478 | +/* Testing the BR in trampolines is mitigated against. */ | ||
479 | +void f1 (void *); | ||
480 | +void f3 (void *, void (*)(void *)); | ||
481 | +void f2 (void *); | ||
482 | + | ||
483 | +int | ||
484 | +retbr_trampolines (void *a, int b) | ||
485 | +{ | ||
486 | + if (!b) | ||
487 | + { | ||
488 | + f1 (a); | ||
489 | + return 1; | ||
490 | + } | ||
491 | + if (b) | ||
492 | + { | ||
493 | + void retbr_tramp_internal (void *c) | ||
494 | + { | ||
495 | + if (c == a) | ||
496 | + f2 (c); | ||
497 | + } | ||
498 | + f3 (a, retbr_tramp_internal); | ||
499 | + } | ||
500 | + return 0; | ||
501 | +} | ||
502 | + | ||
503 | +/* Testing the indirect_jump pattern. */ | ||
504 | +void | ||
505 | +retbr_indirect_jump (int *buf) | ||
506 | +{ | ||
507 | + __builtin_longjmp(buf, 1); | ||
508 | +} | ||
509 | + | ||
510 | +/* Ensure there are no BR or RET instructions which are not directly followed | ||
511 | + by a speculation barrier. */ | ||
512 | +/* { dg-final { scan-assembler-not {\t(br|ret|retaa|retab)\tx[0-9][0-9]?\n\t(?!dsb\tsy\n\tisb|sb)} } } */ | ||
513 | diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp | ||
514 | new file mode 100644 | ||
515 | index 0000000..8122503 | ||
516 | --- /dev/null | ||
517 | +++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-mitigation.exp | ||
518 | @@ -0,0 +1,73 @@ | ||
519 | +# Regression driver for SLS mitigation on AArch64. | ||
520 | +# Copyright (C) 2020 Free Software Foundation, Inc. | ||
521 | +# Contributed by ARM Ltd. | ||
522 | +# | ||
523 | +# This file is part of GCC. | ||
524 | +# | ||
525 | +# GCC is free software; you can redistribute it and/or modify it | ||
526 | +# under the terms of the GNU General Public License as published by | ||
527 | +# the Free Software Foundation; either version 3, or (at your option) | ||
528 | +# any later version. | ||
529 | +# | ||
530 | +# GCC is distributed in the hope that it will be useful, but | ||
531 | +# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
532 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
533 | +# General Public License for more details. | ||
534 | +# | ||
535 | +# You should have received a copy of the GNU General Public License | ||
536 | +# along with GCC; see the file COPYING3. If not see | ||
537 | +# <http://www.gnu.org/licenses/>. */ | ||
538 | + | ||
539 | +# Exit immediately if this isn't an AArch64 target. | ||
540 | +if {![istarget aarch64*-*-*] } then { | ||
541 | + return | ||
542 | +} | ||
543 | + | ||
544 | +# Load support procs. | ||
545 | +load_lib gcc-dg.exp | ||
546 | +load_lib torture-options.exp | ||
547 | + | ||
548 | +# If a testcase doesn't have special options, use these. | ||
549 | +global DEFAULT_CFLAGS | ||
550 | +if ![info exists DEFAULT_CFLAGS] then { | ||
551 | + set DEFAULT_CFLAGS " " | ||
552 | +} | ||
553 | + | ||
554 | +# Initialize `dg'. | ||
555 | +dg-init | ||
556 | +torture-init | ||
557 | + | ||
558 | +# Use different architectures as well as the normal optimisation options. | ||
559 | +# (i.e. use both SB and DSB+ISB barriers). | ||
560 | + | ||
561 | +set save-dg-do-what-default ${dg-do-what-default} | ||
562 | +# Main loop. | ||
563 | +# Run with torture tests (i.e. a bunch of different optimisation levels) just | ||
564 | +# to increase test coverage. | ||
565 | +set dg-do-what-default assemble | ||
566 | +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ | ||
567 | + "-save-temps" $DEFAULT_CFLAGS | ||
568 | + | ||
569 | +# Run the same tests but this time with SB extension. | ||
570 | +# Since not all supported assemblers will support that extension we decide | ||
571 | +# whether to assemble or just compile based on whether the extension is | ||
572 | +# supported for the available assembler. | ||
573 | + | ||
574 | +set templist {} | ||
575 | +foreach x $DG_TORTURE_OPTIONS { | ||
576 | + lappend templist "$x -march=armv8.3-a+sb " | ||
577 | + lappend templist "$x -march=armv8-a+sb " | ||
578 | +} | ||
579 | +set-torture-options $templist | ||
580 | +if { [check_effective_target_aarch64_asm_sb_ok] } { | ||
581 | + set dg-do-what-default assemble | ||
582 | +} else { | ||
583 | + set dg-do-what-default compile | ||
584 | +} | ||
585 | +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ | ||
586 | + "-save-temps" $DEFAULT_CFLAGS | ||
587 | +set dg-do-what-default ${save-dg-do-what-default} | ||
588 | + | ||
589 | +# All done. | ||
590 | +torture-finish | ||
591 | +dg-finish | ||
592 | diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp | ||
593 | index 8a186dd..9d2e093 100644 | ||
594 | --- a/gcc/testsuite/lib/target-supports.exp | ||
595 | +++ b/gcc/testsuite/lib/target-supports.exp | ||
596 | @@ -9432,7 +9432,7 @@ proc check_effective_target_aarch64_tiny { } { | ||
597 | # various architecture extensions via the .arch_extension pseudo-op. | ||
598 | |||
599 | foreach { aarch64_ext } { "fp" "simd" "crypto" "crc" "lse" "dotprod" "sve" | ||
600 | - "i8mm" "f32mm" "f64mm" "bf16" } { | ||
601 | + "i8mm" "f32mm" "f64mm" "bf16" "sb" } { | ||
602 | eval [string map [list FUNC $aarch64_ext] { | ||
603 | proc check_effective_target_aarch64_asm_FUNC_ok { } { | ||
604 | if { [istarget aarch64*-*-*] } { | ||
605 | -- | ||
606 | 2.7.4 | ||
607 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch deleted file mode 100644 index 30a84860..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch +++ /dev/null | |||
@@ -1,200 +0,0 @@ | |||
1 | From 74cc21f474402cf3578e37e1d7a1a22bbd070f6a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 08:59:00 +0400 | ||
4 | Subject: [PATCH] gcc: poison-system-directories | ||
5 | |||
6 | Add /sw/include and /opt/include based on the original | ||
7 | zecke-no-host-includes.patch patch. The original patch checked for | ||
8 | /usr/include, /sw/include and /opt/include and then triggered a failure and | ||
9 | aborted. | ||
10 | |||
11 | Instead, we add the two missing items to the current scan. If the user | ||
12 | wants this to be a failure, they can add "-Werror=poison-system-directories". | ||
13 | |||
14 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | --- | ||
19 | gcc/common.opt | 4 ++++ | ||
20 | gcc/config.in | 6 ++++++ | ||
21 | gcc/configure | 16 ++++++++++++++++ | ||
22 | gcc/configure.ac | 10 ++++++++++ | ||
23 | gcc/doc/invoke.texi | 9 +++++++++ | ||
24 | gcc/gcc.c | 2 ++ | ||
25 | gcc/incpath.c | 21 +++++++++++++++++++++ | ||
26 | 7 files changed, 68 insertions(+) | ||
27 | |||
28 | diff --git a/gcc/common.opt b/gcc/common.opt | ||
29 | index 65a82410abc..415f38fa1f4 100644 | ||
30 | --- a/gcc/common.opt | ||
31 | +++ b/gcc/common.opt | ||
32 | @@ -682,6 +682,10 @@ Wreturn-local-addr | ||
33 | Common Var(warn_return_local_addr) Init(1) Warning | ||
34 | Warn about returning a pointer/reference to a local or temporary variable. | ||
35 | |||
36 | +Wpoison-system-directories | ||
37 | +Common Var(flag_poison_system_directories) Init(1) Warning | ||
38 | +Warn for -I and -L options using system directories if cross compiling | ||
39 | + | ||
40 | Wshadow | ||
41 | Common Var(warn_shadow) Warning | ||
42 | Warn when one variable shadows another. Same as -Wshadow=global. | ||
43 | diff --git a/gcc/config.in b/gcc/config.in | ||
44 | index 809e7b26823..5adeaeed36b 100644 | ||
45 | --- a/gcc/config.in | ||
46 | +++ b/gcc/config.in | ||
47 | @@ -224,6 +224,12 @@ | ||
48 | #endif | ||
49 | |||
50 | |||
51 | +/* Define to warn for use of native system header directories */ | ||
52 | +#ifndef USED_FOR_TARGET | ||
53 | +#undef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
54 | +#endif | ||
55 | + | ||
56 | + | ||
57 | /* Define if you want all operations on RTL (the basic data structure of the | ||
58 | optimizer and back end) to be checked for dynamic type safety at runtime. | ||
59 | This is quite expensive. */ | ||
60 | diff --git a/gcc/configure b/gcc/configure | ||
61 | index cd3d9516fce..8de766a942c 100755 | ||
62 | --- a/gcc/configure | ||
63 | +++ b/gcc/configure | ||
64 | @@ -1010,6 +1010,7 @@ with_system_zlib | ||
65 | enable_maintainer_mode | ||
66 | enable_link_mutex | ||
67 | enable_version_specific_runtime_libs | ||
68 | +enable_poison_system_directories | ||
69 | enable_plugin | ||
70 | enable_host_shared | ||
71 | enable_libquadmath_support | ||
72 | @@ -1766,6 +1767,8 @@ Optional Features: | ||
73 | --enable-version-specific-runtime-libs | ||
74 | specify that runtime libraries should be installed | ||
75 | in a compiler-specific directory | ||
76 | + --enable-poison-system-directories | ||
77 | + warn for use of native system header directories | ||
78 | --enable-plugin enable plugin support | ||
79 | --enable-host-shared build host code as shared libraries | ||
80 | --disable-libquadmath-support | ||
81 | @@ -30235,6 +30238,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : | ||
82 | fi | ||
83 | |||
84 | |||
85 | +# Check whether --enable-poison-system-directories was given. | ||
86 | +if test "${enable_poison_system_directories+set}" = set; then : | ||
87 | + enableval=$enable_poison_system_directories; | ||
88 | +else | ||
89 | + enable_poison_system_directories=no | ||
90 | +fi | ||
91 | + | ||
92 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
93 | + | ||
94 | +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h | ||
95 | + | ||
96 | +fi | ||
97 | + | ||
98 | # Substitute configuration variables | ||
99 | |||
100 | |||
101 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
102 | index 0de3b4bf97b..8bfd6feb780 100644 | ||
103 | --- a/gcc/configure.ac | ||
104 | +++ b/gcc/configure.ac | ||
105 | @@ -6595,6 +6595,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, | ||
106 | [specify that runtime libraries should be | ||
107 | installed in a compiler-specific directory])]) | ||
108 | |||
109 | +AC_ARG_ENABLE([poison-system-directories], | ||
110 | + AS_HELP_STRING([--enable-poison-system-directories], | ||
111 | + [warn for use of native system header directories]),, | ||
112 | + [enable_poison_system_directories=no]) | ||
113 | +if test "x${enable_poison_system_directories}" = "xyes"; then | ||
114 | + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], | ||
115 | + [1], | ||
116 | + [Define to warn for use of native system header directories]) | ||
117 | +fi | ||
118 | + | ||
119 | # Substitute configuration variables | ||
120 | AC_SUBST(subdirs) | ||
121 | AC_SUBST(srcdir) | ||
122 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi | ||
123 | index f98161391a0..f12d8d12150 100644 | ||
124 | --- a/gcc/doc/invoke.texi | ||
125 | +++ b/gcc/doc/invoke.texi | ||
126 | @@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. | ||
127 | -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol | ||
128 | -Wparentheses -Wno-pedantic-ms-format @gol | ||
129 | -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol | ||
130 | +-Wno-poison-system-directories @gol | ||
131 | -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol | ||
132 | -Wrestrict -Wno-return-local-addr -Wreturn-type @gol | ||
133 | -Wno-scalar-storage-order -Wsequence-point @gol | ||
134 | @@ -6924,6 +6925,14 @@ made up of data only and thus requires no special treatment. But, for | ||
135 | most targets, it is made up of code and thus requires the stack to be | ||
136 | made executable in order for the program to work properly. | ||
137 | |||
138 | +@item -Wno-poison-system-directories | ||
139 | +@opindex Wno-poison-system-directories | ||
140 | +Do not warn for @option{-I} or @option{-L} options using system | ||
141 | +directories such as @file{/usr/include} when cross compiling. This | ||
142 | +option is intended for use in chroot environments when such | ||
143 | +directories contain the correct headers and libraries for the target | ||
144 | +system rather than the host. | ||
145 | + | ||
146 | @item -Wfloat-equal | ||
147 | @opindex Wfloat-equal | ||
148 | @opindex Wno-float-equal | ||
149 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
150 | index 9f790db0daf..b2200c5185a 100644 | ||
151 | --- a/gcc/gcc.c | ||
152 | +++ b/gcc/gcc.c | ||
153 | @@ -1041,6 +1041,8 @@ proper position among the other output files. */ | ||
154 | "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ | ||
155 | "%X %{o*} %{e*} %{N} %{n} %{r}\ | ||
156 | %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ | ||
157 | + %{Wno-poison-system-directories:--no-poison-system-directories} \ | ||
158 | + %{Werror=poison-system-directories:--error-poison-system-directories} \ | ||
159 | %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \ | ||
160 | VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ | ||
161 | %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ | ||
162 | diff --git a/gcc/incpath.c b/gcc/incpath.c | ||
163 | index 8a2bda00f80..9098ab044ab 100644 | ||
164 | --- a/gcc/incpath.c | ||
165 | +++ b/gcc/incpath.c | ||
166 | @@ -26,6 +26,7 @@ | ||
167 | #include "intl.h" | ||
168 | #include "incpath.h" | ||
169 | #include "cppdefault.h" | ||
170 | +#include "diagnostic-core.h" | ||
171 | |||
172 | /* Microsoft Windows does not natively support inodes. | ||
173 | VMS has non-numeric inodes. */ | ||
174 | @@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) | ||
175 | } | ||
176 | fprintf (stderr, _("End of search list.\n")); | ||
177 | } | ||
178 | + | ||
179 | +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES | ||
180 | + if (flag_poison_system_directories) | ||
181 | + { | ||
182 | + struct cpp_dir *p; | ||
183 | + | ||
184 | + for (p = heads[INC_QUOTE]; p; p = p->next) | ||
185 | + { | ||
186 | + if ((!strncmp (p->name, "/usr/include", 12)) | ||
187 | + || (!strncmp (p->name, "/usr/local/include", 18)) | ||
188 | + || (!strncmp (p->name, "/usr/X11R6/include", 18)) | ||
189 | + || (!strncmp (p->name, "/sw/include", 11)) | ||
190 | + || (!strncmp (p->name, "/opt/include", 12))) | ||
191 | + warning (OPT_Wpoison_system_directories, | ||
192 | + "include location \"%s\" is unsafe for " | ||
193 | + "cross-compilation", | ||
194 | + p->name); | ||
195 | + } | ||
196 | + } | ||
197 | +#endif | ||
198 | } | ||
199 | |||
200 | /* Use given -I paths for #include "..." but not #include <...>, and | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch deleted file mode 100644 index 716a3671..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch +++ /dev/null | |||
@@ -1,658 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From a5e7efc40ed841934c1d913f39476afa17d8e5f7 Mon Sep 17 00:00:00 2001 | ||
5 | From: Matthew Malcomson <matthew.malcomson@arm.com> | ||
6 | Date: Thu, 9 Jul 2020 09:11:59 +0100 | ||
7 | Subject: [PATCH 3/3] aarch64: Mitigate SLS for BLR instruction | ||
8 | |||
9 | This patch introduces the mitigation for Straight Line Speculation past | ||
10 | the BLR instruction. | ||
11 | |||
12 | This mitigation replaces BLR instructions with a BL to a stub which uses | ||
13 | a BR to jump to the original value. These function stubs are then | ||
14 | appended with a speculation barrier to ensure no straight line | ||
15 | speculation happens after these jumps. | ||
16 | |||
17 | When optimising for speed we use a set of stubs for each function since | ||
18 | this should help the branch predictor make more accurate predictions | ||
19 | about where a stub should branch. | ||
20 | |||
21 | When optimising for size we use one set of stubs for all functions. | ||
22 | This set of stubs can have human readable names, and we are using | ||
23 | `__call_indirect_x<N>` for register x<N>. | ||
24 | |||
25 | When BTI branch protection is enabled the BLR instruction can jump to a | ||
26 | `BTI c` instruction using any register, while the BR instruction can | ||
27 | only jump to a `BTI c` instruction using the x16 or x17 registers. | ||
28 | Hence, in order to ensure this transformation is safe we mov the value | ||
29 | of the original register into x16 and use x16 for the BR. | ||
30 | |||
31 | As an example when optimising for size: | ||
32 | a | ||
33 | BLR x0 | ||
34 | instruction would get transformed to something like | ||
35 | BL __call_indirect_x0 | ||
36 | where __call_indirect_x0 labels a thunk that contains | ||
37 | __call_indirect_x0: | ||
38 | MOV X16, X0 | ||
39 | BR X16 | ||
40 | <speculation barrier> | ||
41 | |||
42 | The first version of this patch used local symbols specific to a | ||
43 | compilation unit to try and avoid relocations. | ||
44 | This was mistaken since functions coming from the same compilation unit | ||
45 | can still be in different sections, and the assembler will insert | ||
46 | relocations at jumps between sections. | ||
47 | |||
48 | On any relocation the linker is permitted to emit a veneer to handle | ||
49 | jumps between symbols that are very far apart. The registers x16 and | ||
50 | x17 may be clobbered by these veneers. | ||
51 | Hence the function stubs cannot rely on the values of x16 and x17 being | ||
52 | the same as just before the function stub is called. | ||
53 | |||
54 | Similar can be said for the hot/cold partitioning of single functions, | ||
55 | so function-local stubs have the same restriction. | ||
56 | |||
57 | This updated version of the patch never emits function stubs for x16 and | ||
58 | x17, and instead forces other registers to be used. | ||
59 | |||
60 | Given the above, there is now no benefit to local symbols (since they | ||
61 | are not enough to avoid dealing with linker intricacies). This patch | ||
62 | now uses global symbols with hidden visibility each stored in their own | ||
63 | COMDAT section. This means stubs can be shared between compilation | ||
64 | units while still avoiding the PLT indirection. | ||
65 | |||
66 | This patch also removes the `__call_indirect_x30` stub (and | ||
67 | function-local equivalent) which would simply jump back to the original | ||
68 | location. | ||
69 | |||
70 | The function-local stubs are emitted to the assembly output file in one | ||
71 | chunk, which means we need not add the speculation barrier directly | ||
72 | after each one. | ||
73 | This is because we know for certain that the instructions directly after | ||
74 | the BR in all but the last function stub will be from another one of | ||
75 | these stubs and hence will not contain a speculation gadget. | ||
76 | Instead we add a speculation barrier at the end of the sequence of | ||
77 | stubs. | ||
78 | |||
79 | The global stubs are emitted in COMDAT/.linkonce sections by | ||
80 | themselves so that the linker can remove duplicates from multiple object | ||
81 | files. This means they are not emitted in one chunk, and each one must | ||
82 | include the speculation barrier. | ||
83 | |||
84 | Another difference is that since the global stubs are shared across | ||
85 | compilation units we do not know that all functions will be targeting an | ||
86 | architecture supporting the SB instruction. | ||
87 | Rather than provide multiple stubs for each architecture, we provide a | ||
88 | stub that will work for all architectures -- using the DSB+ISB barrier. | ||
89 | |||
90 | This mitigation does not apply for BLR instructions in the following | ||
91 | places: | ||
92 | - Some accesses to thread-local variables use a code sequence with a BLR | ||
93 | instruction. This code sequence is part of the binary interface between | ||
94 | compiler and linker. If this BLR instruction needs to be mitigated, it'd | ||
95 | probably be best to do so in the linker. It seems that the code sequence | ||
96 | for thread-local variable access is unlikely to lead to a Spectre Revalation | ||
97 | Gadget. | ||
98 | - PLT stubs are produced by the linker and each contain a BLR instruction. | ||
99 | It seems that at most only after the last PLT stub a Spectre Revalation | ||
100 | Gadget might appear. | ||
101 | |||
102 | Testing: | ||
103 | Bootstrap and regtest on AArch64 | ||
104 | (with BOOT_CFLAGS="-mharden-sls=retbr,blr") | ||
105 | Used a temporary hack(1) in gcc-dg.exp to use these options on every | ||
106 | test in the testsuite, a slight modification to emit the speculation | ||
107 | barrier after every function stub, and a script to check that the | ||
108 | output never emitted a BLR, or unmitigated BR or RET instruction. | ||
109 | Similar on an aarch64-none-elf cross-compiler. | ||
110 | |||
111 | 1) Temporary hack emitted a speculation barrier at the end of every stub | ||
112 | function, and used a script to ensure that: | ||
113 | a) Every RET or BR is immediately followed by a speculation barrier. | ||
114 | b) No BLR instruction is emitted by compiler. | ||
115 | |||
116 | gcc/ChangeLog: | ||
117 | |||
118 | * config/aarch64/aarch64-protos.h (aarch64_indirect_call_asm): | ||
119 | New declaration. | ||
120 | * config/aarch64/aarch64.c (aarch64_regno_regclass): Handle new | ||
121 | stub registers class. | ||
122 | (aarch64_class_max_nregs): Likewise. | ||
123 | (aarch64_register_move_cost): Likewise. | ||
124 | (aarch64_sls_shared_thunks): Global array to store stub labels. | ||
125 | (aarch64_sls_emit_function_stub): New. | ||
126 | (aarch64_create_blr_label): New. | ||
127 | (aarch64_sls_emit_blr_function_thunks): New. | ||
128 | (aarch64_sls_emit_shared_blr_thunks): New. | ||
129 | (aarch64_asm_file_end): New. | ||
130 | (aarch64_indirect_call_asm): New. | ||
131 | (TARGET_ASM_FILE_END): Use aarch64_asm_file_end. | ||
132 | (TARGET_ASM_FUNCTION_EPILOGUE): Use | ||
133 | aarch64_sls_emit_blr_function_thunks. | ||
134 | * config/aarch64/aarch64.h (STB_REGNUM_P): New. | ||
135 | (enum reg_class): Add STUB_REGS class. | ||
136 | (machine_function): Introduce `call_via` array for | ||
137 | function-local stub labels. | ||
138 | * config/aarch64/aarch64.md (*call_insn, *call_value_insn): Use | ||
139 | aarch64_indirect_call_asm to emit code when hardening BLR | ||
140 | instructions. | ||
141 | * config/aarch64/constraints.md (Ucr): New constraint | ||
142 | representing registers for indirect calls. Is GENERAL_REGS | ||
143 | usually, and STUB_REGS when hardening BLR instruction against | ||
144 | SLS. | ||
145 | * config/aarch64/predicates.md (aarch64_general_reg): STUB_REGS class | ||
146 | is also a general register. | ||
147 | |||
148 | gcc/testsuite/ChangeLog: | ||
149 | |||
150 | * gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c: New test. | ||
151 | * gcc.target/aarch64/sls-mitigation/sls-miti-blr.c: New test. | ||
152 | --- | ||
153 | gcc/config/aarch64/aarch64-protos.h | 1 + | ||
154 | gcc/config/aarch64/aarch64.c | 225 ++++++++++++++++++++- | ||
155 | gcc/config/aarch64/aarch64.h | 15 ++ | ||
156 | gcc/config/aarch64/aarch64.md | 11 +- | ||
157 | gcc/config/aarch64/constraints.md | 9 + | ||
158 | gcc/config/aarch64/predicates.md | 3 +- | ||
159 | .../aarch64/sls-mitigation/sls-miti-blr-bti.c | 40 ++++ | ||
160 | .../aarch64/sls-mitigation/sls-miti-blr.c | 33 +++ | ||
161 | 8 files changed, 328 insertions(+), 9 deletions(-) | ||
162 | create mode 100644 gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c | ||
163 | create mode 100644 gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c | ||
164 | |||
165 | diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h | ||
166 | index ee0ffde..839f801 100644 | ||
167 | --- a/gcc/config/aarch64/aarch64-protos.h | ||
168 | +++ b/gcc/config/aarch64/aarch64-protos.h | ||
169 | @@ -782,6 +782,7 @@ extern const atomic_ool_names aarch64_ool_ldeor_names; | ||
170 | tree aarch64_resolve_overloaded_builtin_general (location_t, tree, void *); | ||
171 | |||
172 | const char *aarch64_sls_barrier (int); | ||
173 | +const char *aarch64_indirect_call_asm (rtx); | ||
174 | extern bool aarch64_harden_sls_retbr_p (void); | ||
175 | extern bool aarch64_harden_sls_blr_p (void); | ||
176 | |||
177 | diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c | ||
178 | index 2389d49..0f7bba3 100644 | ||
179 | --- a/gcc/config/aarch64/aarch64.c | ||
180 | +++ b/gcc/config/aarch64/aarch64.c | ||
181 | @@ -10605,6 +10605,9 @@ aarch64_label_mentioned_p (rtx x) | ||
182 | enum reg_class | ||
183 | aarch64_regno_regclass (unsigned regno) | ||
184 | { | ||
185 | + if (STUB_REGNUM_P (regno)) | ||
186 | + return STUB_REGS; | ||
187 | + | ||
188 | if (GP_REGNUM_P (regno)) | ||
189 | return GENERAL_REGS; | ||
190 | |||
191 | @@ -10939,6 +10942,7 @@ aarch64_class_max_nregs (reg_class_t regclass, machine_mode mode) | ||
192 | unsigned int nregs, vec_flags; | ||
193 | switch (regclass) | ||
194 | { | ||
195 | + case STUB_REGS: | ||
196 | case TAILCALL_ADDR_REGS: | ||
197 | case POINTER_REGS: | ||
198 | case GENERAL_REGS: | ||
199 | @@ -13155,10 +13159,12 @@ aarch64_register_move_cost (machine_mode mode, | ||
200 | = aarch64_tune_params.regmove_cost; | ||
201 | |||
202 | /* Caller save and pointer regs are equivalent to GENERAL_REGS. */ | ||
203 | - if (to == TAILCALL_ADDR_REGS || to == POINTER_REGS) | ||
204 | + if (to == TAILCALL_ADDR_REGS || to == POINTER_REGS | ||
205 | + || to == STUB_REGS) | ||
206 | to = GENERAL_REGS; | ||
207 | |||
208 | - if (from == TAILCALL_ADDR_REGS || from == POINTER_REGS) | ||
209 | + if (from == TAILCALL_ADDR_REGS || from == POINTER_REGS | ||
210 | + || from == STUB_REGS) | ||
211 | from = GENERAL_REGS; | ||
212 | |||
213 | /* Make RDFFR very expensive. In particular, if we know that the FFR | ||
214 | @@ -22957,6 +22963,215 @@ aarch64_sls_barrier (int mitigation_required) | ||
215 | : ""; | ||
216 | } | ||
217 | |||
218 | +static GTY (()) tree aarch64_sls_shared_thunks[30]; | ||
219 | +static GTY (()) bool aarch64_sls_shared_thunks_needed = false; | ||
220 | +const char *indirect_symbol_names[30] = { | ||
221 | + "__call_indirect_x0", | ||
222 | + "__call_indirect_x1", | ||
223 | + "__call_indirect_x2", | ||
224 | + "__call_indirect_x3", | ||
225 | + "__call_indirect_x4", | ||
226 | + "__call_indirect_x5", | ||
227 | + "__call_indirect_x6", | ||
228 | + "__call_indirect_x7", | ||
229 | + "__call_indirect_x8", | ||
230 | + "__call_indirect_x9", | ||
231 | + "__call_indirect_x10", | ||
232 | + "__call_indirect_x11", | ||
233 | + "__call_indirect_x12", | ||
234 | + "__call_indirect_x13", | ||
235 | + "__call_indirect_x14", | ||
236 | + "__call_indirect_x15", | ||
237 | + "", /* "__call_indirect_x16", */ | ||
238 | + "", /* "__call_indirect_x17", */ | ||
239 | + "__call_indirect_x18", | ||
240 | + "__call_indirect_x19", | ||
241 | + "__call_indirect_x20", | ||
242 | + "__call_indirect_x21", | ||
243 | + "__call_indirect_x22", | ||
244 | + "__call_indirect_x23", | ||
245 | + "__call_indirect_x24", | ||
246 | + "__call_indirect_x25", | ||
247 | + "__call_indirect_x26", | ||
248 | + "__call_indirect_x27", | ||
249 | + "__call_indirect_x28", | ||
250 | + "__call_indirect_x29", | ||
251 | +}; | ||
252 | + | ||
253 | +/* Function to create a BLR thunk. This thunk is used to mitigate straight | ||
254 | + line speculation. Instead of a simple BLR that can be speculated past, | ||
255 | + we emit a BL to this thunk, and this thunk contains a BR to the relevant | ||
256 | + register. These thunks have the relevant speculation barries put after | ||
257 | + their indirect branch so that speculation is blocked. | ||
258 | + | ||
259 | + We use such a thunk so the speculation barriers are kept off the | ||
260 | + architecturally executed path in order to reduce the performance overhead. | ||
261 | + | ||
262 | + When optimizing for size we use stubs shared by the linked object. | ||
263 | + When optimizing for performance we emit stubs for each function in the hope | ||
264 | + that the branch predictor can better train on jumps specific for a given | ||
265 | + function. */ | ||
266 | +rtx | ||
267 | +aarch64_sls_create_blr_label (int regnum) | ||
268 | +{ | ||
269 | + gcc_assert (STUB_REGNUM_P (regnum)); | ||
270 | + if (optimize_function_for_size_p (cfun)) | ||
271 | + { | ||
272 | + /* For the thunks shared between different functions in this compilation | ||
273 | + unit we use a named symbol -- this is just for users to more easily | ||
274 | + understand the generated assembly. */ | ||
275 | + aarch64_sls_shared_thunks_needed = true; | ||
276 | + const char *thunk_name = indirect_symbol_names[regnum]; | ||
277 | + if (aarch64_sls_shared_thunks[regnum] == NULL) | ||
278 | + { | ||
279 | + /* Build a decl representing this function stub and record it for | ||
280 | + later. We build a decl here so we can use the GCC machinery for | ||
281 | + handling sections automatically (through `get_named_section` and | ||
282 | + `make_decl_one_only`). That saves us a lot of trouble handling | ||
283 | + the specifics of different output file formats. */ | ||
284 | + tree decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, | ||
285 | + get_identifier (thunk_name), | ||
286 | + build_function_type_list (void_type_node, | ||
287 | + NULL_TREE)); | ||
288 | + DECL_RESULT (decl) = build_decl (BUILTINS_LOCATION, RESULT_DECL, | ||
289 | + NULL_TREE, void_type_node); | ||
290 | + TREE_PUBLIC (decl) = 1; | ||
291 | + TREE_STATIC (decl) = 1; | ||
292 | + DECL_IGNORED_P (decl) = 1; | ||
293 | + DECL_ARTIFICIAL (decl) = 1; | ||
294 | + make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl)); | ||
295 | + resolve_unique_section (decl, 0, false); | ||
296 | + aarch64_sls_shared_thunks[regnum] = decl; | ||
297 | + } | ||
298 | + | ||
299 | + return gen_rtx_SYMBOL_REF (Pmode, thunk_name); | ||
300 | + } | ||
301 | + | ||
302 | + if (cfun->machine->call_via[regnum] == NULL) | ||
303 | + cfun->machine->call_via[regnum] | ||
304 | + = gen_rtx_LABEL_REF (Pmode, gen_label_rtx ()); | ||
305 | + return cfun->machine->call_via[regnum]; | ||
306 | +} | ||
307 | + | ||
308 | +/* Helper function for aarch64_sls_emit_blr_function_thunks and | ||
309 | + aarch64_sls_emit_shared_blr_thunks below. */ | ||
310 | +static void | ||
311 | +aarch64_sls_emit_function_stub (FILE *out_file, int regnum) | ||
312 | +{ | ||
313 | + /* Save in x16 and branch to that function so this transformation does | ||
314 | + not prevent jumping to `BTI c` instructions. */ | ||
315 | + asm_fprintf (out_file, "\tmov\tx16, x%d\n", regnum); | ||
316 | + asm_fprintf (out_file, "\tbr\tx16\n"); | ||
317 | +} | ||
318 | + | ||
319 | +/* Emit all BLR stubs for this particular function. | ||
320 | + Here we emit all the BLR stubs needed for the current function. Since we | ||
321 | + emit these stubs in a consecutive block we know there will be no speculation | ||
322 | + gadgets between each stub, and hence we only emit a speculation barrier at | ||
323 | + the end of the stub sequences. | ||
324 | + | ||
325 | + This is called in the TARGET_ASM_FUNCTION_EPILOGUE hook. */ | ||
326 | +void | ||
327 | +aarch64_sls_emit_blr_function_thunks (FILE *out_file) | ||
328 | +{ | ||
329 | + if (! aarch64_harden_sls_blr_p ()) | ||
330 | + return; | ||
331 | + | ||
332 | + bool any_functions_emitted = false; | ||
333 | + /* We must save and restore the current function section since this assembly | ||
334 | + is emitted at the end of the function. This means it can be emitted *just | ||
335 | + after* the cold section of a function. That cold part would be emitted in | ||
336 | + a different section. That switch would trigger a `.cfi_endproc` directive | ||
337 | + to be emitted in the original section and a `.cfi_startproc` directive to | ||
338 | + be emitted in the new section. Switching to the original section without | ||
339 | + restoring would mean that the `.cfi_endproc` emitted as a function ends | ||
340 | + would happen in a different section -- leaving an unmatched | ||
341 | + `.cfi_startproc` in the cold text section and an unmatched `.cfi_endproc` | ||
342 | + in the standard text section. */ | ||
343 | + section *save_text_section = in_section; | ||
344 | + switch_to_section (function_section (current_function_decl)); | ||
345 | + for (int regnum = 0; regnum < 30; ++regnum) | ||
346 | + { | ||
347 | + rtx specu_label = cfun->machine->call_via[regnum]; | ||
348 | + if (specu_label == NULL) | ||
349 | + continue; | ||
350 | + | ||
351 | + targetm.asm_out.print_operand (out_file, specu_label, 0); | ||
352 | + asm_fprintf (out_file, ":\n"); | ||
353 | + aarch64_sls_emit_function_stub (out_file, regnum); | ||
354 | + any_functions_emitted = true; | ||
355 | + } | ||
356 | + if (any_functions_emitted) | ||
357 | + /* Can use the SB if needs be here, since this stub will only be used | ||
358 | + by the current function, and hence for the current target. */ | ||
359 | + asm_fprintf (out_file, "\t%s\n", aarch64_sls_barrier (true)); | ||
360 | + switch_to_section (save_text_section); | ||
361 | +} | ||
362 | + | ||
363 | +/* Emit shared BLR stubs for the current compilation unit. | ||
364 | + Over the course of compiling this unit we may have converted some BLR | ||
365 | + instructions to a BL to a shared stub function. This is where we emit those | ||
366 | + stub functions. | ||
367 | + This function is for the stubs shared between different functions in this | ||
368 | + compilation unit. We share when optimizing for size instead of speed. | ||
369 | + | ||
370 | + This function is called through the TARGET_ASM_FILE_END hook. */ | ||
371 | +void | ||
372 | +aarch64_sls_emit_shared_blr_thunks (FILE *out_file) | ||
373 | +{ | ||
374 | + if (! aarch64_sls_shared_thunks_needed) | ||
375 | + return; | ||
376 | + | ||
377 | + for (int regnum = 0; regnum < 30; ++regnum) | ||
378 | + { | ||
379 | + tree decl = aarch64_sls_shared_thunks[regnum]; | ||
380 | + if (!decl) | ||
381 | + continue; | ||
382 | + | ||
383 | + const char *name = indirect_symbol_names[regnum]; | ||
384 | + switch_to_section (get_named_section (decl, NULL, 0)); | ||
385 | + ASM_OUTPUT_ALIGN (out_file, 2); | ||
386 | + targetm.asm_out.globalize_label (out_file, name); | ||
387 | + /* Only emits if the compiler is configured for an assembler that can | ||
388 | + handle visibility directives. */ | ||
389 | + targetm.asm_out.assemble_visibility (decl, VISIBILITY_HIDDEN); | ||
390 | + ASM_OUTPUT_TYPE_DIRECTIVE (out_file, name, "function"); | ||
391 | + ASM_OUTPUT_LABEL (out_file, name); | ||
392 | + aarch64_sls_emit_function_stub (out_file, regnum); | ||
393 | + /* Use the most conservative target to ensure it can always be used by any | ||
394 | + function in the translation unit. */ | ||
395 | + asm_fprintf (out_file, "\tdsb\tsy\n\tisb\n"); | ||
396 | + ASM_DECLARE_FUNCTION_SIZE (out_file, name, decl); | ||
397 | + } | ||
398 | +} | ||
399 | + | ||
400 | +/* Implement TARGET_ASM_FILE_END. */ | ||
401 | +void | ||
402 | +aarch64_asm_file_end () | ||
403 | +{ | ||
404 | + aarch64_sls_emit_shared_blr_thunks (asm_out_file); | ||
405 | + /* Since this function will be called for the ASM_FILE_END hook, we ensure | ||
406 | + that what would be called otherwise (e.g. `file_end_indicate_exec_stack` | ||
407 | + for FreeBSD) still gets called. */ | ||
408 | +#ifdef TARGET_ASM_FILE_END | ||
409 | + TARGET_ASM_FILE_END (); | ||
410 | +#endif | ||
411 | +} | ||
412 | + | ||
413 | +const char * | ||
414 | +aarch64_indirect_call_asm (rtx addr) | ||
415 | +{ | ||
416 | + gcc_assert (REG_P (addr)); | ||
417 | + if (aarch64_harden_sls_blr_p ()) | ||
418 | + { | ||
419 | + rtx stub_label = aarch64_sls_create_blr_label (REGNO (addr)); | ||
420 | + output_asm_insn ("bl\t%0", &stub_label); | ||
421 | + } | ||
422 | + else | ||
423 | + output_asm_insn ("blr\t%0", &addr); | ||
424 | + return ""; | ||
425 | +} | ||
426 | + | ||
427 | /* Target-specific selftests. */ | ||
428 | |||
429 | #if CHECKING_P | ||
430 | @@ -23507,6 +23722,12 @@ aarch64_libgcc_floating_mode_supported_p | ||
431 | #undef TARGET_MD_ASM_ADJUST | ||
432 | #define TARGET_MD_ASM_ADJUST arm_md_asm_adjust | ||
433 | |||
434 | +#undef TARGET_ASM_FILE_END | ||
435 | +#define TARGET_ASM_FILE_END aarch64_asm_file_end | ||
436 | + | ||
437 | +#undef TARGET_ASM_FUNCTION_EPILOGUE | ||
438 | +#define TARGET_ASM_FUNCTION_EPILOGUE aarch64_sls_emit_blr_function_thunks | ||
439 | + | ||
440 | struct gcc_target targetm = TARGET_INITIALIZER; | ||
441 | |||
442 | #include "gt-aarch64.h" | ||
443 | diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h | ||
444 | index 8e0fc37..7331450 100644 | ||
445 | --- a/gcc/config/aarch64/aarch64.h | ||
446 | +++ b/gcc/config/aarch64/aarch64.h | ||
447 | @@ -643,6 +643,16 @@ extern unsigned aarch64_architecture_version; | ||
448 | #define GP_REGNUM_P(REGNO) \ | ||
449 | (((unsigned) (REGNO - R0_REGNUM)) <= (R30_REGNUM - R0_REGNUM)) | ||
450 | |||
451 | +/* Registers known to be preserved over a BL instruction. This consists of the | ||
452 | + GENERAL_REGS without x16, x17, and x30. The x30 register is changed by the | ||
453 | + BL instruction itself, while the x16 and x17 registers may be used by | ||
454 | + veneers which can be inserted by the linker. */ | ||
455 | +#define STUB_REGNUM_P(REGNO) \ | ||
456 | + (GP_REGNUM_P (REGNO) \ | ||
457 | + && (REGNO) != R16_REGNUM \ | ||
458 | + && (REGNO) != R17_REGNUM \ | ||
459 | + && (REGNO) != R30_REGNUM) \ | ||
460 | + | ||
461 | #define FP_REGNUM_P(REGNO) \ | ||
462 | (((unsigned) (REGNO - V0_REGNUM)) <= (V31_REGNUM - V0_REGNUM)) | ||
463 | |||
464 | @@ -667,6 +677,7 @@ enum reg_class | ||
465 | { | ||
466 | NO_REGS, | ||
467 | TAILCALL_ADDR_REGS, | ||
468 | + STUB_REGS, | ||
469 | GENERAL_REGS, | ||
470 | STACK_REG, | ||
471 | POINTER_REGS, | ||
472 | @@ -689,6 +700,7 @@ enum reg_class | ||
473 | { \ | ||
474 | "NO_REGS", \ | ||
475 | "TAILCALL_ADDR_REGS", \ | ||
476 | + "STUB_REGS", \ | ||
477 | "GENERAL_REGS", \ | ||
478 | "STACK_REG", \ | ||
479 | "POINTER_REGS", \ | ||
480 | @@ -708,6 +720,7 @@ enum reg_class | ||
481 | { \ | ||
482 | { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ | ||
483 | { 0x00030000, 0x00000000, 0x00000000 }, /* TAILCALL_ADDR_REGS */\ | ||
484 | + { 0x3ffcffff, 0x00000000, 0x00000000 }, /* STUB_REGS */ \ | ||
485 | { 0x7fffffff, 0x00000000, 0x00000003 }, /* GENERAL_REGS */ \ | ||
486 | { 0x80000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \ | ||
487 | { 0xffffffff, 0x00000000, 0x00000003 }, /* POINTER_REGS */ \ | ||
488 | @@ -862,6 +875,8 @@ typedef struct GTY (()) machine_function | ||
489 | struct aarch64_frame frame; | ||
490 | /* One entry for each hard register. */ | ||
491 | bool reg_is_wrapped_separately[LAST_SAVED_REGNUM]; | ||
492 | + /* One entry for each general purpose register. */ | ||
493 | + rtx call_via[SP_REGNUM]; | ||
494 | bool label_is_assembled; | ||
495 | } machine_function; | ||
496 | #endif | ||
497 | diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md | ||
498 | index dda04ee..43da754 100644 | ||
499 | --- a/gcc/config/aarch64/aarch64.md | ||
500 | +++ b/gcc/config/aarch64/aarch64.md | ||
501 | @@ -1022,16 +1022,15 @@ | ||
502 | ) | ||
503 | |||
504 | (define_insn "*call_insn" | ||
505 | - [(call (mem:DI (match_operand:DI 0 "aarch64_call_insn_operand" "r, Usf")) | ||
506 | + [(call (mem:DI (match_operand:DI 0 "aarch64_call_insn_operand" "Ucr, Usf")) | ||
507 | (match_operand 1 "" "")) | ||
508 | (unspec:DI [(match_operand:DI 2 "const_int_operand")] UNSPEC_CALLEE_ABI) | ||
509 | (clobber (reg:DI LR_REGNUM))] | ||
510 | "" | ||
511 | "@ | ||
512 | - blr\\t%0 | ||
513 | + * return aarch64_indirect_call_asm (operands[0]); | ||
514 | bl\\t%c0" | ||
515 | - [(set_attr "type" "call, call")] | ||
516 | -) | ||
517 | + [(set_attr "type" "call, call")]) | ||
518 | |||
519 | (define_expand "call_value" | ||
520 | [(parallel | ||
521 | @@ -1050,13 +1049,13 @@ | ||
522 | |||
523 | (define_insn "*call_value_insn" | ||
524 | [(set (match_operand 0 "" "") | ||
525 | - (call (mem:DI (match_operand:DI 1 "aarch64_call_insn_operand" "r, Usf")) | ||
526 | + (call (mem:DI (match_operand:DI 1 "aarch64_call_insn_operand" "Ucr, Usf")) | ||
527 | (match_operand 2 "" ""))) | ||
528 | (unspec:DI [(match_operand:DI 3 "const_int_operand")] UNSPEC_CALLEE_ABI) | ||
529 | (clobber (reg:DI LR_REGNUM))] | ||
530 | "" | ||
531 | "@ | ||
532 | - blr\\t%1 | ||
533 | + * return aarch64_indirect_call_asm (operands[1]); | ||
534 | bl\\t%c1" | ||
535 | [(set_attr "type" "call, call")] | ||
536 | ) | ||
537 | diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md | ||
538 | index d993268..8cc6f50 100644 | ||
539 | --- a/gcc/config/aarch64/constraints.md | ||
540 | +++ b/gcc/config/aarch64/constraints.md | ||
541 | @@ -24,6 +24,15 @@ | ||
542 | (define_register_constraint "Ucs" "TAILCALL_ADDR_REGS" | ||
543 | "@internal Registers suitable for an indirect tail call") | ||
544 | |||
545 | +(define_register_constraint "Ucr" | ||
546 | + "aarch64_harden_sls_blr_p () ? STUB_REGS : GENERAL_REGS" | ||
547 | + "@internal Registers to be used for an indirect call. | ||
548 | + This is usually the general registers, but when we are hardening against | ||
549 | + Straight Line Speculation we disallow x16, x17, and x30 so we can use | ||
550 | + indirection stubs. These indirection stubs cannot use the above registers | ||
551 | + since they will be reached by a BL that may have to go through a linker | ||
552 | + veneer.") | ||
553 | + | ||
554 | (define_register_constraint "w" "FP_REGS" | ||
555 | "Floating point and SIMD vector registers.") | ||
556 | |||
557 | diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md | ||
558 | index 215fcec..1754b1e 100644 | ||
559 | --- a/gcc/config/aarch64/predicates.md | ||
560 | +++ b/gcc/config/aarch64/predicates.md | ||
561 | @@ -32,7 +32,8 @@ | ||
562 | |||
563 | (define_predicate "aarch64_general_reg" | ||
564 | (and (match_operand 0 "register_operand") | ||
565 | - (match_test "REGNO_REG_CLASS (REGNO (op)) == GENERAL_REGS"))) | ||
566 | + (match_test "REGNO_REG_CLASS (REGNO (op)) == STUB_REGS | ||
567 | + || REGNO_REG_CLASS (REGNO (op)) == GENERAL_REGS"))) | ||
568 | |||
569 | ;; Return true if OP a (const_int 0) operand. | ||
570 | (define_predicate "const0_operand" | ||
571 | diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c | ||
572 | new file mode 100644 | ||
573 | index 0000000..b1fb754 | ||
574 | --- /dev/null | ||
575 | +++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr-bti.c | ||
576 | @@ -0,0 +1,40 @@ | ||
577 | +/* { dg-do compile } */ | ||
578 | +/* { dg-additional-options "-mharden-sls=blr -mbranch-protection=bti" } */ | ||
579 | +/* | ||
580 | + Ensure that the SLS hardening of BLR leaves no BLR instructions. | ||
581 | + Here we also check that there are no BR instructions with anything except an | ||
582 | + x16 or x17 register. This is because a `BTI c` instruction can be branched | ||
583 | + to using a BLR instruction using any register, but can only be branched to | ||
584 | + with a BR using an x16 or x17 register. | ||
585 | + */ | ||
586 | +typedef int (foo) (int, int); | ||
587 | +typedef void (bar) (int, int); | ||
588 | +struct sls_testclass { | ||
589 | + foo *x; | ||
590 | + bar *y; | ||
591 | + int left; | ||
592 | + int right; | ||
593 | +}; | ||
594 | + | ||
595 | +/* We test both RTL patterns for a call which returns a value and a call which | ||
596 | + does not. */ | ||
597 | +int blr_call_value (struct sls_testclass x) | ||
598 | +{ | ||
599 | + int retval = x.x(x.left, x.right); | ||
600 | + if (retval % 10) | ||
601 | + return 100; | ||
602 | + return 9; | ||
603 | +} | ||
604 | + | ||
605 | +int blr_call (struct sls_testclass x) | ||
606 | +{ | ||
607 | + x.y(x.left, x.right); | ||
608 | + if (x.left % 10) | ||
609 | + return 100; | ||
610 | + return 9; | ||
611 | +} | ||
612 | + | ||
613 | +/* { dg-final { scan-assembler-not {\tblr\t} } } */ | ||
614 | +/* { dg-final { scan-assembler-not {\tbr\tx(?!16|17)} } } */ | ||
615 | +/* { dg-final { scan-assembler {\tbr\tx(16|17)} } } */ | ||
616 | + | ||
617 | diff --git a/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c | ||
618 | new file mode 100644 | ||
619 | index 0000000..88bafff | ||
620 | --- /dev/null | ||
621 | +++ b/gcc/testsuite/gcc.target/aarch64/sls-mitigation/sls-miti-blr.c | ||
622 | @@ -0,0 +1,33 @@ | ||
623 | +/* { dg-additional-options "-mharden-sls=blr -save-temps" } */ | ||
624 | +/* Ensure that the SLS hardening of BLR leaves no BLR instructions. | ||
625 | + We only test that all BLR instructions have been removed, not that the | ||
626 | + resulting code makes sense. */ | ||
627 | +typedef int (foo) (int, int); | ||
628 | +typedef void (bar) (int, int); | ||
629 | +struct sls_testclass { | ||
630 | + foo *x; | ||
631 | + bar *y; | ||
632 | + int left; | ||
633 | + int right; | ||
634 | +}; | ||
635 | + | ||
636 | +/* We test both RTL patterns for a call which returns a value and a call which | ||
637 | + does not. */ | ||
638 | +int blr_call_value (struct sls_testclass x) | ||
639 | +{ | ||
640 | + int retval = x.x(x.left, x.right); | ||
641 | + if (retval % 10) | ||
642 | + return 100; | ||
643 | + return 9; | ||
644 | +} | ||
645 | + | ||
646 | +int blr_call (struct sls_testclass x) | ||
647 | +{ | ||
648 | + x.y(x.left, x.right); | ||
649 | + if (x.left % 10) | ||
650 | + return 100; | ||
651 | + return 9; | ||
652 | +} | ||
653 | + | ||
654 | +/* { dg-final { scan-assembler-not {\tblr\t} } } */ | ||
655 | +/* { dg-final { scan-assembler {\tbr\tx[0-9][0-9]?} } } */ | ||
656 | -- | ||
657 | 2.7.4 | ||
658 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0003-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0003-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch deleted file mode 100644 index 27237feb..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0003-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | From 6e3395c0bc933bdc3242d1dead4896d0aa4e11a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:08:31 +0400 | ||
4 | Subject: [PATCH] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET | ||
5 | |||
6 | Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it. | ||
7 | |||
8 | This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET. | ||
9 | |||
10 | Other changes I had to do include: | ||
11 | |||
12 | - moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though. | ||
13 | |||
14 | - passing the right CFLAGS to configure scripts as exported environment variables | ||
15 | |||
16 | I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do. | ||
17 | |||
18 | Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3? | ||
19 | |||
20 | Signed-off-by: Paolo Bonzini <bonzini@gnu.org> | ||
21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
22 | |||
23 | Upstream-Status: Pending | ||
24 | --- | ||
25 | configure | 32 ++++++++++++++++++++++++++++++++ | ||
26 | 1 file changed, 32 insertions(+) | ||
27 | |||
28 | diff --git a/configure b/configure | ||
29 | index 226a64939d1..b31dc137fc9 100755 | ||
30 | --- a/configure | ||
31 | +++ b/configure | ||
32 | @@ -6971,6 +6971,38 @@ fi | ||
33 | |||
34 | |||
35 | |||
36 | +# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS | ||
37 | +# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS | ||
38 | +# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). | ||
39 | +# We want to ensure that TARGET libraries (which we know are built with | ||
40 | +# gcc) are built with "-O2 -g", so include those options when setting | ||
41 | +# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. | ||
42 | +if test "x$CFLAGS_FOR_TARGET" = x; then | ||
43 | + CFLAGS_FOR_TARGET=$CFLAGS | ||
44 | + case " $CFLAGS " in | ||
45 | + *" -O2 "*) ;; | ||
46 | + *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; | ||
47 | + esac | ||
48 | + case " $CFLAGS " in | ||
49 | + *" -g "* | *" -g3 "*) ;; | ||
50 | + *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; | ||
51 | + esac | ||
52 | +fi | ||
53 | + | ||
54 | + | ||
55 | +if test "x$CXXFLAGS_FOR_TARGET" = x; then | ||
56 | + CXXFLAGS_FOR_TARGET=$CXXFLAGS | ||
57 | + case " $CXXFLAGS " in | ||
58 | + *" -O2 "*) ;; | ||
59 | + *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; | ||
60 | + esac | ||
61 | + case " $CXXFLAGS " in | ||
62 | + *" -g "* | *" -g3 "*) ;; | ||
63 | + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; | ||
64 | + esac | ||
65 | +fi | ||
66 | + | ||
67 | + | ||
68 | # Handle --with-headers=XXX. If the value is not "yes", the contents of | ||
69 | # the named directory are copied to $(tooldir)/sys-include. | ||
70 | if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch deleted file mode 100644 index 7c751bef..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | From 85a7c5aeb82ed61e6ef6d8e061b9da9e6a4a652c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:10:06 +0400 | ||
4 | Subject: [PATCH] 64-bit multilib hack. | ||
5 | |||
6 | GCC has internal multilib handling code but it assumes a very specific rigid directory | ||
7 | layout. The build system implementation of multilib layout is very generic and allows | ||
8 | complete customisation of the library directories. | ||
9 | |||
10 | This patch is a partial solution to allow any custom directories to be passed into gcc | ||
11 | and handled correctly. It forces gcc to use the base_libdir (which is the current | ||
12 | directory, "."). We need to do this for each multilib that is configured as we don't | ||
13 | know which compiler options may be being passed into the compiler. Since we have a compiler | ||
14 | per mulitlib at this point that isn't an issue. | ||
15 | |||
16 | The one problem is the target compiler is only going to work for the default multlilib at | ||
17 | this point. Ideally we'd figure out which multilibs were being enabled with which paths | ||
18 | and be able to patch these entries with a complete set of correct paths but this we | ||
19 | don't have such code at this point. This is something the target gcc recipe should do | ||
20 | and override these platform defaults in its build config. | ||
21 | |||
22 | Do same for riscv64 and aarch64 | ||
23 | |||
24 | RP 15/8/11 | ||
25 | |||
26 | Upstream-Status: Inappropriate[OE-Specific] | ||
27 | |||
28 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
29 | Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com> | ||
30 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
31 | --- | ||
32 | gcc/config/aarch64/t-aarch64-linux | 8 ++++---- | ||
33 | gcc/config/i386/t-linux64 | 6 ++---- | ||
34 | gcc/config/mips/t-linux64 | 10 +++------- | ||
35 | gcc/config/riscv/t-linux | 6 ++++-- | ||
36 | gcc/config/rs6000/t-linux64 | 5 ++--- | ||
37 | 5 files changed, 15 insertions(+), 20 deletions(-) | ||
38 | |||
39 | diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux | ||
40 | index 83e59e33b85..b1356be1fb4 100644 | ||
41 | --- a/gcc/config/aarch64/t-aarch64-linux | ||
42 | +++ b/gcc/config/aarch64/t-aarch64-linux | ||
43 | @@ -21,8 +21,8 @@ | ||
44 | LIB1ASMSRC = aarch64/lib1funcs.asm | ||
45 | LIB1ASMFUNCS = _aarch64_sync_cache_range | ||
46 | |||
47 | -AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) | ||
48 | -MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) | ||
49 | -MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) | ||
50 | +#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) | ||
51 | +#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) | ||
52 | +#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) | ||
53 | |||
54 | -MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) | ||
55 | +#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) | ||
56 | diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 | ||
57 | index 1171e218578..5e057b7e5db 100644 | ||
58 | --- a/gcc/config/i386/t-linux64 | ||
59 | +++ b/gcc/config/i386/t-linux64 | ||
60 | @@ -32,7 +32,5 @@ | ||
61 | # | ||
62 | comma=, | ||
63 | MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) | ||
64 | -MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) | ||
65 | -MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) | ||
66 | -MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) | ||
67 | -MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) | ||
68 | +MULTILIB_DIRNAMES = . . | ||
69 | +MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) | ||
70 | diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64 | ||
71 | index ceb58d3b5f3..43fe2bf28ab 100644 | ||
72 | --- a/gcc/config/mips/t-linux64 | ||
73 | +++ b/gcc/config/mips/t-linux64 | ||
74 | @@ -17,10 +17,6 @@ | ||
75 | # <http://www.gnu.org/licenses/>. | ||
76 | |||
77 | MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64 | ||
78 | -MULTILIB_DIRNAMES = n32 32 64 | ||
79 | -MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el) | ||
80 | -MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft) | ||
81 | -MULTILIB_OSDIRNAMES = \ | ||
82 | - ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \ | ||
83 | - ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \ | ||
84 | - ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT)) | ||
85 | +MULTILIB_DIRNAMES = . . . | ||
86 | +MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) | ||
87 | + | ||
88 | diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux | ||
89 | index 216d2776a18..e4d817621fc 100644 | ||
90 | --- a/gcc/config/riscv/t-linux | ||
91 | +++ b/gcc/config/riscv/t-linux | ||
92 | @@ -1,3 +1,5 @@ | ||
93 | # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ | ||
94 | -MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) | ||
95 | -MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) | ||
96 | +#MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) | ||
97 | +MULTILIB_DIRNAMES := . . | ||
98 | +#MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) | ||
99 | +MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) | ||
100 | diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 | ||
101 | index 264a7e27524..dc9d440f66b 100644 | ||
102 | --- a/gcc/config/rs6000/t-linux64 | ||
103 | +++ b/gcc/config/rs6000/t-linux64 | ||
104 | @@ -26,10 +26,9 @@ | ||
105 | # MULTILIB_OSDIRNAMES according to what is found on the target. | ||
106 | |||
107 | MULTILIB_OPTIONS := m64/m32 | ||
108 | -MULTILIB_DIRNAMES := 64 32 | ||
109 | +MULTILIB_DIRNAMES := . . | ||
110 | MULTILIB_EXTRA_OPTS := | ||
111 | -MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) | ||
112 | -MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) | ||
113 | +MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) | ||
114 | |||
115 | rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c | ||
116 | $(COMPILE) $< | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch deleted file mode 100644 index 4020c9e3..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0005-optional-libstdc.patch +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | From 6ddfb0bfcd1eea71acd37ab06f7a4510b9f1d12b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:12:56 +0400 | ||
4 | Subject: [PATCH] optional libstdc | ||
5 | |||
6 | gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ | ||
7 | will not run correctly since by default the linker will try to link against libstdc++ | ||
8 | which shouldn't exist yet. We need an option to disable -lstdc++ | ||
9 | option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc | ||
10 | driver. This patch adds such an option which only disables the -lstdc++. | ||
11 | |||
12 | A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to | ||
13 | do this officially, the likely answer is don't build libstdc++ separately. | ||
14 | |||
15 | RP 29/6/10 | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | |||
19 | Upstream-Status: Inappropriate [embedded specific] | ||
20 | --- | ||
21 | gcc/c-family/c.opt | 4 ++++ | ||
22 | gcc/cp/g++spec.c | 1 + | ||
23 | gcc/doc/invoke.texi | 32 +++++++++++++++++++++++++++++++- | ||
24 | gcc/gcc.c | 1 + | ||
25 | 4 files changed, 37 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt | ||
28 | index c49da99d395..35f712e2c84 100644 | ||
29 | --- a/gcc/c-family/c.opt | ||
30 | +++ b/gcc/c-family/c.opt | ||
31 | @@ -2025,6 +2025,10 @@ nostdinc++ | ||
32 | C++ ObjC++ | ||
33 | Do not search standard system include directories for C++. | ||
34 | |||
35 | +nostdlib++ | ||
36 | +Driver | ||
37 | +Do not link standard C++ runtime library | ||
38 | + | ||
39 | o | ||
40 | C ObjC C++ ObjC++ Joined Separate | ||
41 | ; Documented in common.opt | ||
42 | diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c | ||
43 | index 0ab63bcd211..7b081e9e4f0 100644 | ||
44 | --- a/gcc/cp/g++spec.c | ||
45 | +++ b/gcc/cp/g++spec.c | ||
46 | @@ -137,6 +137,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, | ||
47 | switch (decoded_options[i].opt_index) | ||
48 | { | ||
49 | case OPT_nostdlib: | ||
50 | + case OPT_nostdlib__: | ||
51 | case OPT_nodefaultlibs: | ||
52 | library = -1; | ||
53 | break; | ||
54 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi | ||
55 | index f12d8d12150..cf6cb428e7d 100644 | ||
56 | --- a/gcc/doc/invoke.texi | ||
57 | +++ b/gcc/doc/invoke.texi | ||
58 | @@ -230,6 +230,9 @@ in the following sections. | ||
59 | -fno-weak -nostdinc++ @gol | ||
60 | -fvisibility-inlines-hidden @gol | ||
61 | -fvisibility-ms-compat @gol | ||
62 | +-fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol | ||
63 | +-fvtv-counts -fvtv-debug @gol | ||
64 | +-nostdlib++ @gol | ||
65 | -fext-numeric-literals @gol | ||
66 | -Wabi-tag -Wcatch-value -Wcatch-value=@var{n} @gol | ||
67 | -Wno-class-conversion -Wclass-memaccess @gol | ||
68 | @@ -599,7 +602,7 @@ Objective-C and Objective-C++ Dialects}. | ||
69 | -pie -pthread -r -rdynamic @gol | ||
70 | -s -static -static-pie -static-libgcc -static-libstdc++ @gol | ||
71 | -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol | ||
72 | --shared -shared-libgcc -symbolic @gol | ||
73 | +-shared -shared-libgcc -symbolic -nostdlib++ @gol | ||
74 | -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol | ||
75 | -u @var{symbol} -z @var{keyword}} | ||
76 | |||
77 | @@ -14407,6 +14410,33 @@ Specify that the program entry point is @var{entry}. The argument is | ||
78 | interpreted by the linker; the GNU linker accepts either a symbol name | ||
79 | or an address. | ||
80 | |||
81 | +@item -nostdlib++ | ||
82 | +@opindex nostdlib++ | ||
83 | +Do not use the standard system C++ runtime libraries when linking. | ||
84 | +Only the libraries you specify will be passed to the linker. | ||
85 | + | ||
86 | +@cindex @option{-lgcc}, use with @option{-nostdlib} | ||
87 | +@cindex @option{-nostdlib} and unresolved references | ||
88 | +@cindex unresolved references and @option{-nostdlib} | ||
89 | +@cindex @option{-lgcc}, use with @option{-nodefaultlibs} | ||
90 | +@cindex @option{-nodefaultlibs} and unresolved references | ||
91 | +@cindex unresolved references and @option{-nodefaultlibs} | ||
92 | +One of the standard libraries bypassed by @option{-nostdlib} and | ||
93 | +@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines | ||
94 | +which GCC uses to overcome shortcomings of particular machines, or special | ||
95 | +needs for some languages. | ||
96 | +(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler | ||
97 | +Collection (GCC) Internals}, | ||
98 | +for more discussion of @file{libgcc.a}.) | ||
99 | +In most cases, you need @file{libgcc.a} even when you want to avoid | ||
100 | +other standard libraries. In other words, when you specify @option{-nostdlib} | ||
101 | +or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well. | ||
102 | +This ensures that you have no unresolved references to internal GCC | ||
103 | +library subroutines. | ||
104 | +(An example of such an internal subroutine is @code{__main}, used to ensure C++ | ||
105 | +constructors are called; @pxref{Collect2,,@code{collect2}, gccint, | ||
106 | +GNU Compiler Collection (GCC) Internals}.) | ||
107 | + | ||
108 | @item -pie | ||
109 | @opindex pie | ||
110 | Produce a dynamically linked position independent executable on targets | ||
111 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
112 | index b2200c5185a..f8be58ce0a6 100644 | ||
113 | --- a/gcc/gcc.c | ||
114 | +++ b/gcc/gcc.c | ||
115 | @@ -1051,6 +1051,7 @@ proper position among the other output files. */ | ||
116 | %(mflib) " STACK_SPLIT_SPEC "\ | ||
117 | %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ | ||
118 | %{!nostdlib:%{!r:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}}\ | ||
119 | + %{!nostdlib++:}\ | ||
120 | %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} \n%(post_link) }}}}}}" | ||
121 | #endif | ||
122 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0006-COLLECT_GCC_OPTIONS.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0006-COLLECT_GCC_OPTIONS.patch deleted file mode 100644 index 9fbbe807..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0006-COLLECT_GCC_OPTIONS.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From a6c90d3a9c5010b4aa7cc30467cf81ca7e0f430e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:16:28 +0400 | ||
4 | Subject: [PATCH] COLLECT_GCC_OPTIONS | ||
5 | |||
6 | This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to | ||
7 | invoke collect2. | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | --- | ||
13 | gcc/gcc.c | 9 +++++++++ | ||
14 | 1 file changed, 9 insertions(+) | ||
15 | |||
16 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
17 | index f8be58ce0a6..48b0f9dde81 100644 | ||
18 | --- a/gcc/gcc.c | ||
19 | +++ b/gcc/gcc.c | ||
20 | @@ -4806,6 +4806,15 @@ set_collect_gcc_options (void) | ||
21 | sizeof ("COLLECT_GCC_OPTIONS=") - 1); | ||
22 | |||
23 | first_time = TRUE; | ||
24 | +#ifdef HAVE_LD_SYSROOT | ||
25 | + if (target_system_root_changed && target_system_root) | ||
26 | + { | ||
27 | + obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1); | ||
28 | + obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root)); | ||
29 | + obstack_grow (&collect_obstack, "'", 1); | ||
30 | + first_time = FALSE; | ||
31 | + } | ||
32 | +#endif | ||
33 | for (i = 0; (int) i < n_switches; i++) | ||
34 | { | ||
35 | const char *const *args; | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch deleted file mode 100644 index a764bdd0..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | From 5670d4489f119d2da661734895ac0be99b606d1b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:17:25 +0400 | ||
4 | Subject: [PATCH] Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B} | ||
5 | |||
6 | Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that | ||
7 | the source can be shared between gcc-cross-initial, | ||
8 | gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | While compiling gcc-crosssdk-initial-x86_64 on some host, there is | ||
15 | occasionally failure that test the existance of default.h doesn't | ||
16 | work, the reason is tm_include_list='** defaults.h' rather than | ||
17 | tm_include_list='** ./defaults.h' | ||
18 | |||
19 | So we add the test condition for this situation. | ||
20 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
21 | --- | ||
22 | gcc/Makefile.in | 2 +- | ||
23 | gcc/configure | 4 ++-- | ||
24 | gcc/configure.ac | 4 ++-- | ||
25 | gcc/mkconfig.sh | 4 ++-- | ||
26 | 4 files changed, 7 insertions(+), 7 deletions(-) | ||
27 | |||
28 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
29 | index 543b477ff18..a67d2cc18d6 100644 | ||
30 | --- a/gcc/Makefile.in | ||
31 | +++ b/gcc/Makefile.in | ||
32 | @@ -540,7 +540,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ | ||
33 | TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ | ||
34 | |||
35 | xmake_file=@xmake_file@ | ||
36 | -tmake_file=@tmake_file@ | ||
37 | +tmake_file=@tmake_file@ ./t-oe | ||
38 | TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ | ||
39 | TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ | ||
40 | TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ | ||
41 | diff --git a/gcc/configure b/gcc/configure | ||
42 | index 8de766a942c..b26e8fc7fee 100755 | ||
43 | --- a/gcc/configure | ||
44 | +++ b/gcc/configure | ||
45 | @@ -12705,8 +12705,8 @@ for f in $tm_file; do | ||
46 | tm_include_list="${tm_include_list} $f" | ||
47 | ;; | ||
48 | defaults.h ) | ||
49 | - tm_file_list="${tm_file_list} \$(srcdir)/$f" | ||
50 | - tm_include_list="${tm_include_list} $f" | ||
51 | + tm_file_list="${tm_file_list} ./$f" | ||
52 | + tm_include_list="${tm_include_list} ./$f" | ||
53 | ;; | ||
54 | * ) | ||
55 | tm_file_list="${tm_file_list} \$(srcdir)/config/$f" | ||
56 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
57 | index 8bfd6feb780..26fa46802c7 100644 | ||
58 | --- a/gcc/configure.ac | ||
59 | +++ b/gcc/configure.ac | ||
60 | @@ -2138,8 +2138,8 @@ for f in $tm_file; do | ||
61 | tm_include_list="${tm_include_list} $f" | ||
62 | ;; | ||
63 | defaults.h ) | ||
64 | - tm_file_list="${tm_file_list} \$(srcdir)/$f" | ||
65 | - tm_include_list="${tm_include_list} $f" | ||
66 | + tm_file_list="${tm_file_list} ./$f" | ||
67 | + tm_include_list="${tm_include_list} ./$f" | ||
68 | ;; | ||
69 | * ) | ||
70 | tm_file_list="${tm_file_list} \$(srcdir)/config/$f" | ||
71 | diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh | ||
72 | index d2c677a4a42..d03852481cb 100644 | ||
73 | --- a/gcc/mkconfig.sh | ||
74 | +++ b/gcc/mkconfig.sh | ||
75 | @@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then | ||
76 | if [ $# -ge 1 ]; then | ||
77 | echo '#ifdef IN_GCC' >> ${output}T | ||
78 | for file in "$@"; do | ||
79 | - if test x"$file" = x"defaults.h"; then | ||
80 | + if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then | ||
81 | postpone_defaults_h="yes" | ||
82 | else | ||
83 | echo "# include \"$file\"" >> ${output}T | ||
84 | @@ -106,7 +106,7 @@ esac | ||
85 | |||
86 | # If we postponed including defaults.h, add the #include now. | ||
87 | if test x"$postpone_defaults_h" = x"yes"; then | ||
88 | - echo "# include \"defaults.h\"" >> ${output}T | ||
89 | + echo "# include \"./defaults.h\"" >> ${output}T | ||
90 | fi | ||
91 | |||
92 | # Add multiple inclusion protection guard, part two. | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0008-fortran-cross-compile-hack.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0008-fortran-cross-compile-hack.patch deleted file mode 100644 index 714db3be..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0008-fortran-cross-compile-hack.patch +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | From f05062625e7a4751be723595a2f7a4b7fbeff311 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:20:01 +0400 | ||
4 | Subject: [PATCH] fortran cross-compile hack. | ||
5 | |||
6 | * Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used | ||
7 | used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross | ||
8 | directory. | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | |||
12 | Upstream-Status: Inappropriate [embedded specific] | ||
13 | --- | ||
14 | libgfortran/configure | 2 +- | ||
15 | libgfortran/configure.ac | 2 +- | ||
16 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/libgfortran/configure b/libgfortran/configure | ||
19 | index b4cf854ddb3..e8e0ac3b1cf 100755 | ||
20 | --- a/libgfortran/configure | ||
21 | +++ b/libgfortran/configure | ||
22 | @@ -13090,7 +13090,7 @@ esac | ||
23 | |||
24 | # We need gfortran to compile parts of the library | ||
25 | #AC_PROG_FC(gfortran) | ||
26 | -FC="$GFORTRAN" | ||
27 | +#FC="$GFORTRAN" | ||
28 | ac_ext=${ac_fc_srcext-f} | ||
29 | ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' | ||
30 | ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' | ||
31 | diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac | ||
32 | index 711dc60ff78..3c9bbfbf47d 100644 | ||
33 | --- a/libgfortran/configure.ac | ||
34 | +++ b/libgfortran/configure.ac | ||
35 | @@ -258,7 +258,7 @@ AC_SUBST(enable_static) | ||
36 | |||
37 | # We need gfortran to compile parts of the library | ||
38 | #AC_PROG_FC(gfortran) | ||
39 | -FC="$GFORTRAN" | ||
40 | +#FC="$GFORTRAN" | ||
41 | AC_PROG_FC(gfortran) | ||
42 | |||
43 | # extra LD Flags which are required for targets | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch deleted file mode 100644 index 8ad6853d..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | From 1d76de7f1f5c99f1fa1a4b14aedad3d702e4e136 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:22:00 +0400 | ||
4 | Subject: [PATCH] cpp: honor sysroot. | ||
5 | |||
6 | Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile | ||
7 | preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location | ||
8 | rather than the --sysroot option specified on the commandline. If access to that directory is | ||
9 | permission denied (unreadable), gcc will error. | ||
10 | |||
11 | This happens when ccache is in use due to the fact it uses preprocessed source files. | ||
12 | |||
13 | The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, | ||
14 | -isystem, -isysroot happen and the correct sysroot is used. | ||
15 | |||
16 | [YOCTO #2074] | ||
17 | |||
18 | RP 2012/04/13 | ||
19 | |||
20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
21 | |||
22 | Upstream-Status: Pending | ||
23 | --- | ||
24 | gcc/cp/lang-specs.h | 2 +- | ||
25 | gcc/gcc.c | 2 +- | ||
26 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h | ||
29 | index 0ad4a33b93e..16c744f4f90 100644 | ||
30 | --- a/gcc/cp/lang-specs.h | ||
31 | +++ b/gcc/cp/lang-specs.h | ||
32 | @@ -66,5 +66,5 @@ along with GCC; see the file COPYING3. If not see | ||
33 | {".ii", "@c++-cpp-output", 0, 0, 0}, | ||
34 | {"@c++-cpp-output", | ||
35 | "%{!E:%{!M:%{!MM:" | ||
36 | - " cc1plus -fpreprocessed %i %(cc1_options) %2" | ||
37 | + " cc1plus -fpreprocessed %i %I %(cc1_options) %2" | ||
38 | " %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, | ||
39 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
40 | index 48b0f9dde81..c87f603955f 100644 | ||
41 | --- a/gcc/gcc.c | ||
42 | +++ b/gcc/gcc.c | ||
43 | @@ -1348,7 +1348,7 @@ static const struct compiler default_compilers[] = | ||
44 | %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0}, | ||
45 | {".i", "@cpp-output", 0, 0, 0}, | ||
46 | {"@cpp-output", | ||
47 | - "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, | ||
48 | + "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, | ||
49 | {".s", "@assembler", 0, 0, 0}, | ||
50 | {"@assembler", | ||
51 | "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0010-MIPS64-Default-to-N64-ABI.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0010-MIPS64-Default-to-N64-ABI.patch deleted file mode 100644 index 625e2d87..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0010-MIPS64-Default-to-N64-ABI.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From 4fad4433c96bc9d0d9d124f9674fb3389f6f426e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:23:08 +0400 | ||
4 | Subject: [PATCH] MIPS64: Default to N64 ABI | ||
5 | |||
6 | MIPS64 defaults to n32 ABI, this patch makes it | ||
7 | so that it defaults to N64 ABI | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | Upstream-Status: Inappropriate [OE config specific] | ||
12 | --- | ||
13 | gcc/config.gcc | 10 +++++----- | ||
14 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/gcc/config.gcc b/gcc/config.gcc | ||
17 | index cf1a87e2efd..37c4221a39f 100644 | ||
18 | --- a/gcc/config.gcc | ||
19 | +++ b/gcc/config.gcc | ||
20 | @@ -2511,29 +2511,29 @@ mips*-*-linux*) # Linux MIPS, either endian. | ||
21 | default_mips_arch=mips32 | ||
22 | ;; | ||
23 | mips64el-st-linux-gnu) | ||
24 | - default_mips_abi=n32 | ||
25 | + default_mips_abi=64 | ||
26 | tm_file="${tm_file} mips/st.h" | ||
27 | tmake_file="${tmake_file} mips/t-st" | ||
28 | enable_mips_multilibs="yes" | ||
29 | ;; | ||
30 | mips64octeon*-*-linux*) | ||
31 | - default_mips_abi=n32 | ||
32 | + default_mips_abi=64 | ||
33 | tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\"" | ||
34 | target_cpu_default=MASK_SOFT_FLOAT_ABI | ||
35 | enable_mips_multilibs="yes" | ||
36 | ;; | ||
37 | mipsisa64r6*-*-linux*) | ||
38 | - default_mips_abi=n32 | ||
39 | + default_mips_abi=64 | ||
40 | default_mips_arch=mips64r6 | ||
41 | enable_mips_multilibs="yes" | ||
42 | ;; | ||
43 | mipsisa64r2*-*-linux*) | ||
44 | - default_mips_abi=n32 | ||
45 | + default_mips_abi=64 | ||
46 | default_mips_arch=mips64r2 | ||
47 | enable_mips_multilibs="yes" | ||
48 | ;; | ||
49 | mips64*-*-linux* | mipsisa64*-*-linux*) | ||
50 | - default_mips_abi=n32 | ||
51 | + default_mips_abi=64 | ||
52 | enable_mips_multilibs="yes" | ||
53 | ;; | ||
54 | esac | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch deleted file mode 100644 index e3579763..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch +++ /dev/null | |||
@@ -1,243 +0,0 @@ | |||
1 | From 8fc016a53c22c19feccbfa13ebdf19090dc67058 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:24:50 +0400 | ||
4 | Subject: [PATCH] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER | ||
5 | relative to SYSTEMLIBS_DIR | ||
6 | |||
7 | This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER | ||
8 | relative to SYSTEMLIBS_DIR which can be set in generated headers | ||
9 | This breaks the assumption of hardcoded multilib in gcc | ||
10 | Change is only for the supported architectures in OE including | ||
11 | SH, sparc, alpha for possible future support (if any) | ||
12 | |||
13 | Removes the do_headerfix task in metadata | ||
14 | |||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | |||
17 | Upstream-Status: Inappropriate [OE configuration] | ||
18 | --- | ||
19 | gcc/config/alpha/linux-elf.h | 4 ++-- | ||
20 | gcc/config/arm/linux-eabi.h | 4 ++-- | ||
21 | gcc/config/arm/linux-elf.h | 2 +- | ||
22 | gcc/config/i386/linux.h | 2 +- | ||
23 | gcc/config/i386/linux64.h | 6 +++--- | ||
24 | gcc/config/linux.h | 8 ++++---- | ||
25 | gcc/config/mips/linux.h | 12 ++++++------ | ||
26 | gcc/config/riscv/linux.h | 2 +- | ||
27 | gcc/config/rs6000/linux64.h | 15 +++++---------- | ||
28 | gcc/config/sh/linux.h | 2 +- | ||
29 | gcc/config/sparc/linux.h | 2 +- | ||
30 | gcc/config/sparc/linux64.h | 4 ++-- | ||
31 | 12 files changed, 29 insertions(+), 34 deletions(-) | ||
32 | |||
33 | diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h | ||
34 | index e25fcac3c59..01aca0c6542 100644 | ||
35 | --- a/gcc/config/alpha/linux-elf.h | ||
36 | +++ b/gcc/config/alpha/linux-elf.h | ||
37 | @@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see | ||
38 | #define EXTRA_SPECS \ | ||
39 | { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, | ||
40 | |||
41 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
42 | -#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" | ||
43 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" | ||
44 | +#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0" | ||
45 | #if DEFAULT_LIBC == LIBC_UCLIBC | ||
46 | #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" | ||
47 | #elif DEFAULT_LIBC == LIBC_GLIBC | ||
48 | diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h | ||
49 | index 5bdcfa0c5d3..0c0332f317f 100644 | ||
50 | --- a/gcc/config/arm/linux-eabi.h | ||
51 | +++ b/gcc/config/arm/linux-eabi.h | ||
52 | @@ -65,8 +65,8 @@ | ||
53 | GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ | ||
54 | |||
55 | #undef GLIBC_DYNAMIC_LINKER | ||
56 | -#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" | ||
57 | -#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" | ||
58 | +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3" | ||
59 | +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3" | ||
60 | #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT | ||
61 | |||
62 | #define GLIBC_DYNAMIC_LINKER \ | ||
63 | diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h | ||
64 | index 0ec3aa53189..abfa9566d74 100644 | ||
65 | --- a/gcc/config/arm/linux-elf.h | ||
66 | +++ b/gcc/config/arm/linux-elf.h | ||
67 | @@ -60,7 +60,7 @@ | ||
68 | |||
69 | #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" | ||
70 | |||
71 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
72 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" | ||
73 | |||
74 | #define LINUX_TARGET_LINK_SPEC "%{h*} \ | ||
75 | %{static:-Bstatic} \ | ||
76 | diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h | ||
77 | index 9f823f125ed..e0390b7d5e3 100644 | ||
78 | --- a/gcc/config/i386/linux.h | ||
79 | +++ b/gcc/config/i386/linux.h | ||
80 | @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see | ||
81 | <http://www.gnu.org/licenses/>. */ | ||
82 | |||
83 | #define GNU_USER_LINK_EMULATION "elf_i386" | ||
84 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
85 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" | ||
86 | |||
87 | #undef MUSL_DYNAMIC_LINKER | ||
88 | #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" | ||
89 | diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h | ||
90 | index 6cb68d1ccfa..7de09ec857c 100644 | ||
91 | --- a/gcc/config/i386/linux64.h | ||
92 | +++ b/gcc/config/i386/linux64.h | ||
93 | @@ -27,9 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
94 | #define GNU_USER_LINK_EMULATION64 "elf_x86_64" | ||
95 | #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" | ||
96 | |||
97 | -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" | ||
98 | -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" | ||
99 | -#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" | ||
100 | +#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" | ||
101 | +#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2" | ||
102 | +#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2" | ||
103 | |||
104 | #undef MUSL_DYNAMIC_LINKER32 | ||
105 | #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" | ||
106 | diff --git a/gcc/config/linux.h b/gcc/config/linux.h | ||
107 | index 95654bcdb5a..0c1a8118a26 100644 | ||
108 | --- a/gcc/config/linux.h | ||
109 | +++ b/gcc/config/linux.h | ||
110 | @@ -94,10 +94,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
111 | GLIBC_DYNAMIC_LINKER must be defined for each target using them, or | ||
112 | GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets | ||
113 | supporting both 32-bit and 64-bit compilation. */ | ||
114 | -#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" | ||
115 | -#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" | ||
116 | -#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" | ||
117 | -#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0" | ||
118 | +#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0" | ||
119 | +#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" | ||
120 | +#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" | ||
121 | +#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0" | ||
122 | #define BIONIC_DYNAMIC_LINKER "/system/bin/linker" | ||
123 | #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" | ||
124 | #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" | ||
125 | diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h | ||
126 | index 54446e58e5f..4786ee304c1 100644 | ||
127 | --- a/gcc/config/mips/linux.h | ||
128 | +++ b/gcc/config/mips/linux.h | ||
129 | @@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see | ||
130 | #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" | ||
131 | |||
132 | #define GLIBC_DYNAMIC_LINKER32 \ | ||
133 | - "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}" | ||
134 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" | ||
135 | #define GLIBC_DYNAMIC_LINKER64 \ | ||
136 | - "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}" | ||
137 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" | ||
138 | #define GLIBC_DYNAMIC_LINKERN32 \ | ||
139 | - "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}" | ||
140 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" | ||
141 | |||
142 | #undef UCLIBC_DYNAMIC_LINKER32 | ||
143 | #define UCLIBC_DYNAMIC_LINKER32 \ | ||
144 | - "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}" | ||
145 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}" | ||
146 | #undef UCLIBC_DYNAMIC_LINKER64 | ||
147 | #define UCLIBC_DYNAMIC_LINKER64 \ | ||
148 | - "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}" | ||
149 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}" | ||
150 | #define UCLIBC_DYNAMIC_LINKERN32 \ | ||
151 | - "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" | ||
152 | + "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}" | ||
153 | |||
154 | #undef MUSL_DYNAMIC_LINKER32 | ||
155 | #define MUSL_DYNAMIC_LINKER32 \ | ||
156 | diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h | ||
157 | index 4afef7c228c..01997330741 100644 | ||
158 | --- a/gcc/config/riscv/linux.h | ||
159 | +++ b/gcc/config/riscv/linux.h | ||
160 | @@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see | ||
161 | GNU_USER_TARGET_OS_CPP_BUILTINS(); \ | ||
162 | } while (0) | ||
163 | |||
164 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-riscv" XLEN_SPEC "-" ABI_SPEC ".so.1" | ||
165 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-riscv" XLEN_SPEC "-" ABI_SPEC ".so.1" | ||
166 | |||
167 | #define MUSL_ABI_SUFFIX \ | ||
168 | "%{mabi=ilp32:-sf}" \ | ||
169 | diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h | ||
170 | index 34776c8421e..967c1c43c63 100644 | ||
171 | --- a/gcc/config/rs6000/linux64.h | ||
172 | +++ b/gcc/config/rs6000/linux64.h | ||
173 | @@ -419,24 +419,19 @@ extern int dot_symbols; | ||
174 | #undef LINK_OS_DEFAULT_SPEC | ||
175 | #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" | ||
176 | |||
177 | -#define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1" | ||
178 | - | ||
179 | +#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1" | ||
180 | #ifdef LINUX64_DEFAULT_ABI_ELFv2 | ||
181 | -#define GLIBC_DYNAMIC_LINKER64 \ | ||
182 | -"%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \ | ||
183 | -":%(dynamic_linker_prefix)/lib64/ld64.so.2}" | ||
184 | +#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}" | ||
185 | #else | ||
186 | -#define GLIBC_DYNAMIC_LINKER64 \ | ||
187 | -"%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \ | ||
188 | -":%(dynamic_linker_prefix)/lib64/ld64.so.1}" | ||
189 | +#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}" | ||
190 | #endif | ||
191 | |||
192 | #undef MUSL_DYNAMIC_LINKER32 | ||
193 | #define MUSL_DYNAMIC_LINKER32 \ | ||
194 | - "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | ||
195 | + SYSTEMLIBS_DIR "ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | ||
196 | #undef MUSL_DYNAMIC_LINKER64 | ||
197 | #define MUSL_DYNAMIC_LINKER64 \ | ||
198 | - "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | ||
199 | + SYSTEMLIBS_DIR "ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | ||
200 | |||
201 | #undef DEFAULT_ASM_ENDIAN | ||
202 | #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) | ||
203 | diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h | ||
204 | index c1d0441d488..81373eb8336 100644 | ||
205 | --- a/gcc/config/sh/linux.h | ||
206 | +++ b/gcc/config/sh/linux.h | ||
207 | @@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see | ||
208 | "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \ | ||
209 | "%{mfdpic:-fdpic}.so.1" | ||
210 | |||
211 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
212 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" | ||
213 | |||
214 | #undef SUBTARGET_LINK_EMUL_SUFFIX | ||
215 | #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}" | ||
216 | diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h | ||
217 | index 81201e67a2f..8b6fc577594 100644 | ||
218 | --- a/gcc/config/sparc/linux.h | ||
219 | +++ b/gcc/config/sparc/linux.h | ||
220 | @@ -84,7 +84,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); | ||
221 | When the -shared link option is used a final link is not being | ||
222 | done. */ | ||
223 | |||
224 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
225 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" | ||
226 | |||
227 | #undef LINK_SPEC | ||
228 | #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ | ||
229 | diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h | ||
230 | index a1a0efd8f28..85d1084afc2 100644 | ||
231 | --- a/gcc/config/sparc/linux64.h | ||
232 | +++ b/gcc/config/sparc/linux64.h | ||
233 | @@ -84,8 +84,8 @@ along with GCC; see the file COPYING3. If not see | ||
234 | When the -shared link option is used a final link is not being | ||
235 | done. */ | ||
236 | |||
237 | -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" | ||
238 | -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" | ||
239 | +#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" | ||
240 | +#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2" | ||
241 | |||
242 | #ifdef SPARC_BI_ARCH | ||
243 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch deleted file mode 100644 index 88e1715b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From a22d1264049d29b90663cf5667049ae6f9b7a5ce Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:26:37 +0400 | ||
4 | Subject: [PATCH] gcc: Fix argument list too long error. | ||
5 | |||
6 | There would be an "Argument list too long" error when the | ||
7 | build directory is longer than 200, this is caused by: | ||
8 | |||
9 | headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u` | ||
10 | |||
11 | The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle | ||
12 | it, use the $(sort list) of GNU make which can handle the too long list | ||
13 | would fix the problem, the header would be short enough after sorted. | ||
14 | The "tr ' ' '\012'" was used for translating the space to "\n", the | ||
15 | $(sort list) doesn't need this. | ||
16 | |||
17 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | |||
20 | RP: gcc then added *.h and *.def additions to this list, breaking the original | ||
21 | fix. Add the sort to the original gcc code, leaving the tr+sort to fix the original | ||
22 | issue but include the new files too as reported by Zhuang <qiuguang.zqg@alibaba-inc.com> | ||
23 | |||
24 | Upstream-Status: Pending | ||
25 | --- | ||
26 | gcc/Makefile.in | 2 +- | ||
27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
28 | |||
29 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
30 | index a67d2cc18d6..480c9366418 100644 | ||
31 | --- a/gcc/Makefile.in | ||
32 | +++ b/gcc/Makefile.in | ||
33 | @@ -3606,7 +3606,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype | ||
34 | # We keep the directory structure for files in config or c-family and .def | ||
35 | # files. All other files are flattened to a single directory. | ||
36 | $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) | ||
37 | - headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ | ||
38 | + headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ | ||
39 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ | ||
40 | for file in $$headers; do \ | ||
41 | if [ -f $$file ] ; then \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0013-Disable-sdt.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0013-Disable-sdt.patch deleted file mode 100644 index 207cdb57..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0013-Disable-sdt.patch +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | From fa47586935a18ecfc2ad5586802e326e21741b7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:28:10 +0400 | ||
4 | Subject: [PATCH] Disable sdt. | ||
5 | |||
6 | We don't list dtrace in DEPENDS so we shouldn't be depending on this header. | ||
7 | It may or may not exist from preivous builds though. To be determinstic, disable | ||
8 | sdt.h usage always. This avoids build failures if the header is removed after configure | ||
9 | but before libgcc is compiled for example. | ||
10 | |||
11 | RP 2012/8/7 | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | |||
15 | Disable sdt for libstdc++-v3. | ||
16 | |||
17 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
18 | |||
19 | Upstream-Status: Inappropriate [hack] | ||
20 | --- | ||
21 | gcc/configure | 12 ++++++------ | ||
22 | gcc/configure.ac | 18 +++++++++--------- | ||
23 | libstdc++-v3/configure | 6 +++--- | ||
24 | libstdc++-v3/configure.ac | 2 +- | ||
25 | 4 files changed, 19 insertions(+), 19 deletions(-) | ||
26 | |||
27 | diff --git a/gcc/configure b/gcc/configure | ||
28 | index b26e8fc7fee..6080f86145e 100755 | ||
29 | --- a/gcc/configure | ||
30 | +++ b/gcc/configure | ||
31 | @@ -29789,12 +29789,12 @@ fi | ||
32 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 | ||
33 | $as_echo_n "checking sys/sdt.h in the target C library... " >&6; } | ||
34 | have_sys_sdt_h=no | ||
35 | -if test -f $target_header_dir/sys/sdt.h; then | ||
36 | - have_sys_sdt_h=yes | ||
37 | - | ||
38 | -$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h | ||
39 | - | ||
40 | -fi | ||
41 | +#if test -f $target_header_dir/sys/sdt.h; then | ||
42 | +# have_sys_sdt_h=yes | ||
43 | +# | ||
44 | +#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h | ||
45 | +# | ||
46 | +#fi | ||
47 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 | ||
48 | $as_echo "$have_sys_sdt_h" >&6; } | ||
49 | |||
50 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
51 | index 26fa46802c7..42be5252778 100644 | ||
52 | --- a/gcc/configure.ac | ||
53 | +++ b/gcc/configure.ac | ||
54 | @@ -6190,15 +6190,15 @@ fi | ||
55 | AC_SUBST([enable_default_ssp]) | ||
56 | |||
57 | # Test for <sys/sdt.h> on the target. | ||
58 | -GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) | ||
59 | -AC_MSG_CHECKING(sys/sdt.h in the target C library) | ||
60 | -have_sys_sdt_h=no | ||
61 | -if test -f $target_header_dir/sys/sdt.h; then | ||
62 | - have_sys_sdt_h=yes | ||
63 | - AC_DEFINE(HAVE_SYS_SDT_H, 1, | ||
64 | - [Define if your target C library provides sys/sdt.h]) | ||
65 | -fi | ||
66 | -AC_MSG_RESULT($have_sys_sdt_h) | ||
67 | +#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) | ||
68 | +#AC_MSG_CHECKING(sys/sdt.h in the target C library) | ||
69 | +#have_sys_sdt_h=no | ||
70 | +#if test -f $target_header_dir/sys/sdt.h; then | ||
71 | +# have_sys_sdt_h=yes | ||
72 | +# AC_DEFINE(HAVE_SYS_SDT_H, 1, | ||
73 | +# [Define if your target C library provides sys/sdt.h]) | ||
74 | +#fi | ||
75 | +#AC_MSG_RESULT($have_sys_sdt_h) | ||
76 | |||
77 | # Check if TFmode long double should be used by default or not. | ||
78 | # Some glibc targets used DFmode long double, but with glibc 2.4 | ||
79 | diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure | ||
80 | index 9f9c5a2419a..71ed13b815b 100755 | ||
81 | --- a/libstdc++-v3/configure | ||
82 | +++ b/libstdc++-v3/configure | ||
83 | @@ -22615,11 +22615,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | ||
84 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | ||
85 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | ||
86 | |||
87 | - if test $glibcxx_cv_sys_sdt_h = yes; then | ||
88 | +# if test $glibcxx_cv_sys_sdt_h = yes; then | ||
89 | |||
90 | -$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h | ||
91 | +#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h | ||
92 | |||
93 | - fi | ||
94 | +# fi | ||
95 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5 | ||
96 | $as_echo "$glibcxx_cv_sys_sdt_h" >&6; } | ||
97 | |||
98 | diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac | ||
99 | index 699e55fd829..5c7a7bda439 100644 | ||
100 | --- a/libstdc++-v3/configure.ac | ||
101 | +++ b/libstdc++-v3/configure.ac | ||
102 | @@ -241,7 +241,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN | ||
103 | GLIBCXX_CHECK_SC_NPROC_ONLN | ||
104 | GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP | ||
105 | GLIBCXX_CHECK_SYSCTL_HW_NCPU | ||
106 | -GLIBCXX_CHECK_SDT_H | ||
107 | +#GLIBCXX_CHECK_SDT_H | ||
108 | |||
109 | # Check for available headers. | ||
110 | AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0014-libtool.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0014-libtool.patch deleted file mode 100644 index f4e70c3b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0014-libtool.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 6ecd478881468934444ff85611fd43f7033b1e81 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:29:11 +0400 | ||
4 | Subject: [PATCH] libtool | ||
5 | |||
6 | libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64 | ||
7 | when running on am x86_64 build host. | ||
8 | |||
9 | This patch stops this speading to libdir in the libstdc++.la file within libtool. | ||
10 | Arguably, it shouldn't be passing this into libtool in the first place but | ||
11 | for now this resolves the nastiest problems this causes. | ||
12 | |||
13 | func_normal_abspath would resolve an empty path to `pwd` so we need | ||
14 | to filter the zero case. | ||
15 | |||
16 | RP 2012/8/24 | ||
17 | |||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | |||
20 | Upstream-Status: Pending | ||
21 | --- | ||
22 | ltmain.sh | 4 ++++ | ||
23 | 1 file changed, 4 insertions(+) | ||
24 | |||
25 | diff --git a/ltmain.sh b/ltmain.sh | ||
26 | index 70990740b6c..ee938056bef 100644 | ||
27 | --- a/ltmain.sh | ||
28 | +++ b/ltmain.sh | ||
29 | @@ -6359,6 +6359,10 @@ func_mode_link () | ||
30 | func_warning "ignoring multiple \`-rpath's for a libtool library" | ||
31 | |||
32 | install_libdir="$1" | ||
33 | + if test -n "$install_libdir"; then | ||
34 | + func_normal_abspath "$install_libdir" | ||
35 | + install_libdir=$func_normal_abspath_result | ||
36 | + fi | ||
37 | |||
38 | oldlibs= | ||
39 | if test -z "$rpath"; then | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch deleted file mode 100644 index bc2674ab..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | From de4427fa49c07dc651ee6ceaf5c5078700ca3b08 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:30:32 +0400 | ||
4 | Subject: [PATCH] gcc: armv4: pass fix-v4bx to linker to support EABI. | ||
5 | |||
6 | The LINK_SPEC for linux gets overwritten by linux-eabi.h which | ||
7 | means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result | ||
8 | the option is not passed to linker when chosing march=armv4 | ||
9 | This patch redefines this in linux-eabi.h and reinserts it | ||
10 | for eabi defaulting toolchains. | ||
11 | |||
12 | We might want to send it upstream. | ||
13 | |||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | --- | ||
18 | gcc/config/arm/linux-eabi.h | 6 +++++- | ||
19 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h | ||
22 | index 0c0332f317f..7b3769e8459 100644 | ||
23 | --- a/gcc/config/arm/linux-eabi.h | ||
24 | +++ b/gcc/config/arm/linux-eabi.h | ||
25 | @@ -91,10 +91,14 @@ | ||
26 | #define MUSL_DYNAMIC_LINKER \ | ||
27 | "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" | ||
28 | |||
29 | +/* For armv4 we pass --fix-v4bx to linker to support EABI */ | ||
30 | +#undef TARGET_FIX_V4BX_SPEC | ||
31 | +#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}" | ||
32 | + | ||
33 | /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to | ||
34 | use the GNU/Linux version, not the generic BPABI version. */ | ||
35 | #undef LINK_SPEC | ||
36 | -#define LINK_SPEC EABI_LINK_SPEC \ | ||
37 | +#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \ | ||
38 | LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ | ||
39 | LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) | ||
40 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch deleted file mode 100644 index 1dc4bb85..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | From 6b363c2c1c089ee900efa6013aefba1003840a37 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 29 Mar 2013 09:33:04 +0400 | ||
4 | Subject: [PATCH] Use the multilib config files from ${B} instead of using the | ||
5 | ones from ${S} | ||
6 | |||
7 | Use the multilib config files from ${B} instead of using the ones from ${S} | ||
8 | so that the source can be shared between gcc-cross-initial, | ||
9 | gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | Signed-off-by: Constantin Musca <constantinx.musca@intel.com> | ||
13 | |||
14 | Upstream-Status: Inappropriate [configuration] | ||
15 | --- | ||
16 | gcc/configure | 22 ++++++++++++++++++---- | ||
17 | gcc/configure.ac | 22 ++++++++++++++++++---- | ||
18 | 2 files changed, 36 insertions(+), 8 deletions(-) | ||
19 | |||
20 | diff --git a/gcc/configure b/gcc/configure | ||
21 | index 6080f86145e..825a9652329 100755 | ||
22 | --- a/gcc/configure | ||
23 | +++ b/gcc/configure | ||
24 | @@ -12685,10 +12685,20 @@ done | ||
25 | tmake_file_= | ||
26 | for f in ${tmake_file} | ||
27 | do | ||
28 | - if test -f ${srcdir}/config/$f | ||
29 | - then | ||
30 | - tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | ||
31 | - fi | ||
32 | + case $f in | ||
33 | + */t-linux64 ) | ||
34 | + if test -f ./config/$f | ||
35 | + then | ||
36 | + tmake_file_="${tmake_file_} ./config/$f" | ||
37 | + fi | ||
38 | + ;; | ||
39 | + * ) | ||
40 | + if test -f ${srcdir}/config/$f | ||
41 | + then | ||
42 | + tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | ||
43 | + fi | ||
44 | + ;; | ||
45 | + esac | ||
46 | done | ||
47 | tmake_file="${tmake_file_}${omp_device_property_tmake_file}" | ||
48 | |||
49 | @@ -12699,6 +12709,10 @@ tm_file_list="options.h" | ||
50 | tm_include_list="options.h insn-constants.h" | ||
51 | for f in $tm_file; do | ||
52 | case $f in | ||
53 | + */linux64.h ) | ||
54 | + tm_file_list="${tm_file_list} ./config/$f" | ||
55 | + tm_include_list="${tm_include_list} ./config/$f" | ||
56 | + ;; | ||
57 | ./* ) | ||
58 | f=`echo $f | sed 's/^..//'` | ||
59 | tm_file_list="${tm_file_list} $f" | ||
60 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
61 | index 42be5252778..6099eb3251f 100644 | ||
62 | --- a/gcc/configure.ac | ||
63 | +++ b/gcc/configure.ac | ||
64 | @@ -2118,10 +2118,20 @@ done | ||
65 | tmake_file_= | ||
66 | for f in ${tmake_file} | ||
67 | do | ||
68 | - if test -f ${srcdir}/config/$f | ||
69 | - then | ||
70 | - tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | ||
71 | - fi | ||
72 | + case $f in | ||
73 | + */t-linux64 ) | ||
74 | + if test -f ./config/$f | ||
75 | + then | ||
76 | + tmake_file_="${tmake_file_} ./config/$f" | ||
77 | + fi | ||
78 | + ;; | ||
79 | + * ) | ||
80 | + if test -f ${srcdir}/config/$f | ||
81 | + then | ||
82 | + tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | ||
83 | + fi | ||
84 | + ;; | ||
85 | + esac | ||
86 | done | ||
87 | tmake_file="${tmake_file_}${omp_device_property_tmake_file}" | ||
88 | |||
89 | @@ -2132,6 +2142,10 @@ tm_file_list="options.h" | ||
90 | tm_include_list="options.h insn-constants.h" | ||
91 | for f in $tm_file; do | ||
92 | case $f in | ||
93 | + */linux64.h ) | ||
94 | + tm_file_list="${tm_file_list} ./config/$f" | ||
95 | + tm_include_list="${tm_include_list} ./config/$f" | ||
96 | + ;; | ||
97 | ./* ) | ||
98 | f=`echo $f | sed 's/^..//'` | ||
99 | tm_file_list="${tm_file_list} $f" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch deleted file mode 100644 index 05f12847..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | From 08752c2f1d21553301bee5757c453c6a36cbe03c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 20 Feb 2015 09:39:38 +0000 | ||
4 | Subject: [PATCH] Avoid using libdir from .la which usually points to a host | ||
5 | path | ||
6 | |||
7 | Upstream-Status: Inappropriate [embedded specific] | ||
8 | |||
9 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | ltmain.sh | 3 +++ | ||
13 | 1 file changed, 3 insertions(+) | ||
14 | |||
15 | diff --git a/ltmain.sh b/ltmain.sh | ||
16 | index ee938056bef..9ebc7e3d1e0 100644 | ||
17 | --- a/ltmain.sh | ||
18 | +++ b/ltmain.sh | ||
19 | @@ -5628,6 +5628,9 @@ func_mode_link () | ||
20 | absdir="$abs_ladir" | ||
21 | libdir="$abs_ladir" | ||
22 | else | ||
23 | + # Instead of using libdir from .la which usually points to a host path, | ||
24 | + # use the path the .la is contained in. | ||
25 | + libdir="$abs_ladir" | ||
26 | dir="$libdir" | ||
27 | absdir="$libdir" | ||
28 | fi | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0018-export-CPP.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0018-export-CPP.patch deleted file mode 100644 index 886a1221..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0018-export-CPP.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From 5c3d66378c7ff60ca11a875aa4aa6f8a8529d43a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 20 Feb 2015 09:40:59 +0000 | ||
4 | Subject: [PATCH] export CPP | ||
5 | |||
6 | The OE environment sets and exports CPP as being the target gcc. When | ||
7 | building gcc-cross-canadian for a mingw targetted sdk, the following can be found | ||
8 | in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log: | ||
9 | |||
10 | configure:3641: checking for _FILE_OFFSET_BITS value needed for large files | ||
11 | configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5 | ||
12 | configure:3666: $? = 0 | ||
13 | configure:3698: result: no | ||
14 | configure:3786: checking how to run the C preprocessor | ||
15 | configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 | ||
16 | configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c | ||
17 | configure:3876: $? = 0 | ||
18 | |||
19 | Note this is a *build* target (in build-x86_64-linux) so it should be | ||
20 | using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 | ||
21 | headers are very different, using the wrong cpp is a real problem. It is leaking | ||
22 | into configure through the CPP variable. Ultimately this leads to build | ||
23 | failures related to not being able to include a process.h file for pem-unix.c. | ||
24 | |||
25 | The fix is to ensure we export a sane CPP value into the build | ||
26 | environment when using build targets. We could define a CPP_FOR_BUILD value which may be | ||
27 | the version which needs to be upstreamed but for now, this fix is good enough to | ||
28 | avoid the problem. | ||
29 | |||
30 | RP 22/08/2013 | ||
31 | |||
32 | Upstream-Status: Pending | ||
33 | |||
34 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
35 | --- | ||
36 | Makefile.in | 1 + | ||
37 | 1 file changed, 1 insertion(+) | ||
38 | |||
39 | diff --git a/Makefile.in b/Makefile.in | ||
40 | index 36e369df6e7..c717903bb13 100644 | ||
41 | --- a/Makefile.in | ||
42 | +++ b/Makefile.in | ||
43 | @@ -149,6 +149,7 @@ BUILD_EXPORTS = \ | ||
44 | AR="$(AR_FOR_BUILD)"; export AR; \ | ||
45 | AS="$(AS_FOR_BUILD)"; export AS; \ | ||
46 | CC="$(CC_FOR_BUILD)"; export CC; \ | ||
47 | + CPP="$(CC_FOR_BUILD) -E"; export CPP; \ | ||
48 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
49 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
50 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch deleted file mode 100644 index 2797b2c2..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From 378b752c5d9a3dba4e58cdadf8b4b4f34ea99a76 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 20 Feb 2015 10:25:11 +0000 | ||
4 | Subject: [PATCH] Ensure target gcc headers can be included | ||
5 | |||
6 | There are a few headers installed as part of the OpenEmbedded | ||
7 | gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe | ||
8 | built for the target architecture, these are within the target | ||
9 | sysroot and not cross/nativesdk; thus they weren't able to be | ||
10 | found by gcc with the existing search paths. Add support for | ||
11 | picking up these headers under the sysroot supplied on the gcc | ||
12 | command line in order to resolve this. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | gcc/Makefile.in | 2 ++ | ||
20 | gcc/cppdefault.c | 4 ++++ | ||
21 | 2 files changed, 6 insertions(+) | ||
22 | |||
23 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
24 | index 480c9366418..011c7ac2db6 100644 | ||
25 | --- a/gcc/Makefile.in | ||
26 | +++ b/gcc/Makefile.in | ||
27 | @@ -618,6 +618,7 @@ libexecdir = @libexecdir@ | ||
28 | |||
29 | # Directory in which the compiler finds libraries etc. | ||
30 | libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) | ||
31 | +libsubdir_target = $(target_noncanonical)/$(version) | ||
32 | # Directory in which the compiler finds executables | ||
33 | libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) | ||
34 | # Directory in which all plugin resources are installed | ||
35 | @@ -2946,6 +2947,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\" | ||
36 | |||
37 | PREPROCESSOR_DEFINES = \ | ||
38 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | ||
39 | + -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \ | ||
40 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ | ||
41 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ | ||
42 | -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ | ||
43 | diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c | ||
44 | index af38cc494ea..2f43b88a0c3 100644 | ||
45 | --- a/gcc/cppdefault.c | ||
46 | +++ b/gcc/cppdefault.c | ||
47 | @@ -59,6 +59,10 @@ const struct default_include cpp_include_defaults[] | ||
48 | /* This is the dir for gcc's private headers. */ | ||
49 | { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, | ||
50 | #endif | ||
51 | +#ifdef GCC_INCLUDE_SUBDIR_TARGET | ||
52 | + /* This is the dir for gcc's private headers under the specified sysroot. */ | ||
53 | + { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 }, | ||
54 | +#endif | ||
55 | #ifdef LOCAL_INCLUDE_DIR | ||
56 | /* /usr/local/include comes before the fixincluded header files. */ | ||
57 | { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch deleted file mode 100644 index c3baf8b4..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From 870e805d705d99d9b9d7dbd09727f9c1d2ad9c1d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 3 Mar 2015 08:21:19 +0000 | ||
4 | Subject: [PATCH] Don't search host directory during "relink" if $inst_prefix | ||
5 | is provided | ||
6 | |||
7 | http://lists.gnu.org/archive/html/libtool-patches/2011-01/msg00026.html | ||
8 | |||
9 | Upstream-Status: Submitted | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | ltmain.sh | 5 +++-- | ||
14 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/ltmain.sh b/ltmain.sh | ||
17 | index 9ebc7e3d1e0..7ea79fa8be6 100644 | ||
18 | --- a/ltmain.sh | ||
19 | +++ b/ltmain.sh | ||
20 | @@ -6004,12 +6004,13 @@ func_mode_link () | ||
21 | fi | ||
22 | else | ||
23 | # We cannot seem to hardcode it, guess we'll fake it. | ||
24 | + # Default if $libdir is not relative to the prefix: | ||
25 | add_dir="-L$libdir" | ||
26 | - # Try looking first in the location we're being installed to. | ||
27 | + | ||
28 | if test -n "$inst_prefix_dir"; then | ||
29 | case $libdir in | ||
30 | [\\/]*) | ||
31 | - add_dir="$add_dir -L$inst_prefix_dir$libdir" | ||
32 | + add_dir="-L$inst_prefix_dir$libdir" | ||
33 | ;; | ||
34 | esac | ||
35 | fi | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0021-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0021-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch deleted file mode 100644 index abee4866..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0021-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From aba42de763a619355471efd1573561b0cbf51162 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 28 Apr 2015 23:15:27 -0700 | ||
4 | Subject: [PATCH] Use SYSTEMLIBS_DIR replacement instead of hardcoding | ||
5 | base_libdir | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | gcc/config/aarch64/aarch64-linux.h | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h | ||
15 | index e587e2e9ad6..ddc62895693 100644 | ||
16 | --- a/gcc/config/aarch64/aarch64-linux.h | ||
17 | +++ b/gcc/config/aarch64/aarch64-linux.h | ||
18 | @@ -21,7 +21,7 @@ | ||
19 | #ifndef GCC_AARCH64_LINUX_H | ||
20 | #define GCC_AARCH64_LINUX_H | ||
21 | |||
22 | -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
23 | +#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
24 | |||
25 | #undef MUSL_DYNAMIC_LINKER | ||
26 | #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0022-aarch64-Add-support-for-musl-ldso.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0022-aarch64-Add-support-for-musl-ldso.patch deleted file mode 100644 index c55b66d4..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0022-aarch64-Add-support-for-musl-ldso.patch +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | From d63820a78d92f302410358293546f01c7ad17bd8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 28 Apr 2015 23:18:39 -0700 | ||
4 | Subject: [PATCH] aarch64: Add support for musl ldso | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | gcc/config/aarch64/aarch64-linux.h | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h | ||
14 | index ddc62895693..b301825313a 100644 | ||
15 | --- a/gcc/config/aarch64/aarch64-linux.h | ||
16 | +++ b/gcc/config/aarch64/aarch64-linux.h | ||
17 | @@ -24,7 +24,7 @@ | ||
18 | #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
19 | |||
20 | #undef MUSL_DYNAMIC_LINKER | ||
21 | -#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
22 | +#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" | ||
23 | |||
24 | #undef ASAN_CC1_SPEC | ||
25 | #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch deleted file mode 100644 index 80c4d229..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | From 3474e16ad4ea8cf4e0e330568e3bc9039e723dce Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Sun, 5 Jul 2015 20:25:18 -0700 | ||
4 | Subject: [PATCH] libcc1: fix libcc1's install path and rpath | ||
5 | |||
6 | * Install libcc1.so and libcc1plugin.so into | ||
7 | $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version), as what we | ||
8 | had done to lto-plugin. | ||
9 | * Fix bad RPATH iussue: | ||
10 | gcc-5.2.0: package gcc-plugins contains bad RPATH /patht/to/tmp/sysroots/qemux86-64/usr/lib64/../lib64 in file | ||
11 | /path/to/gcc/5.2.0-r0/packages-split/gcc-plugins/usr/lib64/gcc/x86_64-poky-linux/5.2.0/plugin/libcc1plugin.so.0.0.0 | ||
12 | [rpaths] | ||
13 | |||
14 | Upstream-Status: Inappropriate [OE configuration] | ||
15 | |||
16 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
17 | --- | ||
18 | libcc1/Makefile.am | 4 ++-- | ||
19 | libcc1/Makefile.in | 4 ++-- | ||
20 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am | ||
23 | index c005b0dad4a..ec31d35b7b9 100644 | ||
24 | --- a/libcc1/Makefile.am | ||
25 | +++ b/libcc1/Makefile.am | ||
26 | @@ -37,8 +37,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ | ||
27 | $(Wc)$(libiberty_normal))) | ||
28 | libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty)) | ||
29 | |||
30 | -plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin | ||
31 | -cc1libdir = $(libdir)/$(libsuffix) | ||
32 | +cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) | ||
33 | +plugindir = $(cc1libdir) | ||
34 | |||
35 | if ENABLE_PLUGIN | ||
36 | plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la | ||
37 | diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in | ||
38 | index 7104b649026..2103c477468 100644 | ||
39 | --- a/libcc1/Makefile.in | ||
40 | +++ b/libcc1/Makefile.in | ||
41 | @@ -393,8 +393,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ | ||
42 | $(Wc)$(libiberty_normal))) | ||
43 | |||
44 | libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty)) | ||
45 | -plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin | ||
46 | -cc1libdir = $(libdir)/$(libsuffix) | ||
47 | +cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) | ||
48 | +plugindir = $(cc1libdir) | ||
49 | @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la | ||
50 | @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la | ||
51 | shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch deleted file mode 100644 index 1a65ece7..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch +++ /dev/null | |||
@@ -1,346 +0,0 @@ | |||
1 | From bb1f359e34649516e61305e9748534cce7e0ee70 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 7 Dec 2015 23:39:54 +0000 | ||
4 | Subject: [PATCH] handle sysroot support for nativesdk-gcc | ||
5 | |||
6 | Being able to build a nativesdk gcc is useful, particularly in cases | ||
7 | where the host compiler may be of an incompatible version (or a 32 | ||
8 | bit compiler is needed). | ||
9 | |||
10 | Sadly, building nativesdk-gcc is not straight forward. We install | ||
11 | nativesdk-gcc into a relocatable location and this means that its | ||
12 | library locations can change. "Normal" sysroot support doesn't help | ||
13 | in this case since the values of paths like "libdir" change, not just | ||
14 | base root directory of the system. | ||
15 | |||
16 | In order to handle this we do two things: | ||
17 | |||
18 | a) Add %r into spec file markup which can be used for injected paths | ||
19 | such as SYSTEMLIBS_DIR (see gcc_multilib_setup()). | ||
20 | b) Add other paths which need relocation into a .gccrelocprefix section | ||
21 | which the relocation code will notice and adjust automatically. | ||
22 | |||
23 | Upstream-Status: Inappropriate | ||
24 | RP 2015/7/28 | ||
25 | |||
26 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
27 | |||
28 | Added PREFIXVAR and EXEC_PREFIXVAR to support runtime relocation. Without | ||
29 | these as part of the gccrelocprefix the system can't do runtime relocation | ||
30 | if the executable is moved. (These paths were missed in the original | ||
31 | implementation.) | ||
32 | |||
33 | Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> | ||
34 | --- | ||
35 | gcc/c-family/c-opts.c | 4 +-- | ||
36 | gcc/cppdefault.c | 63 ++++++++++++++++++++++++++----------------- | ||
37 | gcc/cppdefault.h | 13 ++++----- | ||
38 | gcc/gcc.c | 20 +++++++++----- | ||
39 | gcc/incpath.c | 12 ++++----- | ||
40 | gcc/prefix.c | 6 +++-- | ||
41 | 6 files changed, 70 insertions(+), 48 deletions(-) | ||
42 | |||
43 | diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c | ||
44 | index 58ba0948e79..806bbcfb7a5 100644 | ||
45 | --- a/gcc/c-family/c-opts.c | ||
46 | +++ b/gcc/c-family/c-opts.c | ||
47 | @@ -1409,8 +1409,8 @@ add_prefixed_path (const char *suffix, incpath_kind chain) | ||
48 | size_t prefix_len, suffix_len; | ||
49 | |||
50 | suffix_len = strlen (suffix); | ||
51 | - prefix = iprefix ? iprefix : cpp_GCC_INCLUDE_DIR; | ||
52 | - prefix_len = iprefix ? strlen (iprefix) : cpp_GCC_INCLUDE_DIR_len; | ||
53 | + prefix = iprefix ? iprefix : GCC_INCLUDE_DIRVAR; | ||
54 | + prefix_len = iprefix ? strlen (iprefix) : strlen(GCC_INCLUDE_DIRVAR) - 7; | ||
55 | |||
56 | path = (char *) xmalloc (prefix_len + suffix_len + 1); | ||
57 | memcpy (path, prefix, prefix_len); | ||
58 | diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c | ||
59 | index 2f43b88a0c3..6b6be04686c 100644 | ||
60 | --- a/gcc/cppdefault.c | ||
61 | +++ b/gcc/cppdefault.c | ||
62 | @@ -35,6 +35,30 @@ | ||
63 | # undef CROSS_INCLUDE_DIR | ||
64 | #endif | ||
65 | |||
66 | +static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR; | ||
67 | +char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR; | ||
68 | +static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR; | ||
69 | +static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR; | ||
70 | +static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET; | ||
71 | +#ifdef LOCAL_INCLUDE_DIR | ||
72 | +static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR; | ||
73 | +#endif | ||
74 | +#ifdef PREFIX_INCLUDE_DIR | ||
75 | +static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR; | ||
76 | +#endif | ||
77 | +#ifdef FIXED_INCLUDE_DIR | ||
78 | +static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR; | ||
79 | +#endif | ||
80 | +#ifdef CROSS_INCLUDE_DIR | ||
81 | +static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR; | ||
82 | +#endif | ||
83 | +#ifdef TOOL_INCLUDE_DIR | ||
84 | +static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR; | ||
85 | +#endif | ||
86 | +#ifdef NATIVE_SYSTEM_HEADER_DIR | ||
87 | +static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR; | ||
88 | +#endif | ||
89 | + | ||
90 | const struct default_include cpp_include_defaults[] | ||
91 | #ifdef INCLUDE_DEFAULTS | ||
92 | = INCLUDE_DEFAULTS; | ||
93 | @@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[] | ||
94 | = { | ||
95 | #ifdef GPLUSPLUS_INCLUDE_DIR | ||
96 | /* Pick up GNU C++ generic include files. */ | ||
97 | - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, | ||
98 | + { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1, | ||
99 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
100 | #endif | ||
101 | #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR | ||
102 | /* Pick up GNU C++ target-dependent include files. */ | ||
103 | - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, | ||
104 | + { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1, | ||
105 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, | ||
106 | #endif | ||
107 | #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR | ||
108 | /* Pick up GNU C++ backward and deprecated include files. */ | ||
109 | - { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, | ||
110 | + { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1, | ||
111 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | ||
112 | #endif | ||
113 | #ifdef GCC_INCLUDE_DIR | ||
114 | /* This is the dir for gcc's private headers. */ | ||
115 | - { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, | ||
116 | + { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 }, | ||
117 | #endif | ||
118 | #ifdef GCC_INCLUDE_SUBDIR_TARGET | ||
119 | /* This is the dir for gcc's private headers under the specified sysroot. */ | ||
120 | - { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 }, | ||
121 | + { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 }, | ||
122 | #endif | ||
123 | #ifdef LOCAL_INCLUDE_DIR | ||
124 | /* /usr/local/include comes before the fixincluded header files. */ | ||
125 | - { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, | ||
126 | - { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, | ||
127 | + { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 }, | ||
128 | + { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 }, | ||
129 | #endif | ||
130 | #ifdef PREFIX_INCLUDE_DIR | ||
131 | - { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 }, | ||
132 | + { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 }, | ||
133 | #endif | ||
134 | #ifdef FIXED_INCLUDE_DIR | ||
135 | /* This is the dir for fixincludes. */ | ||
136 | - { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, | ||
137 | + { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0, | ||
138 | /* A multilib suffix needs adding if different multilibs use | ||
139 | different headers. */ | ||
140 | #ifdef SYSROOT_HEADERS_SUFFIX_SPEC | ||
141 | @@ -85,33 +109,24 @@ const struct default_include cpp_include_defaults[] | ||
142 | #endif | ||
143 | #ifdef CROSS_INCLUDE_DIR | ||
144 | /* One place the target system's headers might be. */ | ||
145 | - { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, | ||
146 | + { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 }, | ||
147 | #endif | ||
148 | #ifdef TOOL_INCLUDE_DIR | ||
149 | /* Another place the target system's headers might be. */ | ||
150 | - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, | ||
151 | + { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 }, | ||
152 | #endif | ||
153 | #ifdef NATIVE_SYSTEM_HEADER_DIR | ||
154 | /* /usr/include comes dead last. */ | ||
155 | - { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 }, | ||
156 | - { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, | ||
157 | + { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 }, | ||
158 | + { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, | ||
159 | #endif | ||
160 | { 0, 0, 0, 0, 0, 0 } | ||
161 | }; | ||
162 | #endif /* no INCLUDE_DEFAULTS */ | ||
163 | |||
164 | -#ifdef GCC_INCLUDE_DIR | ||
165 | -const char cpp_GCC_INCLUDE_DIR[] = GCC_INCLUDE_DIR; | ||
166 | -const size_t cpp_GCC_INCLUDE_DIR_len = sizeof GCC_INCLUDE_DIR - 8; | ||
167 | -#else | ||
168 | -const char cpp_GCC_INCLUDE_DIR[] = ""; | ||
169 | -const size_t cpp_GCC_INCLUDE_DIR_len = 0; | ||
170 | -#endif | ||
171 | - | ||
172 | /* The configured prefix. */ | ||
173 | -const char cpp_PREFIX[] = PREFIX; | ||
174 | -const size_t cpp_PREFIX_len = sizeof PREFIX - 1; | ||
175 | -const char cpp_EXEC_PREFIX[] = STANDARD_EXEC_PREFIX; | ||
176 | +char PREFIXVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX; | ||
177 | +char EXEC_PREFIXVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX; | ||
178 | |||
179 | /* This value is set by cpp_relocated at runtime */ | ||
180 | const char *gcc_exec_prefix; | ||
181 | diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h | ||
182 | index a681264f75e..5e10a2fa140 100644 | ||
183 | --- a/gcc/cppdefault.h | ||
184 | +++ b/gcc/cppdefault.h | ||
185 | @@ -33,7 +33,8 @@ | ||
186 | |||
187 | struct default_include | ||
188 | { | ||
189 | - const char *const fname; /* The name of the directory. */ | ||
190 | + const char *fname; /* The name of the directory. */ | ||
191 | + | ||
192 | const char *const component; /* The component containing the directory | ||
193 | (see update_path in prefix.c) */ | ||
194 | const char cplusplus; /* Only look here if we're compiling C++. */ | ||
195 | @@ -50,17 +51,13 @@ struct default_include | ||
196 | }; | ||
197 | |||
198 | extern const struct default_include cpp_include_defaults[]; | ||
199 | -extern const char cpp_GCC_INCLUDE_DIR[]; | ||
200 | -extern const size_t cpp_GCC_INCLUDE_DIR_len; | ||
201 | +extern char GCC_INCLUDE_DIRVAR[] __attribute__ ((section (".gccrelocprefix"))); | ||
202 | |||
203 | /* The configure-time prefix, i.e., the value supplied as the argument | ||
204 | to --prefix=. */ | ||
205 | -extern const char cpp_PREFIX[]; | ||
206 | +extern char PREFIXVAR[] __attribute__ ((section (".gccrelocprefix"))); | ||
207 | /* The length of the configure-time prefix. */ | ||
208 | -extern const size_t cpp_PREFIX_len; | ||
209 | -/* The configure-time execution prefix. This is typically the lib/gcc | ||
210 | - subdirectory of cpp_PREFIX. */ | ||
211 | -extern const char cpp_EXEC_PREFIX[]; | ||
212 | +extern char EXEC_PREFIXVAR[] __attribute__ ((section (".gccrelocprefix"))); | ||
213 | /* The run-time execution prefix. This is typically the lib/gcc | ||
214 | subdirectory of the actual installation. */ | ||
215 | extern const char *gcc_exec_prefix; | ||
216 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
217 | index c87f603955f..535d5c3bb65 100644 | ||
218 | --- a/gcc/gcc.c | ||
219 | +++ b/gcc/gcc.c | ||
220 | @@ -252,6 +252,8 @@ FILE *report_times_to_file = NULL; | ||
221 | #endif | ||
222 | static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT; | ||
223 | |||
224 | +static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR; | ||
225 | + | ||
226 | /* Nonzero means pass the updated target_system_root to the compiler. */ | ||
227 | |||
228 | static int target_system_root_changed; | ||
229 | @@ -526,6 +528,7 @@ or with constant text in a single argument. | ||
230 | %G process LIBGCC_SPEC as a spec. | ||
231 | %R Output the concatenation of target_system_root and | ||
232 | target_sysroot_suffix. | ||
233 | + %r Output the base path target_relocatable_prefix | ||
234 | %S process STARTFILE_SPEC as a spec. A capital S is actually used here. | ||
235 | %E process ENDFILE_SPEC as a spec. A capital E is actually used here. | ||
236 | %C process CPP_SPEC as a spec. | ||
237 | @@ -1499,10 +1502,10 @@ static const char *gcc_libexec_prefix; | ||
238 | gcc_exec_prefix is set because, in that case, we know where the | ||
239 | compiler has been installed, and use paths relative to that | ||
240 | location instead. */ | ||
241 | -static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX; | ||
242 | -static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX; | ||
243 | -static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX; | ||
244 | -static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; | ||
245 | +static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX; | ||
246 | +static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX; | ||
247 | +static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX; | ||
248 | +static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; | ||
249 | |||
250 | /* For native compilers, these are well-known paths containing | ||
251 | components that may be provided by the system. For cross | ||
252 | @@ -1510,9 +1513,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; | ||
253 | static const char *md_exec_prefix = MD_EXEC_PREFIX; | ||
254 | static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; | ||
255 | static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; | ||
256 | -static const char *const standard_startfile_prefix_1 | ||
257 | +static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix"))) | ||
258 | = STANDARD_STARTFILE_PREFIX_1; | ||
259 | -static const char *const standard_startfile_prefix_2 | ||
260 | +static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix"))) | ||
261 | = STANDARD_STARTFILE_PREFIX_2; | ||
262 | |||
263 | /* A relative path to be used in finding the location of tools | ||
264 | @@ -5952,6 +5955,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) | ||
265 | } | ||
266 | break; | ||
267 | |||
268 | + case 'r': | ||
269 | + obstack_grow (&obstack, target_relocatable_prefix, | ||
270 | + strlen (target_relocatable_prefix)); | ||
271 | + break; | ||
272 | + | ||
273 | case 'S': | ||
274 | value = do_spec_1 (startfile_spec, 0, NULL); | ||
275 | if (value != 0) | ||
276 | diff --git a/gcc/incpath.c b/gcc/incpath.c | ||
277 | index 9098ab044ab..bfad4ebe382 100644 | ||
278 | --- a/gcc/incpath.c | ||
279 | +++ b/gcc/incpath.c | ||
280 | @@ -131,7 +131,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, | ||
281 | int relocated = cpp_relocated (); | ||
282 | size_t len; | ||
283 | |||
284 | - if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0) | ||
285 | + if (iprefix && (len = strlen(GCC_INCLUDE_DIRVAR) - 7) != 0) | ||
286 | { | ||
287 | /* Look for directories that start with the standard prefix. | ||
288 | "Translate" them, i.e. replace /usr/local/lib/gcc... with | ||
289 | @@ -145,7 +145,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, | ||
290 | now. */ | ||
291 | if (sysroot && p->add_sysroot) | ||
292 | continue; | ||
293 | - if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len)) | ||
294 | + if (!filename_ncmp (p->fname, GCC_INCLUDE_DIRVAR, len)) | ||
295 | { | ||
296 | char *str = concat (iprefix, p->fname + len, NULL); | ||
297 | if (p->multilib == 1 && imultilib) | ||
298 | @@ -185,7 +185,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, | ||
299 | free (sysroot_no_trailing_dir_separator); | ||
300 | } | ||
301 | else if (!p->add_sysroot && relocated | ||
302 | - && !filename_ncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len)) | ||
303 | + && !filename_ncmp (p->fname, PREFIXVAR, strlen(PREFIXVAR))) | ||
304 | { | ||
305 | static const char *relocated_prefix; | ||
306 | char *ostr; | ||
307 | @@ -202,12 +202,12 @@ add_standard_paths (const char *sysroot, const char *iprefix, | ||
308 | dummy = concat (gcc_exec_prefix, "dummy", NULL); | ||
309 | relocated_prefix | ||
310 | = make_relative_prefix (dummy, | ||
311 | - cpp_EXEC_PREFIX, | ||
312 | - cpp_PREFIX); | ||
313 | + EXEC_PREFIXVAR, | ||
314 | + PREFIXVAR); | ||
315 | free (dummy); | ||
316 | } | ||
317 | ostr = concat (relocated_prefix, | ||
318 | - p->fname + cpp_PREFIX_len, | ||
319 | + p->fname + strlen(PREFIXVAR), | ||
320 | NULL); | ||
321 | str = update_path (ostr, p->component); | ||
322 | free (ostr); | ||
323 | diff --git a/gcc/prefix.c b/gcc/prefix.c | ||
324 | index 1a403e535bd..3257ed3cd3e 100644 | ||
325 | --- a/gcc/prefix.c | ||
326 | +++ b/gcc/prefix.c | ||
327 | @@ -72,7 +72,9 @@ License along with GCC; see the file COPYING3. If not see | ||
328 | #include "prefix.h" | ||
329 | #include "common/common-target.h" | ||
330 | |||
331 | -static const char *std_prefix = PREFIX; | ||
332 | +static const char PREFIXVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX; | ||
333 | + | ||
334 | +static const char *std_prefix = PREFIXVAR; | ||
335 | |||
336 | static const char *get_key_value (char *); | ||
337 | static char *translate_name (char *); | ||
338 | @@ -212,7 +214,7 @@ translate_name (char *name) | ||
339 | prefix = getenv (key); | ||
340 | |||
341 | if (prefix == 0) | ||
342 | - prefix = PREFIX; | ||
343 | + prefix = PREFIXVAR; | ||
344 | |||
345 | /* We used to strip trailing DIR_SEPARATORs here, but that can | ||
346 | sometimes yield a result with no separator when one was coded | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch deleted file mode 100644 index abf1f849..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | From 9c0c73ee48dbee2aad57f4dcdad1b7b74e77b944 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 7 Dec 2015 23:41:45 +0000 | ||
4 | Subject: [PATCH] Search target sysroot gcc version specific dirs with | ||
5 | multilib. | ||
6 | |||
7 | We install the gcc libraries (such as crtbegin.p) into | ||
8 | <sysroot><libdir>/<target-sys>/5.2.0/ | ||
9 | which is a default search path for GCC (aka multi_suffix in the | ||
10 | code below). <target-sys> is 'machine' in gcc's terminology. We use | ||
11 | these directories so that multiple gcc versions could in theory | ||
12 | co-exist on target. | ||
13 | |||
14 | We only want to build one gcc-cross-canadian per arch and have this work | ||
15 | for all multilibs. <target-sys> can be handled by mapping the multilib | ||
16 | <target-sys> to the one used by gcc-cross-canadian, e.g. | ||
17 | mips64-polkmllib32-linux | ||
18 | is symlinked to by mips64-poky-linux. | ||
19 | |||
20 | The default gcc search path in the target sysroot for a "lib64" mutlilib | ||
21 | is: | ||
22 | |||
23 | <sysroot>/lib32/mips64-poky-linux/5.2.0/ | ||
24 | <sysroot>/lib32/../lib64/ | ||
25 | <sysroot>/usr/lib32/mips64-poky-linux/5.2.0/ | ||
26 | <sysroot>/usr/lib32/../lib64/ | ||
27 | <sysroot>/lib32/ | ||
28 | <sysroot>/usr/lib32/ | ||
29 | |||
30 | which means that the lib32 crtbegin.o will be found and the lib64 ones | ||
31 | will not which leads to compiler failures. | ||
32 | |||
33 | This patch injects a multilib version of that path first so the lib64 | ||
34 | binaries can be found first. With this change the search path becomes: | ||
35 | |||
36 | <sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/ | ||
37 | <sysroot>/lib32/mips64-poky-linux/5.2.0/ | ||
38 | <sysroot>/lib32/../lib64/ | ||
39 | <sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/ | ||
40 | <sysroot>/usr/lib32/mips64-poky-linux/5.2.0/ | ||
41 | <sysroot>/usr/lib32/../lib64/ | ||
42 | <sysroot>/lib32/ | ||
43 | <sysroot>/usr/lib32/ | ||
44 | |||
45 | Upstream-Status: Pending | ||
46 | RP 2015/7/31 | ||
47 | |||
48 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
49 | --- | ||
50 | gcc/gcc.c | 29 ++++++++++++++++++++++++++++- | ||
51 | 1 file changed, 28 insertions(+), 1 deletion(-) | ||
52 | |||
53 | diff --git a/gcc/gcc.c b/gcc/gcc.c | ||
54 | index 535d5c3bb65..04647ae812d 100644 | ||
55 | --- a/gcc/gcc.c | ||
56 | +++ b/gcc/gcc.c | ||
57 | @@ -2616,7 +2616,7 @@ for_each_path (const struct path_prefix *paths, | ||
58 | if (path == NULL) | ||
59 | { | ||
60 | len = paths->max_len + extra_space + 1; | ||
61 | - len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len); | ||
62 | + len += MAX ((suffix_len + multi_os_dir_len), multiarch_len); | ||
63 | path = XNEWVEC (char, len); | ||
64 | } | ||
65 | |||
66 | @@ -2628,6 +2628,33 @@ for_each_path (const struct path_prefix *paths, | ||
67 | /* Look first in MACHINE/VERSION subdirectory. */ | ||
68 | if (!skip_multi_dir) | ||
69 | { | ||
70 | + if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir)) | ||
71 | + { | ||
72 | + const char *this_multi; | ||
73 | + size_t this_multi_len; | ||
74 | + | ||
75 | + if (pl->os_multilib) | ||
76 | + { | ||
77 | + this_multi = multi_os_dir; | ||
78 | + this_multi_len = multi_os_dir_len; | ||
79 | + } | ||
80 | + else | ||
81 | + { | ||
82 | + this_multi = multi_dir; | ||
83 | + this_multi_len = multi_dir_len; | ||
84 | + } | ||
85 | + | ||
86 | + /* Look in multilib MACHINE/VERSION subdirectory first */ | ||
87 | + if (this_multi_len) | ||
88 | + { | ||
89 | + memcpy (path + len, this_multi, this_multi_len + 1); | ||
90 | + memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1); | ||
91 | + ret = callback (path, callback_info); | ||
92 | + if (ret) | ||
93 | + break; | ||
94 | + } | ||
95 | + } | ||
96 | + | ||
97 | memcpy (path + len, multi_suffix, suffix_len + 1); | ||
98 | ret = callback (path, callback_info); | ||
99 | if (ret) | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0026-Fix-various-_FOR_BUILD-and-related-variables.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0026-Fix-various-_FOR_BUILD-and-related-variables.patch deleted file mode 100644 index 97bf2f3a..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0026-Fix-various-_FOR_BUILD-and-related-variables.patch +++ /dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | From 3a003af8804dda90fdf4862eca5f66cb12faaf02 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 7 Dec 2015 23:42:45 +0000 | ||
4 | Subject: [PATCH] Fix various _FOR_BUILD and related variables | ||
5 | |||
6 | When doing a FOR_BUILD thing, you have to override CFLAGS with | ||
7 | CFLAGS_FOR_BUILD. And if you use C++, you also have to override | ||
8 | CXXFLAGS with CXXFLAGS_FOR_BUILD. | ||
9 | Without this, when building for mingw, you end up trying to use | ||
10 | the mingw headers for a host build. | ||
11 | |||
12 | The same goes for other variables as well, such as CPPFLAGS, | ||
13 | CPP, and GMPINC. | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | |||
17 | Signed-off-by: Peter Seebach <peter.seebach@windriver.com> | ||
18 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
20 | --- | ||
21 | Makefile.in | 6 ++++++ | ||
22 | Makefile.tpl | 5 +++++ | ||
23 | gcc/Makefile.in | 2 +- | ||
24 | gcc/configure | 2 +- | ||
25 | gcc/configure.ac | 2 +- | ||
26 | 5 files changed, 14 insertions(+), 3 deletions(-) | ||
27 | |||
28 | diff --git a/Makefile.in b/Makefile.in | ||
29 | index c717903bb13..5abc649868d 100644 | ||
30 | --- a/Makefile.in | ||
31 | +++ b/Makefile.in | ||
32 | @@ -152,6 +152,7 @@ BUILD_EXPORTS = \ | ||
33 | CPP="$(CC_FOR_BUILD) -E"; export CPP; \ | ||
34 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
35 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
36 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
37 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
38 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
39 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
40 | @@ -171,6 +172,9 @@ BUILD_EXPORTS = \ | ||
41 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
42 | EXTRA_BUILD_FLAGS = \ | ||
43 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
44 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
45 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
46 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
47 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
48 | |||
49 | # This is the list of directories to built for the host system. | ||
50 | @@ -188,6 +192,7 @@ HOST_SUBDIR = @host_subdir@ | ||
51 | HOST_EXPORTS = \ | ||
52 | $(BASE_EXPORTS) \ | ||
53 | CC="$(CC)"; export CC; \ | ||
54 | + CPP="$(CC) -E"; export CPP; \ | ||
55 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
56 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
57 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
58 | @@ -776,6 +781,7 @@ BASE_FLAGS_TO_PASS = \ | ||
59 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | ||
60 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | ||
61 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | ||
62 | + "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \ | ||
63 | "EXPECT=$(EXPECT)" \ | ||
64 | "FLEX=$(FLEX)" \ | ||
65 | "INSTALL=$(INSTALL)" \ | ||
66 | diff --git a/Makefile.tpl b/Makefile.tpl | ||
67 | index efed1511750..778beb705b4 100644 | ||
68 | --- a/Makefile.tpl | ||
69 | +++ b/Makefile.tpl | ||
70 | @@ -154,6 +154,7 @@ BUILD_EXPORTS = \ | ||
71 | CC="$(CC_FOR_BUILD)"; export CC; \ | ||
72 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | ||
73 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
74 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \ | ||
75 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | ||
76 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | ||
77 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | ||
78 | @@ -173,6 +174,9 @@ BUILD_EXPORTS = \ | ||
79 | # built for the build system to override those in BASE_FLAGS_TO_PASS. | ||
80 | EXTRA_BUILD_FLAGS = \ | ||
81 | CFLAGS="$(CFLAGS_FOR_BUILD)" \ | ||
82 | + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ | ||
83 | + CPP="$(CC_FOR_BUILD) -E" \ | ||
84 | + CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \ | ||
85 | LDFLAGS="$(LDFLAGS_FOR_BUILD)" | ||
86 | |||
87 | # This is the list of directories to built for the host system. | ||
88 | @@ -190,6 +194,7 @@ HOST_SUBDIR = @host_subdir@ | ||
89 | HOST_EXPORTS = \ | ||
90 | $(BASE_EXPORTS) \ | ||
91 | CC="$(CC)"; export CC; \ | ||
92 | + CPP="$(CC) -E"; export CPP; \ | ||
93 | ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ | ||
94 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | ||
95 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | ||
96 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | ||
97 | index 011c7ac2db6..2f1165f7b5e 100644 | ||
98 | --- a/gcc/Makefile.in | ||
99 | +++ b/gcc/Makefile.in | ||
100 | @@ -805,7 +805,7 @@ BUILD_LDFLAGS=@BUILD_LDFLAGS@ | ||
101 | BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@ | ||
102 | BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG) | ||
103 | BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ | ||
104 | - -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) | ||
105 | + -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD) | ||
106 | |||
107 | # Actual name to use when installing a native compiler. | ||
108 | GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') | ||
109 | diff --git a/gcc/configure b/gcc/configure | ||
110 | index 825a9652329..ff46cf58960 100755 | ||
111 | --- a/gcc/configure | ||
112 | +++ b/gcc/configure | ||
113 | @@ -12314,7 +12314,7 @@ else | ||
114 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
115 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
116 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
117 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
118 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
119 | ${realsrcdir}/configure \ | ||
120 | --enable-languages=${enable_languages-all} \ | ||
121 | ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \ | ||
122 | diff --git a/gcc/configure.ac b/gcc/configure.ac | ||
123 | index 6099eb3251f..b3c345b61dc 100644 | ||
124 | --- a/gcc/configure.ac | ||
125 | +++ b/gcc/configure.ac | ||
126 | @@ -1898,7 +1898,7 @@ else | ||
127 | CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ | ||
128 | CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ | ||
129 | LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ | ||
130 | - GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ | ||
131 | + GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ | ||
132 | ${realsrcdir}/configure \ | ||
133 | --enable-languages=${enable_languages-all} \ | ||
134 | ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch deleted file mode 100644 index 3cd75b71..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | From 4e53d0ae70af85af0e112a48a3e4dfe4c39f4a8d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 2 Feb 2016 10:26:10 -0800 | ||
4 | Subject: [PATCH] nios2: Define MUSL_DYNAMIC_LINKER | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Marek Vasut <marex@denx.de> | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | gcc/config/nios2/linux.h | 1 + | ||
12 | 1 file changed, 1 insertion(+) | ||
13 | |||
14 | diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h | ||
15 | index 4bdcdcca1f0..e7943a9d640 100644 | ||
16 | --- a/gcc/config/nios2/linux.h | ||
17 | +++ b/gcc/config/nios2/linux.h | ||
18 | @@ -30,6 +30,7 @@ | ||
19 | #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" | ||
20 | |||
21 | #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1" | ||
22 | +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1" | ||
23 | |||
24 | #undef LINK_SPEC | ||
25 | #define LINK_SPEC LINK_SPEC_ENDIAN \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch deleted file mode 100644 index 2a6769a8..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From 5db0404eb770ac477fd99d444226bcf021067584 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 27 Jun 2017 18:10:54 -0700 | ||
4 | Subject: [PATCH] Add ssp_nonshared to link commandline for musl targets | ||
5 | |||
6 | when -fstack-protector options are enabled we need to | ||
7 | link with ssp_shared on musl since it does not provide | ||
8 | the __stack_chk_fail_local() so essentially it provides | ||
9 | libssp but not libssp_nonshared something like | ||
10 | TARGET_LIBC_PROVIDES_SSP_BUT_NOT_SSP_NONSHARED | ||
11 | where-as for glibc the needed symbols | ||
12 | are already present in libc_nonshared library therefore | ||
13 | we do not need any library helper on glibc based systems | ||
14 | but musl needs the libssp_noshared from gcc | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | |||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | --- | ||
20 | gcc/config/linux.h | 7 +++++++ | ||
21 | gcc/config/rs6000/linux.h | 10 ++++++++++ | ||
22 | gcc/config/rs6000/linux64.h | 10 ++++++++++ | ||
23 | 3 files changed, 27 insertions(+) | ||
24 | |||
25 | diff --git a/gcc/config/linux.h b/gcc/config/linux.h | ||
26 | index 0c1a8118a26..bdc2a2d0659 100644 | ||
27 | --- a/gcc/config/linux.h | ||
28 | +++ b/gcc/config/linux.h | ||
29 | @@ -195,6 +195,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
30 | { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ | ||
31 | { 0, 0, 0, 0, 0, 0 } \ | ||
32 | } | ||
33 | +#ifdef TARGET_LIBC_PROVIDES_SSP | ||
34 | +#undef LINK_SSP_SPEC | ||
35 | +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ | ||
36 | + "|fstack-protector-strong|fstack-protector-explicit" \ | ||
37 | + ":-lssp_nonshared}" | ||
38 | +#endif | ||
39 | + | ||
40 | #endif | ||
41 | |||
42 | #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ | ||
43 | diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h | ||
44 | index b7026fcbee7..dd54d6c393e 100644 | ||
45 | --- a/gcc/config/rs6000/linux.h | ||
46 | +++ b/gcc/config/rs6000/linux.h | ||
47 | @@ -94,6 +94,16 @@ | ||
48 | " -m elf32ppclinux") | ||
49 | #endif | ||
50 | |||
51 | +/* link libssp_nonshared.a with musl */ | ||
52 | +#if DEFAULT_LIBC == LIBC_MUSL | ||
53 | +#ifdef TARGET_LIBC_PROVIDES_SSP | ||
54 | +#undef LINK_SSP_SPEC | ||
55 | +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ | ||
56 | + "|fstack-protector-strong|fstack-protector-explicit" \ | ||
57 | + ":-lssp_nonshared}" | ||
58 | +#endif | ||
59 | +#endif | ||
60 | + | ||
61 | #undef LINK_OS_LINUX_SPEC | ||
62 | #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \ | ||
63 | %{!static-pie: \ | ||
64 | diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h | ||
65 | index 967c1c43c63..dc5e4d97975 100644 | ||
66 | --- a/gcc/config/rs6000/linux64.h | ||
67 | +++ b/gcc/config/rs6000/linux64.h | ||
68 | @@ -452,6 +452,16 @@ extern int dot_symbols; | ||
69 | " -m elf64ppc") | ||
70 | #endif | ||
71 | |||
72 | +/* link libssp_nonshared.a with musl */ | ||
73 | +#if DEFAULT_LIBC == LIBC_MUSL | ||
74 | +#ifdef TARGET_LIBC_PROVIDES_SSP | ||
75 | +#undef LINK_SSP_SPEC | ||
76 | +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ | ||
77 | + "|fstack-protector-strong|fstack-protector-explicit" \ | ||
78 | + ":-lssp_nonshared}" | ||
79 | +#endif | ||
80 | +#endif | ||
81 | + | ||
82 | #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ | ||
83 | %{!static-pie: \ | ||
84 | %{rdynamic:-export-dynamic} \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch deleted file mode 100644 index 767cba03..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From fbc926dbf6a47fa623b9c94cd9b09a0e90448fdc Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 4 May 2016 21:11:34 -0700 | ||
4 | Subject: [PATCH] Link libgcc using LDFLAGS, not just SHLIB_LDFLAGS | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | libgcc/config/t-slibgcc | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/libgcc/config/t-slibgcc b/libgcc/config/t-slibgcc | ||
15 | index c997553447c..330352c2c81 100644 | ||
16 | --- a/libgcc/config/t-slibgcc | ||
17 | +++ b/libgcc/config/t-slibgcc | ||
18 | @@ -32,7 +32,7 @@ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \ | ||
19 | $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) | ||
20 | |||
21 | SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ | ||
22 | - $(SHLIB_LDFLAGS) \ | ||
23 | + $(LDFLAGS) $(SHLIB_LDFLAGS) \ | ||
24 | -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ | ||
25 | $(SHLIB_OBJS) $(SHLIB_LC) && \ | ||
26 | rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch deleted file mode 100644 index 4f18907a..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | From 24dc04dc8d69e3bf61322615b3ef18e02ccd311e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 3 Feb 2017 12:56:00 -0800 | ||
4 | Subject: [PATCH] sync gcc stddef.h with musl | ||
5 | |||
6 | musl defines ptrdiff_t size_t and wchar_t | ||
7 | so dont define them here if musl is definining them | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | gcc/ginclude/stddef.h | 9 +++++++++ | ||
14 | 1 file changed, 9 insertions(+) | ||
15 | |||
16 | diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h | ||
17 | index 9d67eac4947..6cb5edbedb4 100644 | ||
18 | --- a/gcc/ginclude/stddef.h | ||
19 | +++ b/gcc/ginclude/stddef.h | ||
20 | @@ -128,6 +128,7 @@ _TYPE_wchar_t; | ||
21 | #ifndef ___int_ptrdiff_t_h | ||
22 | #ifndef _GCC_PTRDIFF_T | ||
23 | #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ | ||
24 | +#ifndef __DEFINED_ptrdiff_t /* musl */ | ||
25 | #define _PTRDIFF_T | ||
26 | #define _T_PTRDIFF_ | ||
27 | #define _T_PTRDIFF | ||
28 | @@ -137,10 +138,12 @@ _TYPE_wchar_t; | ||
29 | #define ___int_ptrdiff_t_h | ||
30 | #define _GCC_PTRDIFF_T | ||
31 | #define _PTRDIFF_T_DECLARED | ||
32 | +#define __DEFINED_ptrdiff_t /* musl */ | ||
33 | #ifndef __PTRDIFF_TYPE__ | ||
34 | #define __PTRDIFF_TYPE__ long int | ||
35 | #endif | ||
36 | typedef __PTRDIFF_TYPE__ ptrdiff_t; | ||
37 | +#endif /* __DEFINED_ptrdiff_t */ | ||
38 | #endif /* _PTRDIFF_T_DECLARED */ | ||
39 | #endif /* _GCC_PTRDIFF_T */ | ||
40 | #endif /* ___int_ptrdiff_t_h */ | ||
41 | @@ -178,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; | ||
42 | #ifndef _GCC_SIZE_T | ||
43 | #ifndef _SIZET_ | ||
44 | #ifndef __size_t | ||
45 | +#ifndef __DEFINED_size_t /* musl */ | ||
46 | #define __size_t__ /* BeOS */ | ||
47 | #define __SIZE_T__ /* Cray Unicos/Mk */ | ||
48 | #define _SIZE_T | ||
49 | @@ -194,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; | ||
50 | #define ___int_size_t_h | ||
51 | #define _GCC_SIZE_T | ||
52 | #define _SIZET_ | ||
53 | +#define __DEFINED_size_t /* musl */ | ||
54 | #if defined (__FreeBSD__) \ | ||
55 | || defined(__DragonFly__) \ | ||
56 | || defined(__FreeBSD_kernel__) \ | ||
57 | @@ -228,6 +233,7 @@ typedef long ssize_t; | ||
58 | #endif /* _SIZE_T */ | ||
59 | #endif /* __SIZE_T__ */ | ||
60 | #endif /* __size_t__ */ | ||
61 | +#endif /* __DEFINED_size_t */ | ||
62 | #undef __need_size_t | ||
63 | #endif /* _STDDEF_H or __need_size_t. */ | ||
64 | |||
65 | @@ -257,6 +263,7 @@ typedef long ssize_t; | ||
66 | #ifndef ___int_wchar_t_h | ||
67 | #ifndef __INT_WCHAR_T_H | ||
68 | #ifndef _GCC_WCHAR_T | ||
69 | +#ifndef __DEFINED_wchar_t /* musl */ | ||
70 | #define __wchar_t__ /* BeOS */ | ||
71 | #define __WCHAR_T__ /* Cray Unicos/Mk */ | ||
72 | #define _WCHAR_T | ||
73 | @@ -272,6 +279,7 @@ typedef long ssize_t; | ||
74 | #define __INT_WCHAR_T_H | ||
75 | #define _GCC_WCHAR_T | ||
76 | #define _WCHAR_T_DECLARED | ||
77 | +#define __DEFINED_wchar_t /* musl */ | ||
78 | |||
79 | /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ | ||
80 | instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other | ||
81 | @@ -337,6 +345,7 @@ typedef __WCHAR_TYPE__ wchar_t; | ||
82 | #endif | ||
83 | #endif /* __WCHAR_T__ */ | ||
84 | #endif /* __wchar_t__ */ | ||
85 | +#endif /* __DEFINED_wchar_t musl */ | ||
86 | #undef __need_wchar_t | ||
87 | #endif /* _STDDEF_H or __need_wchar_t. */ | ||
88 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0031-fix-segmentation-fault-in-precompiled-header-generat.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0031-fix-segmentation-fault-in-precompiled-header-generat.patch deleted file mode 100644 index 702279af..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0031-fix-segmentation-fault-in-precompiled-header-generat.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From 27b8ba5555ada2dab076988529bfb84d00a4b901 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juro Bystricky <juro.bystricky@intel.com> | ||
3 | Date: Mon, 19 Mar 2018 22:31:20 -0700 | ||
4 | Subject: [PATCH] fix segmentation fault in precompiled header generation | ||
5 | |||
6 | Prevent a segmentation fault which occurs when using incorrect | ||
7 | structure trying to access name of some named operators, such as | ||
8 | CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in | ||
9 | those cases, as is may not be initialized at all. | ||
10 | |||
11 | [YOCTO #11738] | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | |||
15 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | libcpp/lex.c | 26 +++++++++++++++++++++----- | ||
19 | 1 file changed, 21 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/libcpp/lex.c b/libcpp/lex.c | ||
22 | index 56ac3a1dd73..73a951148b3 100644 | ||
23 | --- a/libcpp/lex.c | ||
24 | +++ b/libcpp/lex.c | ||
25 | @@ -3311,11 +3311,27 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token, | ||
26 | spell_ident: | ||
27 | case SPELL_IDENT: | ||
28 | if (forstring) | ||
29 | - { | ||
30 | - memcpy (buffer, NODE_NAME (token->val.node.spelling), | ||
31 | - NODE_LEN (token->val.node.spelling)); | ||
32 | - buffer += NODE_LEN (token->val.node.spelling); | ||
33 | - } | ||
34 | + { | ||
35 | + if (token->type == CPP_NAME) | ||
36 | + { | ||
37 | + memcpy (buffer, NODE_NAME (token->val.node.spelling), | ||
38 | + NODE_LEN (token->val.node.spelling)); | ||
39 | + buffer += NODE_LEN (token->val.node.spelling); | ||
40 | + break; | ||
41 | + } | ||
42 | + /* NAMED_OP, cannot use node.spelling */ | ||
43 | + if (token->flags & NAMED_OP) | ||
44 | + { | ||
45 | + const char *str = cpp_named_operator2name (token->type); | ||
46 | + if (str) | ||
47 | + { | ||
48 | + size_t len = strlen(str); | ||
49 | + memcpy(buffer, str, len); | ||
50 | + buffer += len; | ||
51 | + } | ||
52 | + break; | ||
53 | + } | ||
54 | + } | ||
55 | else | ||
56 | buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node); | ||
57 | break; | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0032-Fix-for-testsuite-failure.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0032-Fix-for-testsuite-failure.patch deleted file mode 100644 index 0a0767b4..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0032-Fix-for-testsuite-failure.patch +++ /dev/null | |||
@@ -1,255 +0,0 @@ | |||
1 | From 2512aacf023c679d86d8f40caff4f6ff412b32ff Mon Sep 17 00:00:00 2001 | ||
2 | From: RAGHUNATH LOLUR <raghunath.lolur@kpit.com> | ||
3 | Date: Wed, 6 Dec 2017 22:52:26 -0800 | ||
4 | Subject: [PATCH] Fix for testsuite failure | ||
5 | |||
6 | 2017-11-16 Raghunath Lolur <raghunath.lolur@kpit.com> | ||
7 | |||
8 | * gcc.dg/pr56275.c: If SSE is disabled, ensure that | ||
9 | "-mfpmath" is not set to use SSE. Set "-mfpmath=387". | ||
10 | * gcc.dg/pr68306.c: Likewise | ||
11 | * gcc.dg/pr68306-2.c: Likewise | ||
12 | * gcc.dg/pr68306-3.c: Likewise | ||
13 | * gcc.dg/pr69634.c: Likewise | ||
14 | * gcc.target/i386/amd64-abi-1.c: Likewise | ||
15 | * gcc.target/i386/funcspec-6.c: Likewise | ||
16 | * gcc.target/i386/interrupt-387-err-1.c: Likewise | ||
17 | * gcc.target/i386/isa-14.c: Likewise | ||
18 | * gcc.target/i386/pr44948-2b.c: Likewise | ||
19 | * gcc.target/i386/pr53425-1.c: Likewise | ||
20 | * gcc.target/i386/pr53425-2.c: Likewise | ||
21 | * gcc.target/i386/pr55247.c: Likewise | ||
22 | * gcc.target/i386/pr59644.c: Likewise | ||
23 | * gcc.target/i386/pr62120.c: Likewise | ||
24 | * gcc.target/i386/pr70467-1.c: Likewise | ||
25 | * gcc.target/i386/warn-vect-op-1.c: Likewise | ||
26 | |||
27 | If -Wall, -Werror are used during compilation various test cases fail | ||
28 | to compile. | ||
29 | |||
30 | If SSE is disabled, be sure to -mfpmath=387 to resolve this. | ||
31 | |||
32 | This patch removes the changes to Changelog from the original patch. | ||
33 | This will help us avoid conflicts. | ||
34 | |||
35 | Upstream-Status: Pending | ||
36 | |||
37 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
38 | --- | ||
39 | gcc/testsuite/gcc.dg/pr56275.c | 2 +- | ||
40 | gcc/testsuite/gcc.dg/pr68306-2.c | 2 +- | ||
41 | gcc/testsuite/gcc.dg/pr68306-3.c | 2 +- | ||
42 | gcc/testsuite/gcc.dg/pr68306.c | 2 +- | ||
43 | gcc/testsuite/gcc.dg/pr69634.c | 2 +- | ||
44 | gcc/testsuite/gcc.target/i386/amd64-abi-1.c | 2 +- | ||
45 | gcc/testsuite/gcc.target/i386/funcspec-6.c | 1 + | ||
46 | gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c | 2 +- | ||
47 | gcc/testsuite/gcc.target/i386/isa-14.c | 2 +- | ||
48 | gcc/testsuite/gcc.target/i386/pr44948-2b.c | 2 +- | ||
49 | gcc/testsuite/gcc.target/i386/pr53425-1.c | 2 +- | ||
50 | gcc/testsuite/gcc.target/i386/pr53425-2.c | 2 +- | ||
51 | gcc/testsuite/gcc.target/i386/pr55247.c | 2 +- | ||
52 | gcc/testsuite/gcc.target/i386/pr59644.c | 2 +- | ||
53 | gcc/testsuite/gcc.target/i386/pr62120.c | 2 +- | ||
54 | gcc/testsuite/gcc.target/i386/pr70467-1.c | 2 +- | ||
55 | gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | 2 +- | ||
56 | 17 files changed, 17 insertions(+), 16 deletions(-) | ||
57 | |||
58 | diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c | ||
59 | index b901bb2b199..a4f6c95e1a1 100644 | ||
60 | --- a/gcc/testsuite/gcc.dg/pr56275.c | ||
61 | +++ b/gcc/testsuite/gcc.dg/pr56275.c | ||
62 | @@ -1,6 +1,6 @@ | ||
63 | /* { dg-do compile } */ | ||
64 | /* { dg-options "-O2" } */ | ||
65 | -/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */ | ||
66 | +/* { dg-additional-options "-mno-sse -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */ | ||
67 | |||
68 | typedef long long v2tw __attribute__ ((vector_size (2 * sizeof (long long)))); | ||
69 | |||
70 | diff --git a/gcc/testsuite/gcc.dg/pr68306-2.c b/gcc/testsuite/gcc.dg/pr68306-2.c | ||
71 | index 4672ebe7987..2a368c484b6 100644 | ||
72 | --- a/gcc/testsuite/gcc.dg/pr68306-2.c | ||
73 | +++ b/gcc/testsuite/gcc.dg/pr68306-2.c | ||
74 | @@ -1,6 +1,6 @@ | ||
75 | /* { dg-do compile } */ | ||
76 | /* { dg-options "-O3" } */ | ||
77 | -/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */ | ||
78 | +/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */ | ||
79 | |||
80 | struct { | ||
81 | int tz_minuteswest; | ||
82 | diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c | ||
83 | index f5a8c102cf8..df3390c64c2 100644 | ||
84 | --- a/gcc/testsuite/gcc.dg/pr68306-3.c | ||
85 | +++ b/gcc/testsuite/gcc.dg/pr68306-3.c | ||
86 | @@ -1,6 +1,6 @@ | ||
87 | /* { dg-do compile } */ | ||
88 | /* { dg-options "-O3" } */ | ||
89 | -/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */ | ||
90 | +/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */ | ||
91 | /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */ | ||
92 | |||
93 | extern void fn2(); | ||
94 | diff --git a/gcc/testsuite/gcc.dg/pr68306.c b/gcc/testsuite/gcc.dg/pr68306.c | ||
95 | index 54e5b40f221..0813389e2c1 100644 | ||
96 | --- a/gcc/testsuite/gcc.dg/pr68306.c | ||
97 | +++ b/gcc/testsuite/gcc.dg/pr68306.c | ||
98 | @@ -1,6 +1,6 @@ | ||
99 | /* { dg-do compile } */ | ||
100 | /* { dg-options "-O3" } */ | ||
101 | -/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */ | ||
102 | +/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */ | ||
103 | |||
104 | enum powerpc_pmc_type { PPC_PMC_IBM }; | ||
105 | struct { | ||
106 | diff --git a/gcc/testsuite/gcc.dg/pr69634.c b/gcc/testsuite/gcc.dg/pr69634.c | ||
107 | index 60a56149463..bcc23f9ccd6 100644 | ||
108 | --- a/gcc/testsuite/gcc.dg/pr69634.c | ||
109 | +++ b/gcc/testsuite/gcc.dg/pr69634.c | ||
110 | @@ -1,6 +1,6 @@ | ||
111 | /* { dg-do compile } */ | ||
112 | /* { dg-options "-O2 -fno-dce -fschedule-insns -fno-tree-vrp -fcompare-debug -Wno-psabi" } */ | ||
113 | -/* { dg-additional-options "-mno-sse" { target i?86-*-* x86_64-*-* } } */ | ||
114 | +/* { dg-additional-options "-mno-sse -mfpmath=387" { target i?86-*-* x86_64-*-* } } */ | ||
115 | /* { dg-require-effective-target scheduling } */ | ||
116 | |||
117 | typedef unsigned short u16; | ||
118 | diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c | ||
119 | index 69fde57bf06..7f1f1c03edf 100644 | ||
120 | --- a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c | ||
121 | +++ b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c | ||
122 | @@ -1,5 +1,5 @@ | ||
123 | /* { dg-do compile { target { ! ia32 } } } */ | ||
124 | -/* { dg-options "-mno-sse" } */ | ||
125 | +/* { dg-options "-mno-sse -mfpmath=387" } */ | ||
126 | /* { dg-additional-options "-mabi=sysv" { target *-*-mingw* } } */ | ||
127 | |||
128 | double foo(void) { return 0; } /* { dg-error "SSE disabled" } */ | ||
129 | diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c | ||
130 | index ea896b7ebfd..bf15569b826 100644 | ||
131 | --- a/gcc/testsuite/gcc.target/i386/funcspec-6.c | ||
132 | +++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c | ||
133 | @@ -1,6 +1,7 @@ | ||
134 | /* Test whether all of the 64-bit function specific options are accepted | ||
135 | without error. */ | ||
136 | /* { dg-do compile { target { ! ia32 } } } */ | ||
137 | +/* { dg-additional-options "-mfpmath=387" } */ | ||
138 | |||
139 | #include "funcspec-56.inc" | ||
140 | |||
141 | diff --git a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c | ||
142 | index 8561a3c26d6..6377f814645 100644 | ||
143 | --- a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c | ||
144 | +++ b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c | ||
145 | @@ -1,5 +1,5 @@ | ||
146 | /* { dg-do compile } */ | ||
147 | -/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387" } */ | ||
148 | +/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387 -mfpmath=387" } */ | ||
149 | |||
150 | typedef unsigned int uword_t __attribute__ ((mode (__word__))); | ||
151 | |||
152 | diff --git a/gcc/testsuite/gcc.target/i386/isa-14.c b/gcc/testsuite/gcc.target/i386/isa-14.c | ||
153 | index 5d49e6e77fe..1de2db92bdd 100644 | ||
154 | --- a/gcc/testsuite/gcc.target/i386/isa-14.c | ||
155 | +++ b/gcc/testsuite/gcc.target/i386/isa-14.c | ||
156 | @@ -1,5 +1,5 @@ | ||
157 | /* { dg-do run } */ | ||
158 | -/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse" } */ | ||
159 | +/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse -mfpmath=387" } */ | ||
160 | |||
161 | extern void abort (void); | ||
162 | |||
163 | diff --git a/gcc/testsuite/gcc.target/i386/pr44948-2b.c b/gcc/testsuite/gcc.target/i386/pr44948-2b.c | ||
164 | index fa1769b62fb..f79fb12726f 100644 | ||
165 | --- a/gcc/testsuite/gcc.target/i386/pr44948-2b.c | ||
166 | +++ b/gcc/testsuite/gcc.target/i386/pr44948-2b.c | ||
167 | @@ -1,5 +1,5 @@ | ||
168 | /* { dg-do compile } */ | ||
169 | -/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic" } */ | ||
170 | +/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic -mfpmath=387" } */ | ||
171 | |||
172 | struct A | ||
173 | { | ||
174 | diff --git a/gcc/testsuite/gcc.target/i386/pr53425-1.c b/gcc/testsuite/gcc.target/i386/pr53425-1.c | ||
175 | index 2e89ff7d81d..6339bf6b736 100644 | ||
176 | --- a/gcc/testsuite/gcc.target/i386/pr53425-1.c | ||
177 | +++ b/gcc/testsuite/gcc.target/i386/pr53425-1.c | ||
178 | @@ -1,6 +1,6 @@ | ||
179 | /* PR target/53425 */ | ||
180 | /* { dg-do compile { target { ! ia32 } } } */ | ||
181 | -/* { dg-options "-O2 -mno-sse" } */ | ||
182 | +/* { dg-options "-O2 -mno-sse -mfpmath=387" } */ | ||
183 | /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */ | ||
184 | |||
185 | typedef double __v2df __attribute__ ((__vector_size__ (16))); | ||
186 | diff --git a/gcc/testsuite/gcc.target/i386/pr53425-2.c b/gcc/testsuite/gcc.target/i386/pr53425-2.c | ||
187 | index 61f6283dbe9..2c5a55f0ac3 100644 | ||
188 | --- a/gcc/testsuite/gcc.target/i386/pr53425-2.c | ||
189 | +++ b/gcc/testsuite/gcc.target/i386/pr53425-2.c | ||
190 | @@ -1,6 +1,6 @@ | ||
191 | /* PR target/53425 */ | ||
192 | /* { dg-do compile { target { ! ia32 } } } */ | ||
193 | -/* { dg-options "-O2 -mno-sse" } */ | ||
194 | +/* { dg-options "-O2 -mno-sse -mfpmath=387" } */ | ||
195 | /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */ | ||
196 | |||
197 | typedef float __v2sf __attribute__ ((__vector_size__ (8))); | ||
198 | diff --git a/gcc/testsuite/gcc.target/i386/pr55247.c b/gcc/testsuite/gcc.target/i386/pr55247.c | ||
199 | index 23366d0909d..9810e3abb76 100644 | ||
200 | --- a/gcc/testsuite/gcc.target/i386/pr55247.c | ||
201 | +++ b/gcc/testsuite/gcc.target/i386/pr55247.c | ||
202 | @@ -1,6 +1,6 @@ | ||
203 | /* { dg-do compile { target { ! ia32 } } } */ | ||
204 | /* { dg-require-effective-target maybe_x32 } */ | ||
205 | -/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long" } */ | ||
206 | +/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long -mfpmath=387" } */ | ||
207 | |||
208 | typedef unsigned int uint32_t; | ||
209 | typedef uint32_t Elf32_Word; | ||
210 | diff --git a/gcc/testsuite/gcc.target/i386/pr59644.c b/gcc/testsuite/gcc.target/i386/pr59644.c | ||
211 | index 96006b3e338..4287e4538bf 100644 | ||
212 | --- a/gcc/testsuite/gcc.target/i386/pr59644.c | ||
213 | +++ b/gcc/testsuite/gcc.target/i386/pr59644.c | ||
214 | @@ -1,6 +1,6 @@ | ||
215 | /* PR target/59644 */ | ||
216 | /* { dg-do run { target lp64 } } */ | ||
217 | -/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone" } */ | ||
218 | +/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone -mfpmath=387" } */ | ||
219 | |||
220 | /* This test uses __builtin_trap () instead of e.g. abort, | ||
221 | because due to -mpreferred-stack-boundary=3 it should not call | ||
222 | diff --git a/gcc/testsuite/gcc.target/i386/pr62120.c b/gcc/testsuite/gcc.target/i386/pr62120.c | ||
223 | index 28d85d37712..c93266bd4bc 100644 | ||
224 | --- a/gcc/testsuite/gcc.target/i386/pr62120.c | ||
225 | +++ b/gcc/testsuite/gcc.target/i386/pr62120.c | ||
226 | @@ -1,5 +1,5 @@ | ||
227 | /* { dg-do compile } */ | ||
228 | -/* { dg-options "-mno-sse" } */ | ||
229 | +/* { dg-options "-mno-sse -mfpmath=387" } */ | ||
230 | |||
231 | void foo () | ||
232 | { | ||
233 | diff --git a/gcc/testsuite/gcc.target/i386/pr70467-1.c b/gcc/testsuite/gcc.target/i386/pr70467-1.c | ||
234 | index 4e112c88d07..bcfb396a68d 100644 | ||
235 | --- a/gcc/testsuite/gcc.target/i386/pr70467-1.c | ||
236 | +++ b/gcc/testsuite/gcc.target/i386/pr70467-1.c | ||
237 | @@ -1,6 +1,6 @@ | ||
238 | /* PR rtl-optimization/70467 */ | ||
239 | /* { dg-do compile } */ | ||
240 | -/* { dg-options "-O2 -mno-sse" } */ | ||
241 | +/* { dg-options "-O2 -mno-sse -mfpmath=387" } */ | ||
242 | |||
243 | void foo (unsigned long long *); | ||
244 | |||
245 | diff --git a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | ||
246 | index 6cda1534311..26e37f5b8ba 100644 | ||
247 | --- a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | ||
248 | +++ b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | ||
249 | @@ -1,5 +1,5 @@ | ||
250 | /* { dg-do compile { target { ! ia32 } } } */ | ||
251 | -/* { dg-options "-mno-sse -Wvector-operation-performance" } */ | ||
252 | +/* { dg-options "-mno-sse -Wvector-operation-performance -mfpmath=387" } */ | ||
253 | #define vector(elcount, type) \ | ||
254 | __attribute__((vector_size((elcount)*sizeof(type)))) type | ||
255 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch deleted file mode 100644 index ba7c2b8f..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | From 3fc06241ce37e2e4b3ed21ace28d347eb511448d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 6 Jun 2018 12:10:22 -0700 | ||
4 | Subject: [PATCH] Re-introduce spe commandline options | ||
5 | |||
6 | This should ensure that we keep accepting | ||
7 | spe options | ||
8 | |||
9 | Upstream-Status: Inappropriate [SPE port is removed from rs600 port] | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | gcc/config/rs6000/rs6000.opt | 12 ++++++++++++ | ||
14 | 1 file changed, 12 insertions(+) | ||
15 | |||
16 | diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt | ||
17 | index f95b8279270..0e52d51409d 100644 | ||
18 | --- a/gcc/config/rs6000/rs6000.opt | ||
19 | +++ b/gcc/config/rs6000/rs6000.opt | ||
20 | @@ -344,6 +344,18 @@ mdebug= | ||
21 | Target RejectNegative Joined | ||
22 | -mdebug= Enable debug output. | ||
23 | |||
24 | +mspe | ||
25 | +Target Var(rs6000_spe) Save | ||
26 | +Generate SPE SIMD instructions on E500. | ||
27 | + | ||
28 | +mabi=spe | ||
29 | +Target RejectNegative Var(rs6000_spe_abi) Save | ||
30 | +Use the SPE ABI extensions. | ||
31 | + | ||
32 | +mabi=no-spe | ||
33 | +Target RejectNegative Var(rs6000_spe_abi, 0) | ||
34 | +Do not use the SPE ABI extensions. | ||
35 | + | ||
36 | mabi=altivec | ||
37 | Target RejectNegative Var(rs6000_altivec_abi) Save | ||
38 | Use the AltiVec ABI extensions. | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch deleted file mode 100644 index 4ce9dc6d..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | From b42ff59c3fe2967d37815c8db72a47b9b7f585b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Szabolcs Nagy <nsz@port70.net> | ||
3 | Date: Sat, 24 Oct 2015 20:09:53 +0000 | ||
4 | Subject: [PATCH] libgcc_s: Use alias for __cpu_indicator_init instead of | ||
5 | symver | ||
6 | |||
7 | Adapter from | ||
8 | |||
9 | https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00899.html | ||
10 | |||
11 | This fix was debated but hasnt been applied gcc upstream since | ||
12 | they expect musl to support '@' in symbol versioning which is | ||
13 | a sun/gnu versioning extention. This patch however avoids the | ||
14 | need for the '@' symbols at all | ||
15 | |||
16 | libgcc/Changelog: | ||
17 | |||
18 | 2015-05-11 Szabolcs Nagy <szabolcs.nagy@arm.com> | ||
19 | |||
20 | * config/i386/cpuinfo.c (__cpu_indicator_init_local): Add. | ||
21 | (__cpu_indicator_init@GCC_4.8.0, __cpu_model@GCC_4.8.0): Remove. | ||
22 | |||
23 | * config/i386/t-linux (HOST_LIBGCC2_CFLAGS): Remove -DUSE_ELF_SYMVER. | ||
24 | |||
25 | gcc/Changelog: | ||
26 | |||
27 | 2015-05-11 Szabolcs Nagy <szabolcs.nagy@arm.com> | ||
28 | |||
29 | * config/i386/i386-expand.c (ix86_expand_builtin): Make __builtin_cpu_init | ||
30 | call __cpu_indicator_init_local instead of __cpu_indicator_init. | ||
31 | |||
32 | Upstream-Status: Pending | ||
33 | |||
34 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
35 | --- | ||
36 | gcc/config/i386/i386-expand.c | 4 ++-- | ||
37 | libgcc/config/i386/cpuinfo.c | 6 +++--- | ||
38 | libgcc/config/i386/t-linux | 2 +- | ||
39 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
40 | |||
41 | diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c | ||
42 | index 48f00c5fcfc..468f5f71fac 100644 | ||
43 | --- a/gcc/config/i386/i386-expand.c | ||
44 | +++ b/gcc/config/i386/i386-expand.c | ||
45 | @@ -10941,10 +10941,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, | ||
46 | { | ||
47 | case IX86_BUILTIN_CPU_INIT: | ||
48 | { | ||
49 | - /* Make it call __cpu_indicator_init in libgcc. */ | ||
50 | + /* Make it call __cpu_indicator_init_local in libgcc.a. */ | ||
51 | tree call_expr, fndecl, type; | ||
52 | type = build_function_type_list (integer_type_node, NULL_TREE); | ||
53 | - fndecl = build_fn_decl ("__cpu_indicator_init", type); | ||
54 | + fndecl = build_fn_decl ("__cpu_indicator_init_local", type); | ||
55 | call_expr = build_call_expr (fndecl, 0); | ||
56 | return expand_expr (call_expr, target, mode, EXPAND_NORMAL); | ||
57 | } | ||
58 | diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c | ||
59 | index 00322c58622..f42bbb8af98 100644 | ||
60 | --- a/libgcc/config/i386/cpuinfo.c | ||
61 | +++ b/libgcc/config/i386/cpuinfo.c | ||
62 | @@ -508,7 +508,7 @@ __cpu_indicator_init (void) | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | -#if defined SHARED && defined USE_ELF_SYMVER | ||
67 | -__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); | ||
68 | -__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); | ||
69 | +#ifndef SHARED | ||
70 | +int __cpu_indicator_init_local (void) | ||
71 | + __attribute__ ((weak, alias ("__cpu_indicator_init"))); | ||
72 | #endif | ||
73 | diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux | ||
74 | index 8506a635790..564296f788e 100644 | ||
75 | --- a/libgcc/config/i386/t-linux | ||
76 | +++ b/libgcc/config/i386/t-linux | ||
77 | @@ -3,5 +3,5 @@ | ||
78 | # t-slibgcc-elf-ver and t-linux | ||
79 | SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver | ||
80 | |||
81 | -HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS) | ||
82 | +HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) | ||
83 | CRTSTUFF_T_CFLAGS += $(CET_FLAGS) | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch deleted file mode 100644 index dd1bf6de..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch +++ /dev/null | |||
@@ -1,182 +0,0 @@ | |||
1 | From 0395060a7dcf98c5f5a65103f6aaa71d6b862259 Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Tue, 10 Mar 2020 08:26:53 -0700 | ||
4 | Subject: [PATCH] gentypes/genmodes: Do not use __LINE__ for maintaining | ||
5 | reproducibility | ||
6 | |||
7 | Inserting line numbers into generated code means its not always reproducible wth | ||
8 | differing versions of host gcc. Void the issue by not adding these. | ||
9 | |||
10 | Upstream-Status: Inappropriate [OE Reproducibility specific] | ||
11 | |||
12 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | gcc/gengtype.c | 6 +++--- | ||
16 | gcc/genmodes.c | 32 ++++++++++++++++---------------- | ||
17 | 2 files changed, 19 insertions(+), 19 deletions(-) | ||
18 | |||
19 | diff --git a/gcc/gengtype.c b/gcc/gengtype.c | ||
20 | index 981577481af..d5700fff401 100644 | ||
21 | --- a/gcc/gengtype.c | ||
22 | +++ b/gcc/gengtype.c | ||
23 | @@ -991,7 +991,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt, | ||
24 | /* Create a fake field with the given type and name. NEXT is the next | ||
25 | field in the chain. */ | ||
26 | #define create_field(next,type,name) \ | ||
27 | - create_field_all (next,type,name, 0, this_file, __LINE__) | ||
28 | + create_field_all (next,type,name, 0, this_file, 0) | ||
29 | |||
30 | /* Like create_field, but the field is only valid when condition COND | ||
31 | is true. */ | ||
32 | @@ -1024,7 +1024,7 @@ create_optional_field_ (pair_p next, type_p type, const char *name, | ||
33 | } | ||
34 | |||
35 | #define create_optional_field(next,type,name,cond) \ | ||
36 | - create_optional_field_(next,type,name,cond,__LINE__) | ||
37 | + create_optional_field_(next,type,name,cond,0) | ||
38 | |||
39 | /* Reverse a linked list of 'struct pair's in place. */ | ||
40 | pair_p | ||
41 | @@ -5187,7 +5187,7 @@ main (int argc, char **argv) | ||
42 | /* These types are set up with #define or else outside of where | ||
43 | we can see them. We should initialize them before calling | ||
44 | read_input_list. */ | ||
45 | -#define POS_HERE(Call) do { pos.file = this_file; pos.line = __LINE__; \ | ||
46 | +#define POS_HERE(Call) do { pos.file = this_file; pos.line = 0; \ | ||
47 | Call;} while (0) | ||
48 | POS_HERE (do_scalar_typedef ("CUMULATIVE_ARGS", &pos)); | ||
49 | POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos)); | ||
50 | diff --git a/gcc/genmodes.c b/gcc/genmodes.c | ||
51 | index bd78310ea24..dbd02c51a4c 100644 | ||
52 | --- a/gcc/genmodes.c | ||
53 | +++ b/gcc/genmodes.c | ||
54 | @@ -430,7 +430,7 @@ complete_all_modes (void) | ||
55 | } | ||
56 | |||
57 | /* For each mode in class CLASS, construct a corresponding complex mode. */ | ||
58 | -#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, __LINE__) | ||
59 | +#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, 0) | ||
60 | static void | ||
61 | make_complex_modes (enum mode_class cl, | ||
62 | const char *file, unsigned int line) | ||
63 | @@ -489,7 +489,7 @@ make_complex_modes (enum mode_class cl, | ||
64 | having as many components as necessary. ORDER is the sorting order | ||
65 | of the mode, with smaller numbers indicating a higher priority. */ | ||
66 | #define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W, ORDER) \ | ||
67 | - make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, __LINE__) | ||
68 | + make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, 0) | ||
69 | #define VECTOR_MODES(C, W) VECTOR_MODES_WITH_PREFIX (V, C, W, 0) | ||
70 | static void ATTRIBUTE_UNUSED | ||
71 | make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width, | ||
72 | @@ -541,7 +541,7 @@ make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width, | ||
73 | /* Create a vector of booleans called NAME with COUNT elements and | ||
74 | BYTESIZE bytes in total. */ | ||
75 | #define VECTOR_BOOL_MODE(NAME, COUNT, BYTESIZE) \ | ||
76 | - make_vector_bool_mode (#NAME, COUNT, BYTESIZE, __FILE__, __LINE__) | ||
77 | + make_vector_bool_mode (#NAME, COUNT, BYTESIZE, __FILE__, 0) | ||
78 | static void ATTRIBUTE_UNUSED | ||
79 | make_vector_bool_mode (const char *name, unsigned int count, | ||
80 | unsigned int bytesize, const char *file, | ||
81 | @@ -563,7 +563,7 @@ make_vector_bool_mode (const char *name, unsigned int count, | ||
82 | /* Input. */ | ||
83 | |||
84 | #define _SPECIAL_MODE(C, N) \ | ||
85 | - make_special_mode (MODE_##C, #N, __FILE__, __LINE__) | ||
86 | + make_special_mode (MODE_##C, #N, __FILE__, 0) | ||
87 | #define RANDOM_MODE(N) _SPECIAL_MODE (RANDOM, N) | ||
88 | #define CC_MODE(N) _SPECIAL_MODE (CC, N) | ||
89 | |||
90 | @@ -576,7 +576,7 @@ make_special_mode (enum mode_class cl, const char *name, | ||
91 | |||
92 | #define INT_MODE(N, Y) FRACTIONAL_INT_MODE (N, -1U, Y) | ||
93 | #define FRACTIONAL_INT_MODE(N, B, Y) \ | ||
94 | - make_int_mode (#N, B, Y, __FILE__, __LINE__) | ||
95 | + make_int_mode (#N, B, Y, __FILE__, 0) | ||
96 | |||
97 | static void | ||
98 | make_int_mode (const char *name, | ||
99 | @@ -589,16 +589,16 @@ make_int_mode (const char *name, | ||
100 | } | ||
101 | |||
102 | #define FRACT_MODE(N, Y, F) \ | ||
103 | - make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__) | ||
104 | + make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, 0) | ||
105 | |||
106 | #define UFRACT_MODE(N, Y, F) \ | ||
107 | - make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, __LINE__) | ||
108 | + make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, 0) | ||
109 | |||
110 | #define ACCUM_MODE(N, Y, I, F) \ | ||
111 | - make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, __LINE__) | ||
112 | + make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, 0) | ||
113 | |||
114 | #define UACCUM_MODE(N, Y, I, F) \ | ||
115 | - make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__) | ||
116 | + make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, 0) | ||
117 | |||
118 | /* Create a fixed-point mode by setting CL, NAME, BYTESIZE, IBIT, FBIT, | ||
119 | FILE, and LINE. */ | ||
120 | @@ -619,7 +619,7 @@ make_fixed_point_mode (enum mode_class cl, | ||
121 | |||
122 | #define FLOAT_MODE(N, Y, F) FRACTIONAL_FLOAT_MODE (N, -1U, Y, F) | ||
123 | #define FRACTIONAL_FLOAT_MODE(N, B, Y, F) \ | ||
124 | - make_float_mode (#N, B, Y, #F, __FILE__, __LINE__) | ||
125 | + make_float_mode (#N, B, Y, #F, __FILE__, 0) | ||
126 | |||
127 | static void | ||
128 | make_float_mode (const char *name, | ||
129 | @@ -636,7 +636,7 @@ make_float_mode (const char *name, | ||
130 | #define DECIMAL_FLOAT_MODE(N, Y, F) \ | ||
131 | FRACTIONAL_DECIMAL_FLOAT_MODE (N, -1U, Y, F) | ||
132 | #define FRACTIONAL_DECIMAL_FLOAT_MODE(N, B, Y, F) \ | ||
133 | - make_decimal_float_mode (#N, B, Y, #F, __FILE__, __LINE__) | ||
134 | + make_decimal_float_mode (#N, B, Y, #F, __FILE__, 0) | ||
135 | |||
136 | static void | ||
137 | make_decimal_float_mode (const char *name, | ||
138 | @@ -651,7 +651,7 @@ make_decimal_float_mode (const char *name, | ||
139 | } | ||
140 | |||
141 | #define RESET_FLOAT_FORMAT(N, F) \ | ||
142 | - reset_float_format (#N, #F, __FILE__, __LINE__) | ||
143 | + reset_float_format (#N, #F, __FILE__, 0) | ||
144 | static void ATTRIBUTE_UNUSED | ||
145 | reset_float_format (const char *name, const char *format, | ||
146 | const char *file, unsigned int line) | ||
147 | @@ -672,7 +672,7 @@ reset_float_format (const char *name, const char *format, | ||
148 | |||
149 | /* __intN support. */ | ||
150 | #define INT_N(M,PREC) \ | ||
151 | - make_int_n (#M, PREC, __FILE__, __LINE__) | ||
152 | + make_int_n (#M, PREC, __FILE__, 0) | ||
153 | static void ATTRIBUTE_UNUSED | ||
154 | make_int_n (const char *m, int bitsize, | ||
155 | const char *file, unsigned int line) | ||
156 | @@ -701,7 +701,7 @@ make_int_n (const char *m, int bitsize, | ||
157 | /* Partial integer modes are specified by relation to a full integer | ||
158 | mode. */ | ||
159 | #define PARTIAL_INT_MODE(M,PREC,NAME) \ | ||
160 | - make_partial_integer_mode (#M, #NAME, PREC, __FILE__, __LINE__) | ||
161 | + make_partial_integer_mode (#M, #NAME, PREC, __FILE__, 0) | ||
162 | static void ATTRIBUTE_UNUSED | ||
163 | make_partial_integer_mode (const char *base, const char *name, | ||
164 | unsigned int precision, | ||
165 | @@ -728,7 +728,7 @@ make_partial_integer_mode (const char *base, const char *name, | ||
166 | /* A single vector mode can be specified by naming its component | ||
167 | mode and the number of components. */ | ||
168 | #define VECTOR_MODE(C, M, N) \ | ||
169 | - make_vector_mode (MODE_##C, #M, N, __FILE__, __LINE__); | ||
170 | + make_vector_mode (MODE_##C, #M, N, __FILE__, 0); | ||
171 | static void ATTRIBUTE_UNUSED | ||
172 | make_vector_mode (enum mode_class bclass, | ||
173 | const char *base, | ||
174 | @@ -771,7 +771,7 @@ make_vector_mode (enum mode_class bclass, | ||
175 | |||
176 | /* Adjustability. */ | ||
177 | #define _ADD_ADJUST(A, M, X, C1, C2) \ | ||
178 | - new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, __LINE__) | ||
179 | + new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, 0) | ||
180 | |||
181 | #define ADJUST_NUNITS(M, X) _ADD_ADJUST (nunits, M, X, RANDOM, RANDOM) | ||
182 | #define ADJUST_BYTESIZE(M, X) _ADD_ADJUST (bytesize, M, X, RANDOM, RANDOM) | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch deleted file mode 100644 index de82a3a5..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From 6f87a095f0e696bec07a50df789c9db8bdbca43d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 12 May 2020 10:39:09 -0700 | ||
4 | Subject: [PATCH] mingw32: Enable operation_not_supported | ||
5 | |||
6 | Fixes nativesdk build errors on mingw32 gcc-runtime | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | libstdc++-v3/config/os/mingw32/error_constants.h | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/libstdc++-v3/config/os/mingw32/error_constants.h b/libstdc++-v3/config/os/mingw32/error_constants.h | ||
15 | index 68ac72a78fb..71cd5815b81 100644 | ||
16 | --- a/libstdc++-v3/config/os/mingw32/error_constants.h | ||
17 | +++ b/libstdc++-v3/config/os/mingw32/error_constants.h | ||
18 | @@ -107,7 +107,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | ||
19 | #ifdef _GLIBCXX_HAVE_EPERM | ||
20 | operation_not_permitted = EPERM, | ||
21 | #endif | ||
22 | -// operation_not_supported = EOPNOTSUPP, | ||
23 | + operation_not_supported = EOPNOTSUPP, | ||
24 | #ifdef _GLIBCXX_HAVE_EWOULDBLOCK | ||
25 | operation_would_block = EWOULDBLOCK, | ||
26 | #endif | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch b/meta-microblaze/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch deleted file mode 100644 index 3946acea..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | From 38d262bfe7c0c894c364dc6e4dc7971e78a73974 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 13 May 2020 15:10:38 -0700 | ||
4 | Subject: [PATCH] libatomic: Do not enforce march on aarch64 | ||
5 | |||
6 | OE passes the right options via gcc compiler cmdline via TUNE_CCARGS | ||
7 | this can conflict between -mcpu settings and -march setting here, since | ||
8 | -mcpu will translate into an appropriate -march, lets depend on that | ||
9 | instead of setting it explicitly | ||
10 | |||
11 | Upstream-Status: Inappropriate [OE-Specific] | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | libatomic/Makefile.am | 1 - | ||
16 | libatomic/Makefile.in | 1 - | ||
17 | 2 files changed, 2 deletions(-) | ||
18 | |||
19 | diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am | ||
20 | index 133fbbca77e..ac1ca645876 100644 | ||
21 | --- a/libatomic/Makefile.am | ||
22 | +++ b/libatomic/Makefile.am | ||
23 | @@ -125,7 +125,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS))) | ||
24 | ## On a target-specific basis, include alternates to be selected by IFUNC. | ||
25 | if HAVE_IFUNC | ||
26 | if ARCH_AARCH64_LINUX | ||
27 | -IFUNC_OPTIONS = -march=armv8-a+lse | ||
28 | libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS))) | ||
29 | endif | ||
30 | if ARCH_ARM_LINUX | ||
31 | diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in | ||
32 | index a51807e95c9..97df2d7ff03 100644 | ||
33 | --- a/libatomic/Makefile.in | ||
34 | +++ b/libatomic/Makefile.in | ||
35 | @@ -431,7 +431,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files))) | ||
36 | libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \ | ||
37 | _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \ | ||
38 | $(am__append_3) $(am__append_4) | ||
39 | -@ARCH_AARCH64_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv8-a+lse | ||
40 | @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64 | ||
41 | @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586 | ||
42 | @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc_10.2.bb b/meta-microblaze/recipes-devtools/gcc/gcc_10.2.bb deleted file mode 100644 index 255fe552..00000000 --- a/meta-microblaze/recipes-devtools/gcc/gcc_10.2.bb +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require gcc-target.inc | ||
3 | |||
4 | # Building with thumb enabled on armv4t armv5t fails with | ||
5 | # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs | ||
6 | # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output | ||
7 | ARM_INSTRUCTION_SET:armv4 = "arm" | ||
8 | ARM_INSTRUCTION_SET:armv5 = "arm" | ||
9 | |||
10 | ARMFPARCHEXT:armv6 = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}" | ||
11 | ARMFPARCHEXT:armv7a = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}" | ||
12 | ARMFPARCHEXT:armv7ve = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}" | ||
13 | |||
14 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgcc-common.inc b/meta-microblaze/recipes-devtools/gcc/libgcc-common.inc deleted file mode 100644 index d48dc8b8..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgcc-common.inc +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | BPN = "libgcc" | ||
2 | |||
3 | require gcc-configure-common.inc | ||
4 | |||
5 | INHIBIT_DEFAULT_DEPS = "1" | ||
6 | |||
7 | do_configure () { | ||
8 | install -d ${D}${base_libdir} ${D}${libdir} | ||
9 | mkdir -p ${B}/${BPN} | ||
10 | mkdir -p ${B}/${TARGET_SYS}/${BPN}/ | ||
11 | cd ${B}/${BPN} | ||
12 | chmod a+x ${S}/${BPN}/configure | ||
13 | relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")} | ||
14 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
15 | } | ||
16 | EXTRACONFFUNCS += "extract_stashed_builddir" | ||
17 | do_configure[depends] += "${COMPILERDEP}" | ||
18 | |||
19 | do_compile () { | ||
20 | cd ${B}/${BPN} | ||
21 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/ | ||
22 | } | ||
23 | |||
24 | do_install () { | ||
25 | cd ${B}/${BPN} | ||
26 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/ install | ||
27 | |||
28 | # Move libgcc_s into /lib | ||
29 | mkdir -p ${D}${base_libdir} | ||
30 | if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then | ||
31 | mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir} | ||
32 | else | ||
33 | mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true | ||
34 | fi | ||
35 | |||
36 | # install the runtime in /usr/lib/ not in /usr/lib/gcc on target | ||
37 | # so that cross-gcc can find it in the sysroot | ||
38 | |||
39 | mv ${D}${libdir}/gcc/* ${D}${libdir} | ||
40 | rm -rf ${D}${libdir}/gcc/ | ||
41 | # unwind.h is installed here which is shipped in gcc-cross | ||
42 | # as well as target gcc and they are identical so we dont | ||
43 | # ship one with libgcc here | ||
44 | rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include | ||
45 | } | ||
46 | |||
47 | do_install:append:libc-baremetal () { | ||
48 | rmdir ${D}${base_libdir} | ||
49 | } | ||
50 | do_install:append:libc-newlib () { | ||
51 | rmdir ${D}${base_libdir} | ||
52 | } | ||
53 | |||
54 | # No rpm package is actually created but -dev depends on it, avoid dnf error | ||
55 | RDEPENDS:${PN}-dev:libc-baremetal = "" | ||
56 | RDEPENDS:${PN}-dev:libc-newlib = "" | ||
57 | |||
58 | BBCLASSEXTEND = "nativesdk" | ||
59 | |||
60 | addtask multilib_install after do_install before do_package do_populate_sysroot | ||
61 | # this makes multilib gcc files findable for target gcc | ||
62 | # e.g. | ||
63 | # /usr/lib/i586-pokymllib32-linux/4.7/ | ||
64 | # by creating this symlink to it | ||
65 | # /usr/lib64/x86_64-poky-linux/4.7/32 | ||
66 | |||
67 | fakeroot python do_multilib_install() { | ||
68 | import re | ||
69 | |||
70 | multilibs = d.getVar('MULTILIB_VARIANTS') | ||
71 | if not multilibs or bb.data.inherits_class('nativesdk', d): | ||
72 | return | ||
73 | |||
74 | binv = d.getVar('BINV') | ||
75 | |||
76 | mlprefix = d.getVar('MLPREFIX') | ||
77 | if ('%slibgcc' % mlprefix) != d.getVar('PN'): | ||
78 | return | ||
79 | |||
80 | if mlprefix: | ||
81 | orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL') | ||
82 | orig_tune_params = get_tune_parameters(orig_tune, d) | ||
83 | orig_tune_baselib = orig_tune_params['baselib'] | ||
84 | orig_tune_bitness = orig_tune_baselib.replace('lib', '') | ||
85 | if not orig_tune_bitness: | ||
86 | orig_tune_bitness = '32' | ||
87 | |||
88 | src = '../../../' + orig_tune_baselib + '/' + \ | ||
89 | d.getVar('TARGET_SYS_MULTILIB_ORIGINAL') + '/' + binv + '/' | ||
90 | |||
91 | dest = d.getVar('D') + d.getVar('libdir') + '/' + \ | ||
92 | d.getVar('TARGET_SYS') + '/' + binv + '/' + orig_tune_bitness | ||
93 | |||
94 | if os.path.lexists(dest): | ||
95 | os.unlink(dest) | ||
96 | os.symlink(src, dest) | ||
97 | return | ||
98 | |||
99 | |||
100 | for ml in multilibs.split(): | ||
101 | tune = d.getVar('DEFAULTTUNE:virtclass-multilib-' + ml) | ||
102 | if not tune: | ||
103 | bb.warn('DEFAULTTUNE:virtclass-multilib-%s is not defined. Skipping...' % ml) | ||
104 | continue | ||
105 | |||
106 | tune_parameters = get_tune_parameters(tune, d) | ||
107 | tune_baselib = tune_parameters['baselib'] | ||
108 | if not tune_baselib: | ||
109 | bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune) | ||
110 | continue | ||
111 | |||
112 | tune_arch = tune_parameters['arch'] | ||
113 | tune_bitness = tune_baselib.replace('lib', '') | ||
114 | if not tune_bitness: | ||
115 | tune_bitness = '32' # /lib => 32bit lib | ||
116 | |||
117 | tune_abiextension = tune_parameters['abiextension'] | ||
118 | if tune_abiextension: | ||
119 | libcextension = '-gnu' + tune_abiextension | ||
120 | else: | ||
121 | libcextension = '' | ||
122 | |||
123 | src = '../../../' + tune_baselib + '/' + \ | ||
124 | tune_arch + d.getVar('TARGET_VENDOR') + 'ml' + ml + \ | ||
125 | '-' + d.getVar('TARGET_OS') + libcextension + '/' + binv + '/' | ||
126 | |||
127 | dest = d.getVar('D') + d.getVar('libdir') + '/' + \ | ||
128 | d.getVar('TARGET_SYS') + '/' + binv + '/' + tune_bitness | ||
129 | |||
130 | if os.path.lexists(dest): | ||
131 | os.unlink(dest) | ||
132 | os.symlink(src, dest) | ||
133 | } | ||
134 | |||
135 | def get_original_os(d): | ||
136 | vendoros = d.expand('${TARGET_ARCH}${ORIG_TARGET_VENDOR}-${TARGET_OS}') | ||
137 | for suffix in [d.getVar('ABIEXTENSION'), d.getVar('LIBCEXTENSION')]: | ||
138 | if suffix and vendoros.endswith(suffix): | ||
139 | vendoros = vendoros[:-len(suffix)] | ||
140 | # Arm must use linux-gnueabi not linux as only the former is accepted by gcc | ||
141 | if vendoros.startswith("arm-") and not vendoros.endswith("-gnueabi"): | ||
142 | vendoros = vendoros + "-gnueabi" | ||
143 | return vendoros | ||
144 | |||
145 | ORIG_TARGET_VENDOR := "${TARGET_VENDOR}" | ||
146 | BASETARGET_SYS = "${@get_original_os(d)}" | ||
147 | |||
148 | addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot | ||
149 | fakeroot python do_extra_symlinks() { | ||
150 | if bb.data.inherits_class('nativesdk', d): | ||
151 | return | ||
152 | |||
153 | targetsys = d.getVar('BASETARGET_SYS') | ||
154 | |||
155 | if targetsys != d.getVar('TARGET_SYS'): | ||
156 | dest = d.getVar('D') + d.getVar('libdir') + '/' + targetsys | ||
157 | src = d.getVar('TARGET_SYS') | ||
158 | if not os.path.lexists(dest) and os.path.lexists(d.getVar('D') + d.getVar('libdir')): | ||
159 | os.symlink(src, dest) | ||
160 | } | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgcc-initial.inc b/meta-microblaze/recipes-devtools/gcc/libgcc-initial.inc deleted file mode 100644 index 8251e3c2..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgcc-initial.inc +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | # | ||
2 | # Notes on the way the OE cross toolchain now works | ||
3 | # | ||
4 | # We need a libgcc to build glibc. Tranditionally we therefore built | ||
5 | # a non-threaded and non-shared compiler (gcc-cross-initial), then use | ||
6 | # that to build libgcc-initial which is used to build glibc which we can | ||
7 | # then build gcc-cross and libgcc against. | ||
8 | # | ||
9 | # We were able to drop the glibc dependency from gcc-cross, with two tweaks: | ||
10 | |||
11 | # a) specify the minimum glibc version to support in a configure option | ||
12 | # b) create a dummy limits.h file so that later when glibc creates one, | ||
13 | # the headers structure has support for it. We can do this with a simple | ||
14 | # empty file | ||
15 | # | ||
16 | # Once gcc-cross is libc independent, we can use it to build both | ||
17 | # libgcc-initial and then later libgcc. | ||
18 | # | ||
19 | # libgcc-initial is tricky as we need to imitate the non-threaded and | ||
20 | # non-shared case. We can do that by hacking the threading mode back to | ||
21 | # "single" even if gcc reports "posix" and disable libc presence for the | ||
22 | # libgcc-intial build. We have to create the dummy limits.h to avoid | ||
23 | # compiler errors from a missing header. | ||
24 | # | ||
25 | # glibc will fail to link with libgcc-initial due to a missing "exception | ||
26 | # handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need | ||
27 | # any exception handler, we can safely symlink to libgcc.a. | ||
28 | # | ||
29 | |||
30 | require libgcc-common.inc | ||
31 | |||
32 | DEPENDS = "virtual/${TARGET_PREFIX}gcc" | ||
33 | |||
34 | LICENSE = "GPL-3.0-with-GCC-exception" | ||
35 | |||
36 | PACKAGES = "" | ||
37 | |||
38 | EXTRA_OECONF += "--disable-shared" | ||
39 | |||
40 | inherit nopackages | ||
41 | |||
42 | # We really only want this built by things that need it, not any recrdeptask | ||
43 | deltask do_build | ||
44 | |||
45 | do_configure:prepend () { | ||
46 | install -d ${STAGING_INCDIR} | ||
47 | touch ${STAGING_INCDIR}/limits.h | ||
48 | sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars | ||
49 | sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile | ||
50 | } | ||
51 | |||
52 | do_configure:append () { | ||
53 | sed -i -e 's#thread_header = .*#thread_header = gthr-single.h#' ${B}/${BPN}/Makefile | ||
54 | } | ||
55 | |||
56 | do_install:append () { | ||
57 | ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a | ||
58 | } | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgcc-initial_10.2.bb b/meta-microblaze/recipes-devtools/gcc/libgcc-initial_10.2.bb deleted file mode 100644 index a259082b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgcc-initial_10.2.bb +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require libgcc-initial.inc | ||
3 | |||
4 | # Building with thumb enabled on armv6t fails | ||
5 | ARM_INSTRUCTION_SET:armv6 = "arm" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgcc.inc b/meta-microblaze/recipes-devtools/gcc/libgcc.inc deleted file mode 100644 index 84a2d930..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgcc.inc +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | require libgcc-common.inc | ||
2 | |||
3 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/${MLPREFIX}libc" | ||
4 | |||
5 | do_install:append:class-target () { | ||
6 | if [ "${TCLIBC}" != "glibc" ]; then | ||
7 | case "${TARGET_OS}" in | ||
8 | "linux-musl" | "linux-*spe") extra_target_os="linux";; | ||
9 | "linux-musleabi") extra_target_os="linux-gnueabi";; | ||
10 | *) extra_target_os="linux";; | ||
11 | esac | ||
12 | if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then | ||
13 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
14 | fi | ||
15 | fi | ||
16 | if [ -n "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" ]; then | ||
17 | case "${TARGET_OS}" in | ||
18 | "linux-musleabi") extra_target_os="linux-musleabihf";; | ||
19 | "linux-gnueabi") extra_target_os="linux-gnueabihf";; | ||
20 | esac | ||
21 | if [ ! -e ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os ]; then | ||
22 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
23 | fi | ||
24 | fi | ||
25 | } | ||
26 | |||
27 | PACKAGES = "\ | ||
28 | ${PN} \ | ||
29 | ${PN}-dev \ | ||
30 | ${PN}-dbg \ | ||
31 | " | ||
32 | |||
33 | # All libgcc source is marked with the exception. | ||
34 | # | ||
35 | LICENSE:${PN} = "GPL-3.0-with-GCC-exception" | ||
36 | LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception" | ||
37 | LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception" | ||
38 | |||
39 | |||
40 | FILES:${PN}-dev = "\ | ||
41 | ${base_libdir}/libgcc*.so \ | ||
42 | ${@oe.utils.conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \ | ||
43 | ${libdir}/${TARGET_SYS}/${BINV}* \ | ||
44 | ${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \ | ||
45 | " | ||
46 | |||
47 | do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
48 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
49 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
50 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
51 | |||
52 | INSANE_SKIP:${PN}-dev = "staticdev" | ||
53 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgcc_10.2.bb b/meta-microblaze/recipes-devtools/gcc/libgcc_10.2.bb deleted file mode 100644 index f88963b0..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgcc_10.2.bb +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require libgcc.inc | ||
3 | |||
4 | # Building with thumb enabled on armv6t fails | ||
5 | ARM_INSTRUCTION_SET:armv6 = "arm" | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgfortran.inc b/meta-microblaze/recipes-devtools/gcc/libgfortran.inc deleted file mode 100644 index 344ec5e2..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgfortran.inc +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | EXTRA_OECONF_PATHS = "\ | ||
4 | --with-sysroot=/not/exist \ | ||
5 | --with-build-sysroot=${STAGING_DIR_TARGET} \ | ||
6 | " | ||
7 | |||
8 | do_configure () { | ||
9 | for target in libbacktrace libgfortran | ||
10 | do | ||
11 | rm -rf ${B}/${TARGET_SYS}/$target/ | ||
12 | mkdir -p ${B}/${TARGET_SYS}/$target/ | ||
13 | cd ${B}/${TARGET_SYS}/$target/ | ||
14 | chmod a+x ${S}/$target/configure | ||
15 | relpath=${@os.path.relpath("${S}", "${B}/${TARGET_SYS}")} | ||
16 | ../$relpath/$target/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
17 | # Easiest way to stop bad RPATHs getting into the library since we have a | ||
18 | # broken libtool here | ||
19 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/$target/libtool | ||
20 | done | ||
21 | } | ||
22 | EXTRACONFFUNCS += "extract_stashed_builddir" | ||
23 | do_configure[depends] += "${COMPILERDEP}" | ||
24 | |||
25 | do_compile () { | ||
26 | for target in libbacktrace libgfortran | ||
27 | do | ||
28 | cd ${B}/${TARGET_SYS}/$target/ | ||
29 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$target/ | ||
30 | done | ||
31 | } | ||
32 | |||
33 | do_install () { | ||
34 | cd ${B}/${TARGET_SYS}/libgfortran/ | ||
35 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install | ||
36 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then | ||
37 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
38 | fi | ||
39 | if [ -d ${D}${infodir} ]; then | ||
40 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} | ||
41 | fi | ||
42 | chown -R root:root ${D} | ||
43 | } | ||
44 | |||
45 | INHIBIT_DEFAULT_DEPS = "1" | ||
46 | DEPENDS = "gcc-runtime gcc-cross-${TARGET_ARCH}" | ||
47 | |||
48 | BBCLASSEXTEND = "nativesdk" | ||
49 | |||
50 | PACKAGES = "\ | ||
51 | ${PN}-dbg \ | ||
52 | libgfortran \ | ||
53 | libgfortran-dev \ | ||
54 | libgfortran-staticdev \ | ||
55 | " | ||
56 | |||
57 | LICENSE:${PN} = "GPL-3.0-with-GCC-exception" | ||
58 | LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception" | ||
59 | LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception" | ||
60 | |||
61 | FILES:${PN} = "${libdir}/libgfortran.so.*" | ||
62 | FILES:${PN}-dev = "\ | ||
63 | ${libdir}/libgfortran*.so \ | ||
64 | ${libdir}/libgfortran.spec \ | ||
65 | ${libdir}/libgfortran.la \ | ||
66 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \ | ||
67 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \ | ||
68 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude/ \ | ||
69 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ \ | ||
70 | " | ||
71 | FILES:${PN}-staticdev = "${libdir}/libgfortran.a" | ||
72 | |||
73 | INSANE_SKIP:${MLPREFIX}libgfortran-dev = "staticdev" | ||
74 | |||
75 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
76 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
77 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
78 | |||
79 | python __anonymous () { | ||
80 | f = d.getVar("FORTRAN") | ||
81 | if "fortran" not in f: | ||
82 | raise bb.parse.SkipRecipe("libgfortran needs fortran support to be enabled in the compiler") | ||
83 | } | ||
diff --git a/meta-microblaze/recipes-devtools/gcc/libgfortran_10.2.bb b/meta-microblaze/recipes-devtools/gcc/libgfortran_10.2.bb deleted file mode 100644 index 71dd8b4b..00000000 --- a/meta-microblaze/recipes-devtools/gcc/libgfortran_10.2.bb +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | require recipes-devtools/gcc/gcc-${PV}.inc | ||
2 | require libgfortran.inc | ||
3 | |||