Skip to contentSkip to conversation

arm-bsp, gem5-arm64: Update to v20 version

PATCH Applied Diego Sueiro 3 participants 5 messages Jun 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 .../gem5/gem5-aarch64-bootloader.inc               |  8 +-
 ...loader_git.bb => gem5-aarch64-bootloader_20.bb} | 10 +--
 ...SHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch | 85 ++++++++++++++++++++++
 ...h64-native_git.bb => gem5-aarch64-native_20.bb} | 18 +++--
 meta-arm-bsp/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%)
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +5 -3
index 4c479f5..7e753b2 100644
@@ -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
 }
 
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +4 -6
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 a3ab5aa..d960e6c 100644
@@ -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
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch new file +85 -0

85 lines not on this page · raw message

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +12 -6
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 d36f24f..638baf3 100644
@@ -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
meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +0 -6
index 429e18c..1df94d0 100644
@@ -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
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Diego Sueiro via lists.yoctoproject.org

This patch updates gem5-aarch64-bootloader and gem5-aarch64-native to the release tag v20.0.0.1.

Quoted 6 lines

Also apply populate the right compiler and linker flags to get gem5-aarch64-native properly building

Change-Id: Icc2203163105373cf030975c1b12f1d4f2fcb03c
Issue-Id: SCM-1014

Quoted 224 lines

---

.../gem5/gem5-aarch64-bootloader.inc               |  8 +-
...loader_git.bb => gem5-aarch64-bootloader_20.bb} | 10 +--
...SHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch | 85 ++++++++++++++++++++++
...h64-native_git.bb => gem5-aarch64-native_20.bb} | 18 +++--
meta-arm-bsp/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%)

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +0 -0
index 4c479f5..7e753b2 100644
@@ -5,10 +5,12 @@ LICENSE = "BSD"
 

inherit deploy

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-PROVIDES = "virtual/gem5-bootloader"
+PROVIDES += "virtual/gem5-bootloader"

COMPATIBLE_MACHINE = "gem5-arm64"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +2 -0
+BOOTLOADER_SRC_PATH ?= "${S}/system/arm/bootloader/arm64"
+
# no configure step
do_configure[noexec] = "1"
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +0 -0
@@ -16,11 +18,11 @@ do_configure[noexec] = "1"

do_install[noexec] = "1"

do_compile() {

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-    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() {

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-    oe_runmake -C system/arm/aarch64_bootloader install \
+    oe_runmake -C ${BOOTLOADER_SRC_PATH} install \
        CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${DEPLOYDIR}/binaries

}

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +4 -4
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 a3ab5aa..d960e6c 100644
@@ -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"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +0 -2
-SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01"
-

BPN = "gem5-aarch64-bootloader"

require gem5-aarch64-bootloader.inc

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch new file +85 -0
new file mode 100644
index 0000000..4303a40
@@ -0,0 +1,85 @@
+From 1303d0497bad151f9389ee30c37dc5f9fe325f6e Mon Sep 17 00:00:00 2001
+From: Giacomo Travaglini <[email protected]>
+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 <[email protected]>
+---
+
+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')
+ 
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +5 -4
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 d36f24f..638baf3 100644
@@ -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"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +0 -2
-SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01"
-

BPN = "gem5-aarch64-native"

require gem5-aarch64-native.inc
require gem5-native.inc

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +7 -0
+# 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

meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +0 -0
index 429e18c..1df94d0 100644
@@ -30,12 +30,6 @@ DEPENDS += "python3-six-native protobuf-native hdf5-native pkgconfig-native \
 

EXTRA_OESCONS = "${GEM5_SCONS_ARGS}"

meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +0 -6
-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
Signature · 1 line
2.7.4
Applied
#2 lore raw
Quoted 7 lines · Bertrand Marquis
Quoted 7 lines · Diego Sueiro via lists.yoctoproject.org

This patch updates gem5-aarch64-bootloader and gem5-aarch64-native to the release tag v20.0.0.1.

Quoted 7 lines
Quoted 6 lines

Also apply populate the right compiler and linker flags to get gem5-aarch64-native properly building

Change-Id: Icc2203163105373cf030975c1b12f1d4f2fcb03c
Issue-Id: SCM-1014

Applied to the master branch

Thanks,
Jon

Quoted 228 lines
Quoted 225 lines

---

.../gem5/gem5-aarch64-bootloader.inc               |  8 +-
...loader_git.bb => gem5-aarch64-bootloader_20.bb} | 10 +--
...SHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch | 85 ++++++++++++++++++++++
...h64-native_git.bb => gem5-aarch64-native_20.bb} | 18 +++--
meta-arm-bsp/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%)

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +0 -0
index 4c479f5..7e753b2 100644
@@ -5,10 +5,12 @@ LICENSE = "BSD"
 

