Skip to content

Commit

Permalink
layer.conf: Move from scarthgap to styhead walnascar, bring in old re…
Browse files Browse the repository at this point in the history
…cipes for parse

binutils-2.42 and gstreamer-1.22.12 were pulled in from the latest poky
scarthgap, as of commit dce4163d42f7036ea216b52b9135968d51bec4c1.

Signed-off-by: Mark Hatle <[email protected]>
  • Loading branch information
mhatle committed Nov 24, 2024
1 parent ab07add commit fcc7bcc
Show file tree
Hide file tree
Showing 67 changed files with 37,549 additions and 13 deletions.
7 changes: 5 additions & 2 deletions meta-microblaze/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BBFILE_PRIORITY_xilinx-microblaze = "5"

LAYERDEPENDS_xilinx-microblaze = "core"

LAYERSERIES_COMPAT_xilinx-microblaze = "scarthgap"
LAYERSERIES_COMPAT_xilinx-microblaze = "styhead walnascar"

# Microblaze does not support stack-protector!
SECURITY_STACK_PROTECTOR:microblaze = ""
Expand All @@ -20,7 +20,10 @@ OLDEST_KERNEL:microblaze = "3.15"

INHERIT += "rust_microblaze"

# We want to use gcc 12.x for the microblaze stuff, and 14.x for any host tooling
# We want to use binutils 2.42 for the microblaze stuff
BINUVERSION:microblaze = "2.42%"

# We want to use gcc 13.x for the microblaze stuff, and 14.x for any host tooling
GCCVERSION:microblaze = "13.3.%"
SDKGCCVERSION:microblaze = "14.%"

Expand Down
40 changes: 40 additions & 0 deletions meta-microblaze/recipes-devtools/binutils/binutils-2.42.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
LIC_FILES_CHKSUM="\
file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
"

# When upgrading to 2.42, please make sure there is no trailing .0, so
# that upstream version check can work correctly.
PV = "2.42"
CVE_VERSION = "2.42"
SRCBRANCH ?= "binutils-2_42-branch"

UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"

CVE_STATUS[CVE-2023-25584] = "cpe-incorrect: Applies only for version 2.40 and earlier"

SRCREV ?= "8a6764d35e5c15d78de8aef8f27af3eefd9d7544"
BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=https"
SRC_URI = "\
${BINUTILS_GIT_URI} \
file://0004-Point-scripts-location-to-libdir.patch \
file://0005-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
file://0006-warn-for-uses-of-system-directories-when-cross-linki.patch \
file://0007-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
file://0008-Use-libtool-2.4.patch \
file://0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
file://0010-sync-with-OE-libtool-changes.patch \
file://0011-Check-for-clang-before-checking-gcc-version.patch \
file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
file://0013-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
file://0014-Remove-duplicate-pe-dll.o-entry-deom-targ_extra_ofil.patch \
file://0015-gprofng-change-use-of-bignum-to-bigint.patch \
"
S = "${WORKDIR}/git"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
inherit cross-canadian

SUMMARY = "GNU binary utilities (cross-canadian for ${TARGET_ARCH} target)"
PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
BPN = "binutils"

DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc virtual/nativesdk-libc nativesdk-zlib nativesdk-gettext nativesdk-flex"
EXTRA_OECONF += "--with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
--enable-poison-system-directories \
"

# We have to point binutils at a sysroot but we don't need to rebuild if this changes
# e.g. we switch between different machines with different tunes.
EXTRA_OECONF[vardepsexclude] = "TUNE_PKGARCH"

