From d4dbb2ccb01449259f62dbcff8a60533de46483b Mon Sep 17 00:00:00 2001 From: Diego Sueiro Date: Thu, 11 Jun 2020 08:52:16 +0100 Subject: [PATCH] arm-bsp, gem5-arm64: Update to v20 version This patch updates gem5-aarch64-bootloader and gem5-aarch64-native to the release tag v20.0.0.1. Also apply populate the right compiler and linker flags to get gem5-aarch64-native properly building Change-Id: Icc2203163105373cf030975c1b12f1d4f2fcb03c Issue-Id: SCM-1014 Signed-off-by: Diego Sueiro Reviewed-by: Bertrand Marquis Signed-off-by: Jon Mason --- .../gem5/gem5-aarch64-bootloader.inc | 8 +- ...r_git.bb => gem5-aarch64-bootloader_20.bb} | 10 +-- ...XXFLAGS_EXTRA-for-the-marshal-object.patch | 85 +++++++++++++++++++ ...ative_git.bb => gem5-aarch64-native_20.bb} | 18 ++-- .../recipes-devtools/gem5/gem5-native.inc | 6 -- 5 files changed, 106 insertions(+), 21 deletions(-) rename meta-arm-bsp/recipes-devtools/gem5/{gem5-aarch64-bootloader_git.bb => gem5-aarch64-bootloader_20.bb} (60%) create mode 100644 meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch rename meta-arm-bsp/recipes-devtools/gem5/{gem5-aarch64-native_git.bb => gem5-aarch64-native_20.bb} (53%) diff --git a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc index 4c479f5d..7e753b2c 100644 --- a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +++ b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc @@ -5,10 +5,12 @@ LICENSE = "BSD" inherit deploy -PROVIDES = "virtual/gem5-bootloader" +PROVIDES += "virtual/gem5-bootloader" COMPATIBLE_MACHINE = "gem5-arm64" +BOOTLOADER_SRC_PATH ?= "${S}/system/arm/bootloader/arm64" + # no configure step do_configure[noexec] = "1" @@ -16,11 +18,11 @@ do_configure[noexec] = "1" do_install[noexec] = "1" do_compile() { - oe_runmake -C system/arm/aarch64_bootloader all CROSS_COMPILE=${TARGET_PREFIX} + oe_runmake -C ${BOOTLOADER_SRC_PATH} all CROSS_COMPILE=${TARGET_PREFIX} } do_deploy() { - oe_runmake -C system/arm/aarch64_bootloader install \ + oe_runmake -C ${BOOTLOADER_SRC_PATH} install \ CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${DEPLOYDIR}/binaries } diff --git a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb similarity index 60% rename from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb rename to meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb index a3ab5aa7..d960e6cd 100644 --- a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +++ b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb @@ -3,16 +3,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \ file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec" -# The recipe is currently using a version in the release staging branch of gem5 -# until version 20 is released -SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;branch=release-staging-v20.0.0.0" +SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1" +RELEASE_TAG = "v20.0.0.1" +SRCREV = "332a9de33db603e0aefedae1e05134db4257ea3e" -PV = "git${SRCPV}" +PV = "${RELEASE_TAG}" S = "${WORKDIR}/git" -SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01" - BPN = "gem5-aarch64-bootloader" require gem5-aarch64-bootloader.inc diff --git a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch new file mode 100644 index 00000000..4303a402 --- /dev/null +++ b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch @@ -0,0 +1,85 @@ +From 1303d0497bad151f9389ee30c37dc5f9fe325f6e Mon Sep 17 00:00:00 2001 +From: Giacomo Travaglini +Date: Thu, 04 Jun 2020 12:45:52 +0100 +Subject: [PATCH] scons: Add MARSHAL_XXFLAGS_EXTRA for the marshal object + +We already provide to the user the CCFLAGS_EXTRA, LDFLAGS_EXTRA +variables to pass flags to scons when compiling/linking gem5. +Those variables are not passed to the marshal object. +We add an extra pair: + +MARSHAL_CCFLAGS_EXTRA, MARSHAL_LDFLAGS_EXTRA + +to add flag injection capabilities to the marshal object. + +The patch is also renaming base_py_env to marshal_env. +This happens for 2 reasons: + +1) At the moment the marshal compilation is the only task +making use of the base python environment. + +2) Consistency with the EXTRA variable names added with this patch. +I could have named them as BASE_XXFLAGS_EXTRA, but it seems too much +generic and users might be confused by that, as they might think +the BASE_XXFLAGS_EXTRA is a subset of the XXFLAGS_EXTRA so that +setting it will affect gem5 compilation as well. + +Change-Id: I3e420caa897059455ff8f35462db2b38da050e93 +Signed-off-by: Giacomo Travaglini +--- + +diff --git a/SConstruct b/SConstruct +index 3a03af4..5a66bba 100755 +--- a/SConstruct ++++ b/SConstruct +@@ -276,6 +276,8 @@ + ('CXX', 'C++ compiler', environ.get('CXX', main['CXX'])), + ('CCFLAGS_EXTRA', 'Extra C and C++ compiler flags', ''), + ('LDFLAGS_EXTRA', 'Extra linker flags', ''), ++ ('MARSHAL_CCFLAGS_EXTRA', 'Extra C and C++ marshal compiler flags', ''), ++ ('MARSHAL_LDFLAGS_EXTRA', 'Extra marshal linker flags', ''), + ('PYTHON_CONFIG', 'Python config binary to use', + [ 'python2.7-config', 'python-config', 'python3-config' ]), + ('PROTOC', 'protoc tool', environ.get('PROTOC', 'protoc')), +@@ -734,7 +736,9 @@ + + main.Prepend(CPPPATH=Dir('ext/pybind11/include/')) + # Bare minimum environment that only includes python +-base_py_env = main.Clone() ++marshal_env = main.Clone() ++marshal_env.Append(CCFLAGS='$MARSHAL_CCFLAGS_EXTRA') ++marshal_env.Append(LINKFLAGS='$MARSHAL_LDFLAGS_EXTRA') + + # On Solaris you need to use libsocket for socket ops + if not conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'): +@@ -1285,7 +1289,7 @@ + # to the configured variables. It returns a list of environments, + # one for each variant build (debug, opt, etc.) + SConscript('src/SConscript', variant_dir=variant_path, +- exports=['env', 'base_py_env']) ++ exports=['env', 'marshal_env']) + + # base help text + Help(''' +diff --git a/src/SConscript b/src/SConscript +index 7cd628a..aa233c8 100644 +--- a/src/SConscript ++++ b/src/SConscript +@@ -1140,7 +1140,7 @@ + # Build a small helper that marshals the Python code using the same + # version of Python as gem5. This is in an unorthodox location to + # avoid building it for every variant. +-py_marshal = base_py_env.Program('marshal', 'python/marshal.cc')[0] ++py_marshal = marshal_env.Program('marshal', 'python/marshal.cc')[0] + + # Embed python files. All .py files that have been indicated by a + # PySource() call in a SConscript need to be embedded into the M5 +@@ -1196,7 +1196,7 @@ + code.write(str(target[0])) + + for source in PySource.all: +- base_py_env.Command(source.cpp, [ py_marshal, source.tnode ], ++ marshal_env.Command(source.cpp, [ py_marshal, source.tnode ], + MakeAction(embedPyFile, Transform("EMBED PY"))) + Source(source.cpp, tags=source.tags, add_tags='python') + diff --git a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb similarity index 53% rename from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb rename to meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb index d36f24fe..638baf31 100644 --- a/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +++ b/meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb @@ -3,21 +3,27 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \ file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec" -# The recipe is currently using a version in the release staging branch of gem5 -# until version 20 is released -SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;branch=release-staging-v20.0.0.0" +SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1 \ + file://0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch" +RELEASE_TAG = "v20.0.0.1" +SRCREV = "332a9de33db603e0aefedae1e05134db4257ea3e" -PV = "git${SRCPV}" +PV = "${RELEASE_TAG}" S = "${WORKDIR}/git" -SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01" - BPN = "gem5-aarch64-native" require gem5-aarch64-native.inc require gem5-native.inc +# Get rid of compiler errors when building protobuf +GEM5_SCONS_ARGS_append = " CCFLAGS_EXTRA='-Wno-error=unused-variable' --verbose" + +# Get rid of linker errors and have a faster link process +GEM5_SCONS_ARGS_append = " LDFLAGS_EXTRA='${BUILD_LDFLAGS}' \ +MARSHAL_LDFLAGS_EXTRA='${BUILD_LDFLAGS}' --force-lto " + do_compile_prepend() { # Gem5 expect to have python in the path (can be python2 or 3) # Create a link named python to python3 diff --git a/meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc b/meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc index 429e18ce..1df94d04 100644 --- a/meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +++ b/meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc @@ -30,12 +30,6 @@ DEPENDS += "python3-six-native protobuf-native hdf5-native pkgconfig-native \ EXTRA_OESCONS = "${GEM5_SCONS_ARGS}" -do_compile_prepend() { - # We need to use the proper native libraries when executing - # compiled applications - export LD_LIBRARY_PATH="${STAGING_LIBDIR_NATIVE}" -} - do_install() { install -d ${D}${datadir}/gem5