inherit deploy

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-PROVIDES = "virtual/gem5-bootloader"
+PROVIDES += "virtual/gem5-bootloader"

COMPATIBLE_MACHINE = "gem5-arm64"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +2 -0
+BOOTLOADER_SRC_PATH ?= "${S}/system/arm/bootloader/arm64"
+
# no configure step
do_configure[noexec] = "1"
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +0 -0
@@ -16,11 +18,11 @@ do_configure[noexec] = "1"

do_install[noexec] = "1"

do_compile() {

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-    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() {

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader.inc +1 -1
-    oe_runmake -C system/arm/aarch64_bootloader install \
+    oe_runmake -C ${BOOTLOADER_SRC_PATH} install \
        CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${DEPLOYDIR}/binaries

}

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +4 -4
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 a3ab5aa..d960e6c 100644
@@ -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"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-bootloader_git.bb +0 -2
-SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01"
-

BPN = "gem5-aarch64-bootloader"

require gem5-aarch64-bootloader.inc

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch new file +85 -0
new file mode 100644
index 0000000..4303a40
@@ -0,0 +1,85 @@
+From 1303d0497bad151f9389ee30c37dc5f9fe325f6e Mon Sep 17 00:00:00 2001
+From: Giacomo Travaglini <[email protected]>
+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 <[email protected]>
+---
+
+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')
+ 
meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +5 -4
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 d36f24f..638baf3 100644
@@ -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"

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +0 -2
-SRCREV = "0bc5d77ed27e0765953d93c2376a4b4aea675a01"
-

BPN = "gem5-aarch64-native"

require gem5-aarch64-native.inc
require gem5-native.inc

meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_20.bb renamed from meta-arm-bsp/recipes-devtools/gem5/gem5-aarch64-native_git.bb +7 -0
+# 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

meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +0 -0
index 429e18c..1df94d0 100644
@@ -30,12 +30,6 @@ DEPENDS += "python3-six-native protobuf-native hdf5-native pkgconfig-native \
 

EXTRA_OESCONS = "${GEM5_SCONS_ARGS}"

meta-arm-bsp/recipes-devtools/gem5/gem5-native.inc +0 -6
-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
Signature · 1 line
2.7.4
#3 lore raw
Quoted 13 lines · Jon Mason
Quoted 3 lines · Bertrand Marquis
Quoted 3 lines

On 11 Jun 2020, at 08:52, Diego Sueiro via lists.yoctoproject.org

Quoted 7 lines · <[email protected]> wrote:
Quoted 7 lines

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

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Change-Id: Icc2203163105373cf030975c1b12f1d4f2fcb03c
Issue-Id: SCM-1014

Applied to the master branch

Can you please apply to dunfell as well?

#4 lore raw
Quoted 15 lines · Diego Sueiro
Quoted 13 lines · Jon Mason
Quoted 3 lines · Bertrand Marquis
Quoted 3 lines

On 11 Jun 2020, at 08:52, Diego Sueiro via lists.yoctoproject.org

Quoted 7 lines · <[email protected]> wrote:
Quoted 7 lines

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

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Change-Id: Icc2203163105373cf030975c1b12f1d4f2fcb03c
Issue-Id: SCM-1014

Applied to the master branch

Can you please apply to dunfell as well?

Done

Quoted 1 line