Skip to contentSkip to conversation

gem5/gem5-aarch64-native: don't build gem5 three times

PATCH In review Jon Mason 2 participants 7 messages Feb 4, 2021 – Feb 5, 2021

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/6 gem5/gem5-aarch64-native: don't build gem5 three times

From: Ross Burton <[email protected]>

The recipe currently builds gem5 binaries in optimised, fast, and debug mode. There is no need to build three at once (and triples the build time), so simply build the optimised variant by default (as recommended by upstream) whilst letting the variant be altered by setting GEM5_BUILD_VARIANT.

Change-Id I23baeee438d1ff08d1e2a54282141b55500f2ac1
---
 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc | 5 ++---
 meta-gem5/recipes-devtools/gem5/gem5-native.inc         | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)
meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc +2 -3
index 898fa23..0a8e34c 100644
@@ -1,8 +1,7 @@
 # gem5 aarch64 specific configuration
 
 # Build arm64 gem5
-GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.opt build/ARM/gem5.fast \
-    build/ARM/gem5.debug"
+GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.${GEM5_BUILD_VARIANT}"
 
 SRC_URI += "file://start-gem5.sh"
 
@@ -10,7 +9,7 @@ inherit deploy
 
 # Parameters for the start script
 
-GEM5_RUN_CONFIG ?= "gem5.fast"
+GEM5_RUN_CONFIG ?= "gem5.${GEM5_BUILD_VARIANT}"
 
 # Linux kernel file to boot
 GEM5_RUN_KERNEL ?= "vmlinux"
meta-gem5/recipes-devtools/gem5/gem5-native.inc +4 -1
index 3cad1eb..06c03e4 100644
@@ -6,8 +6,11 @@ LICENSE = "BSD & MIT & LGPLv2.1"
 
 # Gem5 build and run parameter
 
+# See http://www.gem5.org/documentation/general_docs/building for the list of variants
+GEM5_BUILD_VARIANT ?= "opt"
+
 # What gem5 binary are we building
-GEM5_BUILD_CONFIGS ?= "build/X86/gem5.opt"
+GEM5_BUILD_CONFIGS ?= "build/X86/gem5.{GEM5_BUILD_VARIANT}"
 
 # Scons build arguments
 GEM5_SCONS_ARGS ?= "CC=${BUILD_CC} CXX=${BUILD_CXX} \
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/6 gem5/gem5-aarch64-native: update to v20.1.0.3

Update to the latest tagged version of gem5. Previously included patches are now part of that release.
Upstream patch backported to enable boot with SMMUv3 model.

Change-Id I7d7ad6f9681eb1f06743d214abbe901e9f8aa74e
---
 ...rm-SMMUv3-enable-interrupt-interface.patch |  97 ++++++++++
 ...XXFLAGS_EXTRA-for-the-marshal-object.patch |  85 ---------
 ...arch-arm-Introduce-HavePACExt-helper.patch |  55 ------
 ...s-implemented-before-executing-insts.patch | 174 ------------------
 .../gem5/gem5-aarch64-native_20.bb            |   5 +-
 .../recipes-devtools/gem5/gem5-source_20.inc  |   6 +-
 6 files changed, 101 insertions(+), 321 deletions(-)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch
meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch new file +97 -0
new file mode 100644
index 0000000..6d00cc2
@@ -0,0 +1,97 @@
+From be710c5657b03bc9a9ce18ecf7ce1956265bae47 Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <[email protected]>
+Date: Thu, 10 Dec 2020 18:07:21 +0000
+Subject: [PATCH] dev-arm: SMMUv3, enable interrupt interface
+
+Users can set "irq_interface_enable" to allow software to program
+SMMU_IRQ_CTRL and SMMU_IRQ_CTRLACK. This is required to boot Linux v5.4+
+in a reasonable time. Notice the model does not implement architectural
+interrupt sources, so no assertions will happen.
+
+Change-Id: Ie138befdf5a204fe8fce961081c575c2166e22b9
+Signed-off-by: Adrian Herrera <[email protected]>
+Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38555
+Tested-by: kokoro <[email protected]>
+Reviewed-by: Andreas Sandberg <[email protected]>
+Maintainer: Andreas Sandberg <[email protected]>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38555]
+Expected version: v20.2
+---
+ src/dev/arm/SMMUv3.py  |  5 +++++
+ src/dev/arm/smmu_v3.cc | 10 +++++++++-
+ src/dev/arm/smmu_v3.hh |  4 +++-
+ 3 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/dev/arm/SMMUv3.py b/src/dev/arm/SMMUv3.py
+index 29c15682bf..f57be896f9 100644
+--- a/src/dev/arm/SMMUv3.py
++++ b/src/dev/arm/SMMUv3.py
+@@ -91,6 +91,11 @@ class SMMUv3(ClockedObject):
+     reg_map = Param.AddrRange('Address range for control registers')
+     system = Param.System(Parent.any, "System this device is part of")
+ 
++    irq_interface_enable = Param.Bool(False,
++            "This flag enables software to program SMMU_IRQ_CTRL and "
++            "SMMU_IRQ_CTRLACK as if the model implemented architectural "
++            "interrupt sources")
++
+     device_interfaces = VectorParam.SMMUv3DeviceInterface([],
+                                         "Responder interfaces")
+ 
+diff --git a/src/dev/arm/smmu_v3.cc b/src/dev/arm/smmu_v3.cc
+index f9bdc277c6..d73f270170 100644
+--- a/src/dev/arm/smmu_v3.cc
++++ b/src/dev/arm/smmu_v3.cc
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2018-2019 ARM Limited
++ * Copyright (c) 2013, 2018-2020 ARM Limited
+  * All rights reserved
+  *
+  * The license below extends only to copyright in the software and shall
+@@ -58,6 +58,7 @@ SMMUv3::SMMUv3(SMMUv3Params *params) :
+     requestPort(name() + ".request", *this),
+     tableWalkPort(name() + ".walker", *this),
+     controlPort(name() + ".control", *this, params->reg_map),
++    irqInterfaceEnable(params->irq_interface_enable),
+     tlb(params->tlb_entries, params->tlb_assoc, params->tlb_policy),
+     configCache(params->cfg_entries, params->cfg_assoc, params->cfg_policy),
+     ipaCache(params->ipa_entries, params->ipa_assoc, params->ipa_policy),
+@@ -626,6 +627,13 @@ SMMUv3::writeControl(PacketPtr pkt)
+             assert(pkt->getSize() == sizeof(uint32_t));
+             regs.cr0 = regs.cr0ack = pkt->getLE<uint32_t>();
+             break;
++        case offsetof(SMMURegs, irq_ctrl):
++            assert(pkt->getSize() == sizeof(uint32_t));
++            if (irqInterfaceEnable) {
++                warn("SMMUv3::%s No support for interrupt sources", __func__);
++                regs.irq_ctrl = regs.irq_ctrlack = pkt->getLE<uint32_t>();
++            }
++            break;
+ 
+         case offsetof(SMMURegs, cr1):
+         case offsetof(SMMURegs, cr2):
+diff --git a/src/dev/arm/smmu_v3.hh b/src/dev/arm/smmu_v3.hh
+index 6b3f3982b8..a001d71178 100644
+--- a/src/dev/arm/smmu_v3.hh
++++ b/src/dev/arm/smmu_v3.hh
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2018-2019 ARM Limited
++ * Copyright (c) 2013, 2018-2020 ARM Limited
+  * All rights reserved
+  *
+  * The license below extends only to copyright in the software and shall
+@@ -94,6 +94,8 @@ class SMMUv3 : public ClockedObject
+     SMMUTableWalkPort tableWalkPort;
+     SMMUControlPort   controlPort;
+ 
++    const bool irqInterfaceEnable;
++
+     ARMArchTLB  tlb;
+     ConfigCache configCache;
+     IPACache    ipaCache;
+-- 
+2.17.1
+
meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch deleted +0 -85

