Ryan Gambord has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17428

Change subject: configs, util: Bugfixes for fs tools
......................................................................

configs, util: Bugfixes for fs tools

MakeLinuxX86System() - threw IOError if default kernel was not present,
even if options.kernel was set to a custom value.

Added -no-pie flag to link /util/m5 to support newer versions of GCC
that enable PIE by default. Tested for backwards compatibility with GCC
4.3, which, only warns for the unrecognized flag.

Change-Id: Idd6760919a61750fc41de367a71fd2c4c772aa09
---
M configs/common/FSConfig.py
M configs/example/fs.py
M util/m5/Makefile.x86
3 files changed, 9 insertions(+), 7 deletions(-)



diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 13c29ef..a141461 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -608,7 +608,7 @@
     self.intel_mp_table.ext_entries = ext_entries

 def makeLinuxX86System(mem_mode, numCPUs=1, mdesc=None, Ruby=False,
-                       cmdline=None):
+                       cmdline=None, kernel=None):
     self = LinuxX86System()

     # Build up the x86 system and then specialize it for Linux
@@ -656,7 +656,12 @@
     if not cmdline:
cmdline = 'earlyprintk=ttyS0 console=ttyS0 lpj=7999923 root=/dev/hda1'
     self.boot_osflags = fillInCmdline(mdesc, cmdline)
-    self.kernel = binary('x86_64-vmlinux-2.6.22.9')
+
+    if not kernel:
+        kernel = 'x86_64-vmlinux-2.6.22.9'
+    self.kernel = binary(kernel)
+
+
     return self


diff --git a/configs/example/fs.py b/configs/example/fs.py
index 70275a0..e248294 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -89,7 +89,7 @@
         test_sys = makeSparcSystem(test_mem_mode, bm[0], cmdline=cmdline)
     elif buildEnv['TARGET_ISA'] == "x86":
test_sys = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0],
-                options.ruby, cmdline=cmdline)
+                options.ruby, cmdline=cmdline, kernel=options.kernel)
     elif buildEnv['TARGET_ISA'] == "arm":
         test_sys = makeArmSystem(test_mem_mode, options.machine_type,
options.num_cpus, bm[0], options.dtb_filename,
@@ -122,9 +122,6 @@
                                              voltage_domain =
                                              test_sys.cpu_voltage_domain)

-    if options.kernel is not None:
-        test_sys.kernel = binary(options.kernel)
-
     if options.script is not None:
         test_sys.readfile = options.script

diff --git a/util/m5/Makefile.x86 b/util/m5/Makefile.x86
index 89f8f92..c108ef6 100644
--- a/util/m5/Makefile.x86
+++ b/util/m5/Makefile.x86
@@ -51,7 +51,7 @@
        $(CC) $(CFLAGS) -fPIC -o $@ -c $<

 m5: $(OBJS)
-       $(CC) -o $@ $(OBJS)
+       $(CC) -o $@ $(OBJS) -no-pie

 m5op_x86.opic: m5op_x86.S
        $(CC) $(CFLAGS) -DM5OP_PIC -fPIC -o $@ -c $<

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17428
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Idd6760919a61750fc41de367a71fd2c4c772aa09
Gerrit-Change-Number: 17428
Gerrit-PatchSet: 1
Gerrit-Owner: Ryan Gambord <gambo...@oregonstate.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to