do_install () {
autotools_do_install

# We're not interested in the libs or headers, these would come from the
# nativesdk or target version of the binutils recipe
rm -rf ${D}${prefix}/${TARGET_SYS}
rm -f ${D}${libdir}/libbfd*
rm -f ${D}${libdir}/libiberty*
rm -f ${D}${libdir}/libopcodes*
rm -f ${D}${includedir}/*.h
rm -f ${D}${sysconfdir}/gprofng.rc
rmdir ${D}${sysconfdir} || :

cross_canadian_bindirlinks
}

BBCLASSEXTEND = ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require binutils.inc
require binutils-${PV}.inc
require binutils-cross-canadian.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
require binutils.inc
require binutils-${PV}.inc

BPN = "binutils"

DEPENDS += "dejagnu-native expect-native"
DEPENDS += "binutils-native"

deltask do_compile
deltask do_install

inherit nopackages

do_configure[dirs] += "${B}/ld ${B}/bfd"
do_configure() {
# create config.h, oe enables initfini-array by default
echo "#define HAVE_INITFINI_ARRAY" > ${B}/ld/config.h
}

# target depends
DEPENDS += "virtual/${TARGET_PREFIX}binutils"
DEPENDS += "virtual/${TARGET_PREFIX}gcc"
DEPENDS += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs"
DEPENDS += "virtual/${MLPREFIX}libc"

python check_prepare() {
def suffix_sys(sys):
if sys.endswith("-linux"):
return sys + "-gnu"
return sys

def generate_site_exp(d, suite):
content = []
content.append('set srcdir "{0}/{1}"'.format(d.getVar("S"), suite))
content.append('set objdir "{0}/{1}"'.format(d.getVar("B"), suite))
content.append('set build_alias "{0}"'.format(d.getVar("BUILD_SYS")))
content.append('set build_triplet {0}'.format(d.getVar("BUILD_SYS")))
# use BUILD here since HOST=TARGET
content.append('set host_alias "{0}"'.format(d.getVar("BUILD_SYS")))
content.append('set host_triplet {0}'.format(d.getVar("BUILD_SYS")))
content.append('set target_alias "{0}"'.format(d.getVar("TARGET_SYS")))
content.append('set target_triplet {0}'.format(suffix_sys(d.getVar("TARGET_SYS"))))
content.append("set development true")
content.append("set experimental false")

content.append(d.expand('set CXXFILT "${TARGET_PREFIX}c++filt"'))
content.append(d.expand('set CC "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
content.append(d.expand('set CXX "${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
content.append(d.expand('set CFLAGS_FOR_TARGET "--sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}"'))
content.append(d.expand('set LD "${TARGET_PREFIX}ld ${TUNE_LDARGS}"'))
content.append(d.expand('set LDFLAGS_FOR_TARGET "${TUNE_LDARGS}"'))

if suite == "ld" and d.getVar("TUNE_ARCH") == "mips64":
# oe patches binutils to have the default mips64 abi as 64bit, but
# skips gas causing issues with the ld test suite (which uses gas)
content.append('set ASFLAGS "-64"')

return "\n".join(content)

for i in ["binutils", "gas", "ld"]:
builddir = os.path.join(d.getVar("B"), i)
if not os.path.isdir(builddir):
os.makedirs(builddir)
with open(os.path.join(builddir, "site.exp"), "w") as f:
f.write(generate_site_exp(d, i))
}

CHECK_TARGETS ??= "binutils gas ld"

do_check[dirs] = "${B} ${B}/binutils ${B}/gas ${B}/ld"
do_check[prefuncs] += "check_prepare"
do_check[nostamp] = "1"
do_check() {
export LC_ALL=C
for i in ${CHECK_TARGETS}; do
(cd ${B}/$i; runtest \
--tool $i \
--srcdir ${S}/$i/testsuite \
--ignore 'plugin.exp' \
|| true)
done
}
addtask check after do_configure
39 changes: 39 additions & 0 deletions meta-microblaze/recipes-devtools/binutils/binutils-cross.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
inherit cross
PROVIDES = "virtual/${TARGET_PREFIX}binutils"

PN = "binutils-cross-${TARGET_ARCH}"
BPN = "binutils"

# Ignore how TARGET_ARCH is computed.
TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"

INHIBIT_DEFAULT_DEPS = "1"
INHIBIT_AUTOTOOLS_DEPS = "1"

SRC_URI += "file://0002-binutils-cross-Do-not-generate-linker-script-directo.patch"

# Specify lib-path else we use a load of search dirs which we don't use
# and mean the linker scripts have to be relocated.
EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
--disable-install-libbfd \
--disable-gprofng \
--enable-poison-system-directories \
--with-lib-path==${target_base_libdir}:=${target_libdir} \
"
do_install () {
oe_runmake 'DESTDIR=${D}' install

# We don't really need these, so we'll remove them...
rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require binutils.inc
require binutils-${PV}.inc
require binutils-cross.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require binutils-cross_${PV}.bb

inherit crosssdk

PN = "binutils-crosssdk-${SDK_SYS}"

SRC_URI += "file://0001-binutils-crosssdk-Generate-relocatable-SDKs.patch"

do_configure:prepend () {
sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
}
Loading

0 comments on commit fcc7bcc

Please sign in to comment.