85 lines not on this page · raw message

meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch deleted +0 -55

55 lines not on this page · raw message

meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch deleted +0 -174

174 lines not on this page · raw message

meta-gem5/recipes-devtools/gem5/gem5-aarch64-native_20.bb +1 -4
index a222765..79cf910 100644
@@ -1,9 +1,6 @@
 require gem5-source_20.inc
 
-SRC_URI += "file://0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch \
-            file://0002-arch-arm-Introduce-HavePACExt-helper.patch \
-            file://0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch \
-           "
+SRC_URI += "file://0001-dev-arm-SMMUv3-enable-interrupt-interface.patch"
 
 BPN = "gem5-aarch64-native"
 
meta-gem5/recipes-devtools/gem5/gem5-source_20.inc +3 -3
index c448466..c441a1a 100644
@@ -1,11 +1,11 @@
-# gem5 sources v20.0.0.3
+# gem5 sources v20.1.0.3
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \
                     file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec"
 
 SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1"
-RELEASE_TAG = "v20.0.0.3"
-SRCREV = "fa70478413e4650d0058cbfe81fd5ce362101994"
+RELEASE_TAG = "v20.1.0.3"
+SRCREV = "cd21b5a5519940a0fa9b9a2dde68f30403d17f7e"
 
 PV = "${RELEASE_TAG}"
 
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 3/6 gem5/gem5-aarch64-native: backport a patch to reduce warnings

In reply to Jon Mason

From: Ross Burton <[email protected]>

With Python 3.9 the build produces a huge number of warnings, resulting in a do_compile log that is 17M long.

Backport a patch from pybind11 upstream to silence this warning.

Change-Id Ie4c71f8e5dd6c07c8be0a563778029a9859e1726
---
 .../gem5/files/pyinit-threads.patch           | 32 +++++++++++++++++++
 .../recipes-devtools/gem5/gem5-source_20.inc  |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch
meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch new file +32 -0
new file mode 100644
index 0000000..ac0c841
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+
+From ae2ee2a4a51914cf78deb5c253a3b03cbb53ce72 Mon Sep 17 00:00:00 2001
+From: Boris Staletic <[email protected]>
+Date: Mon, 15 Jun 2020 19:36:43 +0200
+Subject: [PATCH] Avoid using deprecated API in python 3.9
+
+The PyEval_InitThreads() and PyEval_ThreadsInitialized() functions are
+now deprecated and will be removed in Python 3.11. Calling
+PyEval_InitThreads() now does nothing. The GIL is initialized by
+Py_Initialize() since Python 3.7.
+---
+ include/pybind11/detail/internals.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h
+index 6224dfb22..166a18a32 100644
+--- a/ext/pybind11/include/pybind11/detail/internals.h
++++ b/ext/pybind11/include/pybind11/detail/internals.h
+@@ -273,7 +273,10 @@ PYBIND11_NOINLINE inline internals &get_internals() {
+         auto *&internals_ptr = *internals_pp;
+         internals_ptr = new internals();
+ #if defined(WITH_THREAD)
+-        PyEval_InitThreads();
++
++        #if PY_VERSION_HEX < 0x03090000
++                PyEval_InitThreads();
++        #endif
+         PyThreadState *tstate = PyThreadState_Get();
+         #if PY_VERSION_HEX >= 0x03070000
+             internals_ptr->tstate = PyThread_tss_alloc();
meta-gem5/recipes-devtools/gem5/gem5-source_20.inc +2 -1
index c441a1a..c586308 100644
@@ -3,7 +3,8 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \
                     file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec"
 
-SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1"
+SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1 \
+           file://pyinit-threads.patch"
 RELEASE_TAG = "v20.1.0.3"
 SRCREV = "cd21b5a5519940a0fa9b9a2dde68f30403d17f7e"
 
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 4/6 gem5/gem5-m5term-native: initial recipe

In reply to Jon Mason

From: Adrian Herrera <[email protected]>

m5term enables users to connect to the simulated console. Useful in development environments.

Change-Id I6096be9fbf44da280272656f3e15d1ba19593e50
---
 .../gem5/gem5-m5term-native_20.bb             | 24 +++++++++++++
 .../gem5-m5term/0001-add-makefile-flags.patch | 34 +++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch
meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb new file +24 -0
new file mode 100644
index 0000000..07faddb
@@ -0,0 +1,24 @@
+require gem5-source_20.inc
+
+SUMMARY = "m5term allows users to connect to gem5's simulated console"
+HOMEPAGE = "https://www.gem5.org/documentation/general_docs/fullsystem/m5term"
+LICENSE = "BSD"
+
+inherit native
+
+M5TERM_DIR = "util/term"
+
+SRC_URI += "file://0001-add-makefile-flags.patch"
+
+do_compile() {
+    oe_runmake -C ${S}/${M5TERM_DIR}
+}
+
+# The Makefile for m5term does not provide a "install" target
+# We do the install process within the recipe
+do_install() {
+    install -d ${D}${bindir}
+    install -m 755 ${B}/${M5TERM_DIR}/m5term ${D}${bindir}
+}
+
+addtask addto_recipe_sysroot before do_build
meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch new file +34 -0
new file mode 100644
index 0000000..d13ef4c
@@ -0,0 +1,34 @@
+From 688f7103e08318edbd48cf830c0ab3a048761bbb Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <[email protected]>
+Date: Thu, 03 Dec 2020 16:45:59 +0000
+Subject: [PATCH] util: m5term, fix LDFLAGS, standard make variables
+
+Enables build systems to provide necessary flags to build m5term.
+Useful specially if a different linker is intended to be used.
+
+Change-Id: If7f867cc0965d6ad4627b5421e00a99cc3d64989
+Signed-off-by: Adrian Herrera <[email protected]>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38256]
+Expected version: v20.2
+---
+
+diff --git a/util/term/Makefile b/util/term/Makefile
+index 658b961..4aa1c52 100644
+--- a/util/term/Makefile
++++ b/util/term/Makefile
+@@ -24,12 +24,12 @@
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+-CCFLAGS= -g -O0
++CFLAGS ?= -g -O0
+ 
+ default: m5term
+ 
+ m5term: term.c
+-	$(CC) $(LFLAGS) -o $@ $^
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+ 
+ install: m5term
+ 	$(SUDO) install -o root -m 555 m5term /usr/local/bin
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 5/6 gem5/gem5-m5ops: initial recipe

In reply to Jon Mason

From: Adrian Herrera <[email protected]>

m5ops provide pseudo-instructions to trigger gem5 functionality. m5 utility provides a CLI for m5ops.
libm5.a provides a C library for m5ops.

Change-Id Ib06dcb539648407522e31aeb1ed392fb5232675e
---
 ...til-m5ops-optional-extra-build-flags.patch | 59 +++++++++++++++++++
 .../recipes-devtools/gem5/gem5-m5ops_20.bb    | 26 ++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb
meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch new file +59 -0
new file mode 100644
index 0000000..b446a2f
@@ -0,0 +1,59 @@
+From 32e35a2f179d1b036d2eb699d77f869f7787f36b Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <[email protected]>
+Date: Tue, 8 Dec 2020 20:12:55 +0000
+Subject: [PATCH] util: m5ops, optional extra build flags
+
+This increases compilation control for users. Main use case is building
+m5ops as part of an image distribution. Specifying a different sysroot
+or dynamic linker may be required when the cross toolchain is built as
+part of the process.
+
+Change-Id: Icbd3faa92ea6e084fc4a9b2db83129bce73faf21
+Signed-off-by: Adrian Herrera <[email protected]>
+Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38416
+Reviewed-by: Jason Lowe-Power <[email protected]>
+Reviewed-by: Gabe Black <[email protected]>
+Maintainer: Jason Lowe-Power <[email protected]>
+Tested-by: kokoro <[email protected]>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38416]
+Expected version: v20.2
+---
+ util/m5/SConstruct | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/util/m5/SConstruct b/util/m5/SConstruct
+index bbae8d9bbf..a37573d763 100644
+--- a/util/m5/SConstruct
++++ b/util/m5/SConstruct
+@@ -136,16 +136,24 @@ for root, dirs, files in os.walk(abspath(src_dir)):
+         #
+         # This also considers scons command line settings which may look like
+         # environment variables, but are set after "scons" on the command line.
+-        def get_abi_opt(name, default):
++        def _extract_abi_opt_val(name, default):
+             var_name = env.subst('${ABI}.%s' % name)
+-            env[name] = os.environ.get(
+-                    var_name, ARGUMENTS.get(var_name, default))
++            return os.environ.get(var_name, ARGUMENTS.get(var_name, default))
++        def get_abi_opt(name, default):
++            env[name] = _extract_abi_opt_val(name, default)
++        def append_abi_opt(name):
++            env.Append(**{ name: _extract_abi_opt_val(name, '') })
+ 
+         # Process the ABI's settings in the SConsopts file, storing them
+         # in a copy of the primary environment.
+         env.SConscript(Dir(root).File('SConsopts'),
+                        exports=[ 'env', 'get_abi_opt' ])
+ 
++        # The user can pass extra build flags for each ABI
++        append_abi_opt('CCFLAGS')
++        append_abi_opt('CXXFLAGS')
++        append_abi_opt('LINKFLAGS')
++
+         # Once all the options have been configured, set up build targets for
+         # this abi.
+         abi_dir = build_dir.Dir(env.subst('${ABI}'))
+-- 
+2.17.1
+
meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb new file +26 -0
new file mode 100644
index 0000000..7b48344
@@ -0,0 +1,26 @@
+require gem5-source_20.inc
+inherit scons package
+
+HOMEPAGE = "https://www.gem5.org/documentation/general_docs/m5ops"
+SUMMARY = "m5ops provide pseudo-instructions to trigger gem5 functionality"
+LICENSE = "BSD"
+
+M5OPS_DIR = "util/m5"
+
+SRC_URI += "file://0001-util-m5ops-optional-extra-build-flags.patch"
+
+OUT_DIR = "build/${TARGET_ARCH}/out"
+
+EXTRA_OESCONS += "${TARGET_ARCH}.CROSS_COMPILE=${TARGET_PREFIX} \
+                  ${TARGET_ARCH}.CCFLAGS=--sysroot=${STAGING_DIR_TARGET} \
+                  ${TARGET_ARCH}.LINKFLAGS=--sysroot=${STAGING_DIR_TARGET} \
+                  -C ${S}/${M5OPS_DIR} ${OUT_DIR}/m5"
+
+# The SConstruct file for m5ops does not provide a "install" target
+# We do the install process within the recipe
+do_install() {
+    install -d ${D}${bindir} ${D}${libdir} ${D}${includedir}
+    install -m 755 ${B}/${M5OPS_DIR}/${OUT_DIR}/m5 ${D}${bindir}
+    install -m 644 ${B}/${M5OPS_DIR}/${OUT_DIR}/libm5.a ${D}${libdir}
+    install -m 644 ${B}/include/gem5/m5ops.h ${D}${includedir}
+}
Signature · 1 line
2.17.1
author
#5 lore raw

PATCH 6/6 gem5/gem5-aarch64-native: use oe-run-native

In reply to Jon Mason

From: Adrian Herrera <[email protected]>

Persist gem5 binary in native sysroot. This allows executing the binary with the standard oe-run-native script. We can also remove the wrapper creation and the ".real" versioning, since paths are setup by oe-run-native.

Change-Id I9fd46725c78e1a09a7142a9d343b140bb5a77088
---
 meta-gem5/recipes-devtools/gem5/files/start-gem5.sh |  2 +-
 meta-gem5/recipes-devtools/gem5/gem5-native.inc     | 10 ++--------
 2 files changed, 3 insertions(+), 9 deletions(-)
meta-gem5/recipes-devtools/gem5/files/start-gem5.sh +1 -1
index 4edc0e5..6335411 100644
@@ -34,6 +34,6 @@ if [ -n "${GEM5_RUN_EXTRA}" ]; then
     args="$args ${GEM5_RUN_EXTRA}"
 fi
 
-${STAGING_BINDIR_NATIVE}/${GEM5_RUN_CONFIG} \
+oe-run-native gem5-aarch64-native ${GEM5_RUN_CONFIG} \
     ${STAGING_DATADIR_NATIVE}/gem5/${GEM5_RUN_PROFILE} ${args} "$@"
 
meta-gem5/recipes-devtools/gem5/gem5-native.inc +2 -8
index 06c03e4..1462b4e 100644
@@ -41,14 +41,7 @@ do_install() {
     for f in ${GEM5_BUILD_CONFIGS}; do
         destname=$(basename $f)
         install -d ${D}${bindir}
-        install -m 755 $f ${D}${bindir}/$destname.real
-        cat <<EOF > ${D}${bindir}/$destname
-#!/bin/bash
-basedir=\$(cd \$(dirname \$0)/../../; pwd)
-export LD_LIBRARY_PATH="\$basedir/lib:\$basedir/usr/lib"
-\$basedir/usr/bin/$destname.real "\$@"
-EOF
-        chmod a+x ${D}${bindir}/$destname
+        install -m 755 $f ${D}${bindir}/$destname
     done
 }
 
@@ -56,3 +49,4 @@ FILES_${PN} = "${datadir}/gem5/* ${bindir}/*"
 INSANE_SKIP_${PN} += "already-stripped"
 RDEPENDS_${PN} += "python3-native hdf5-native protobuf-native libpng-native"
 
+addtask addto_recipe_sysroot before do_build
Signature · 1 line
2.17.1
#6 lore raw
In reply to Jon Mason
Quoted 8 lines · Jon Mason

From: Ross Burton <[email protected]>

The recipe currently builds gem5 binaries in optimised, fast, and debug mode. There is no need to build three at once (and triples the build time), so simply build the optimised variant by default (as recommended by upstream) whilst letting the variant be altered by setting GEM5_BUILD_VARIANT.

Quoted 4 lines
Change-Id I23baeee438d1ff08d1e2a54282141b55500f2ac1

---

Series appled to the master branch

Thanks,
Jon

Quoted 51 lines
 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc | 5 ++---
 meta-gem5/recipes-devtools/gem5/gem5-native.inc         | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)
meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc +2 -3
index 898fa23..0a8e34c 100644
@@ -1,8 +1,7 @@
 # gem5 aarch64 specific configuration
 
 # Build arm64 gem5
-GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.opt build/ARM/gem5.fast \
-    build/ARM/gem5.debug"
+GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.${GEM5_BUILD_VARIANT}"
 
 SRC_URI += "file://start-gem5.sh"
 
@@ -10,7 +9,7 @@ inherit deploy
 
 # Parameters for the start script
 
-GEM5_RUN_CONFIG ?= "gem5.fast"
+GEM5_RUN_CONFIG ?= "gem5.${GEM5_BUILD_VARIANT}"
 
 # Linux kernel file to boot
 GEM5_RUN_KERNEL ?= "vmlinux"
meta-gem5/recipes-devtools/gem5/gem5-native.inc +4 -1
index 3cad1eb..06c03e4 100644
@@ -6,8 +6,11 @@ LICENSE = "BSD & MIT & LGPLv2.1"
 
 # Gem5 build and run parameter
 
+# See http://www.gem5.org/documentation/general_docs/building for the list of variants
+GEM5_BUILD_VARIANT ?= "opt"
+
 # What gem5 binary are we building
-GEM5_BUILD_CONFIGS ?= "build/X86/gem5.opt"
+GEM5_BUILD_CONFIGS ?= "build/X86/gem5.{GEM5_BUILD_VARIANT}"
 
 # Scons build arguments
 GEM5_SCONS_ARGS ?= "CC=${BUILD_CC} CXX=${BUILD_CXX} \
Signature · 1 line
2.17.1