summaryrefslogtreecommitdiff
path: root/SConstruct
AgeCommit message (Collapse)Author
2020-01-22scons: fix --gold-linker build after --as-neededCiro Santilli
The build was failing with: /usr/bin/ld: unrecognized option '--as-needed -fuse-ld=gold' and --verbose confirms that a single quoted CLI parameter was being executed: "-Wl,--as-needed -fuse-ld=gold" This happened because at Ifb001786a66b0dd9b29865e39a5740313002f250 --as-needed was added, and because it is the second option to happen before the following main.subst, it exposed the fact that the existing main.subst was wrong, because it returns a string instead of the expected array. Change-Id: I619d242d60fe9d27438638ac11c2b92512881f26 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24624 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
2020-01-08scons: Add '-Wl,--as-needed' to default LINKFLAGSYu-hsin Wang
In current build flow, EXTRAS flag is evaluated before building gem5 tools and binaries. Such that, unneeded libraries may be linked into gem5 binaries. Adding '-Wl,--as-needed' can fix this problem also shrinks binaries. Change-Id: Ifb001786a66b0dd9b29865e39a5740313002f250 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24003 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2020-01-07scons: Cleanup code that enables asan and ubsanNikos Nikoleris
Change-Id: Ie29efc99067dac051536bb099a89f29c940192ec Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23883 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-12-07scons: Fixes to improve python 3 support.Gabe Black
Some simple fixes to improve python 3 compatability in scons. Change-Id: I89aba6ed9d73ee733307c57e033c636029d9cb7a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23264 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-21scons: Use the new error() and warning() methods.Gabe Black
Also clean up some error messages which were missing capitalization, etc. Change-Id: Iaef6b4343a693d30b579e72218cbb7723ebf7d48 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22886 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-21scons: Don't use PROTOC for the protoc command and to flag its presence.Gabe Black
Commands that blindly use PROTOC will try to execute "False" which is very confusing for someone looking at the console output and error messages. Instead, create a new environment setting HAVE_PROTOC which is either true or false depending on if the protoc command exists and passes muster. Also, if there's an error running protoc, catch that and use it to mark protoc as unavailable. The previous behavior was to supress errors and just return an empty string instead, I assume with the expectation that that would be an invalid version and fail later checks. Change-Id: I1251b4e7e0e9894cdd3343e59498cc653b648b26 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22883 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-08-29stats: Add beta support for HDF5 stat dumpsAndreas Sandberg
This changeset add support for stat dumps in the HDF5 file format. HDF5 is a binary data format that represents data in a file-system-like balanced tree. It has native support for N-dimensional arrays and binary data (e.g., frame buffers). It has the following benefits over traditional text stat files: * Efficient storage of time series (multiple stat dumps) * Fast lookup of stats * Plenty of existing tooling (e.g., Python libraries and graphical viewers) * File format can be used to store frame buffers together with normal stats. Drawbacks: * Large startup cost (single stat dump larger than text equivalent) * Stat dumps are slower than text Known limitations: * Distributions and histograms aren't supported. HDF5 stat output can be enabled using the 'h5' URL scheme when overriding the stat file name on gem5's command line. The following parameters are supported: * chunking (unsigned): Number of time steps to pre-allocate (default: 10) * desc (bool): Output stat descriptions (default: True) * formulas (bool): Output derived stats (default: True) Example gem5 command line: ./build/ARM/gem5.opt \ --stats-file="h5://stats.h5?desc=False;formulas=False" \ configs/example/fs.py Example Python stat consumer that computes IPC: import h5py f = h5py.File('stats.h5', 'r') group = f['/system/cpu'] for i, c in zip(group['committedInsts'], group['numCycles']): print i, c, i / c Change-Id: I351c6cbff2fb7bef9012f47876ba227ed288975b Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/8121 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
2019-06-10scons: allow passing arbitrary CCFLAGS and LDFLAGS from the CLICiro Santilli
The flags may be passed as: scons CCFLAGS_EXTRA='-Wno-error -pedantic' \ LDFLAGS_EXTRA='-g -g' build/<arch>/gem5.opt The initial motivation for this commit is to help disable warning that have become errors while bisecting. scons orders the flags by Append call order, and ideally these flags should be added last to override the others, since the last GCC flags take precedence. However I haven't found a simple way to put them at the very end. Change-Id: Ida24dfb9604d88b99f113392ab5e47d578ba7259 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19048 Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-06-05mem-ruby: Enable set size increaseJohn Alsop
Add NUMBER_BITS_PER_SET environment variable to control the size of the bitmask in Set.hh (default=64). Necessary for configs which require >64 instances of a given machine type. This can be set in the build_opts file, e.g. by adding the following line: NUMBER_BITS_PER_SET = <number> Change-Id: I314a3cadca8ce975fcf4a60d9022494751688e88 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18968 Reviewed-by: Tiago Mück <tiago.muck@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-03-12scons: Don't use isdir in AddLocalRPATH.Gabe Black
isdir isn't a nice way to check if an FS.Base is a File or a Dir as was initially assumed, it literally checks if a path can be stat-ed and is reported as a directory by stat. This means that if a directory is going to be created as part of the build, the result of that test will change depending on whether that part of the build has happened successfully before. A better check which behaves as originally intended is to check whether the Node is an instance of the SCons.Node.FS.Dir class. Change-Id: Id041917d50b768a8205769c0a05320f92b09993c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17128 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-02-23scons: Add support for specifying Python versionAndreas Sandberg
Add a sticky variable (PYTHON_CONFIG) to select which python-config version to use. This can, for example, be used to build with Python 3 or with Python 2.7 in a custom location. Change-Id: I1f4c00d66f85a9c99f50fe4d746b69dd82b60b4b Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/16003 Reviewed-by: Gabe Black <gabeblack@google.com>
2019-02-23scons: conditional use of new RPATH inclusionAndrea Mondelli
On OSX, clang doesn’t support the -z option. This patch resolve the compiler error produced on MacOS platform. Change-Id: Idfe69c30fe40add97d16d0f2e25e598b30d26a9d Reviewed-on: https://gem5-review.googlesource.com/c/16649 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-02-21scons: Add a convenience method to set RPATH for local libraries.Gabe Black
When linking in a dynamic library which is in the gem5 build directory, it's useful to set RPATH so that you don't have to set LD_LIBRARY_PATH when you run gem5 so that the dynamic linker can find it. Since it's tricky and not entirely obvious how to set up those paths correctly, this change adds a small convenience function which does that for you. It also handles situations where the same dynamic library may be linked into different binaries in different directories which each need a different relative RPATH. It does that by letting the environment for each binary set a construction variable which says how to get from that particular binary back to the build directory. This helper method then sets RPATH to start at $ORIGIN (the binary), to follow that relative path to the variant build directory, and then the per-library but not per-binary path to the library's directory. This change also adds the -z origin linker flag which makes the linker handle $ORIGIN properly. Change-Id: I45f4d72cd14396a73e0b963cea6a39d9bfb7f984 Reviewed-on: https://gem5-review.googlesource.com/c/16566 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-01-22scons: add helpers to access GDB XML description filesCiro Santilli
Change-Id: Ic3b18887544b7710ed07a86d28dc62d8441b3476 Reviewed-on: https://gem5-review.googlesource.com/c/15255 Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-01-11scons: added support of default Python installation on MacOSAndrea Mondelli
Recent MacOS versions are distributed with python 2.7. This version of python is sufficient to compile and run gem5. This patch allows to use the default python instead of the version provided by third-party tools (e.g., brew) The default MacOS LLDB debugger is linked against the default python installation, which conflicts with Python framework provided by third-party package systems. This patch removes the need of gem5 to have multiple python installations on MacOS, if not explicitly installed. Change-Id: I98f24804149cb2e04ca432c66d2f57e0296af7b2 Reviewed-on: https://gem5-review.googlesource.com/c/15475 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2018-11-15scons: add --gold-linker to link with the gold linkerCiro Santilli
This option can significantly speedup link time on Linux systems, which is the main bottleneck to rebuild after small changes. Change-Id: I3b0bdd61f7dcef0d73629c8ee2ee98091953fec3 Reviewed-on: https://gem5-review.googlesource.com/c/14075 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-19scons: remove as version checkCiro Santilli
GNU as 2.31.1 checks if the input and output files are the same: Assembler messages: Fatal error: The input and output files must be distinct The check already does not work for llvm-as which has a different output format. Since it is too hard to maintain the check correctly for all possible assemblers, it is better to just remove it completely. Change-Id: I38a993ab83ca83d4a2f5e77820d2ca903f70c6ac Reviewed-on: https://gem5-review.googlesource.com/12403 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2018-09-13Fix SConstruct for asan buildEarl Ou
Sometimes it's easier to debug gem5 built with ASan enabled. This CL fixes some build error when using --with-asan. Bug: None Test: ./scripts/build_gem5 --with-asan --with-ubsan build/ARM/gem5.debug Change-Id: Iaaaaebc3f25749e11f97bf454ddd0153b3de56e7 Reviewed-on: https://gem5-review.googlesource.com/12511 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
2018-08-24base: If valgrind is available, tell it about Fiber stacks.Gabe Black
Valgrind can get confused when switching stacks between different Fibers. If valgrind (and its headers) are available, this change adds calls to some hooks so valgrind knows where the new stacks are and doesn't report a bunch of false positives. Change-Id: I00aefe60372be6de7371dec29427d7182dbee7b6 Reviewed-on: https://gem5-review.googlesource.com/12227 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
2018-06-22SConstruct: additional message for the error checking of the python 2.7 headersMatteo M. Fusi
One of the most common errors during the installation of gem5 is the one related to the failure of the check of the Python2.7 headers in the SConstruct file. In some cases the headers are correctly installed, but a wrong selection of the C compiler can make this check fail. This commit wants to add some useful information this error message. Change-Id: I0d087ad01c6e4cca3559f23070c37b5c13600962 Reviewed-on: https://gem5-review.googlesource.com/11389 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-05-04scons: Fix --with-ubsan/asan compilation flagsGiacomo Travaglini
SConstruct was using an undefined env variable; this patch uses the main Environment variable. Change-Id: I30ab6b4bbfa6d9a71a30fb33406a799bfb476821 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/10181 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-03-26scons: Re-enable override based warnings on gcc.Gabe Black
These warnings have been fixed. Change-Id: I28ee5f4ae21412121849fcb9d273939d8e462842 Reviewed-on: https://gem5-review.googlesource.com/9344 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-03-06scons: Switch from the print statement to the print function.Gabe Black
Starting with version 3, scons imposes using the print function instead of the print statement in code it processes. To get things building again, this change moves all python code within gem5 to use the function version. Another change by another author separately made this same change to the site_tools and site_init.py files. Change-Id: I2de7dc3b1be756baad6f60574c47c8b7e80ea3b0 Reviewed-on: https://gem5-review.googlesource.com/8761 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-02-01scons: Resolve backtrace implementation existence testing failureHanhwi Jang
Change backtrace implementation testing code not to have NULL pointer. SCons fails to find backtrace implementation even if it exists. The implementation testing code contains NULL pointers as a backtrace buffer argument. Some compilers check the buffer is NULL pointed or not, and generate a compilation error. Change-Id: Icc5bc9a887b7a6bbc804b5b8a5a35a935c78a922 Reviewed-on: https://gem5-review.googlesource.com/7681 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-27scons: Get rid of a flag which makes Werror optional.Gabe Black
This flag wasn't being used. Also move the Werror code to the SConstruct now that it's being applied universally. Change-Id: I18b00d4b41bc1add9271ca299c020c14970a6926 Reviewed-on: https://gem5-review.googlesource.com/5982 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-11-27scons: Move some compiler flag setting code to the SConstruct.Gabe Black
These settings are invariant, so there's no reason to apply them over and over again for the child environments used for various build products. Change-Id: Icb4053105e4f1c43008f2422ba30c7206b7ff365 Reviewed-on: https://gem5-review.googlesource.com/5981 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-11-10scons: Move Transform and termcap functionality into their own files.Gabe Black
Change-Id: Ica08e93f3873a7eafd02fe7d44c3bdbf0ce7f6b7 Reviewed-on: https://gem5-review.googlesource.com/5565 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-10scons: Move python path management out of the SConstruct.Gabe Black
Make site_init.py manage sys.path, and the "default" tool set PYTHONPATH on any environment that's created. The paths to add are tracked in a common gem5_python_paths.py. Change-Id: I3387d4394d47a2f9c83322644cfd05909c6890fa Reviewed-on: https://gem5-review.googlesource.com/5564 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-10scons: Pull style hook management out of the main SConstruct.Gabe Black
Put the code which supports style hooks for mercurial and git into two scons "tools". Change-Id: I3ffed85a177be4f9e458fff7b1cf16a3a479914e Reviewed-on: https://gem5-review.googlesource.com/5563 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-10scons: Override the "default" tool to set up the default env.Gabe Black
This imports various environment variables into the scons environment, and sets some general properties on it. These are basically just copied directly from the SConstruct and have the same behavior here. gem5_tool_list will be used later on to add scons "tools" which should be automatically added to new Environment objects. Change-Id: Ib255955090c7b1e1cb80c703c18a9c867fcf1c9e Reviewed-on: https://gem5-review.googlesource.com/5562 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-10scons: Move scons and python version checking into site_init.py.Gabe Black
In an effort to shrink and modularize the main scons files, this change pulls the scons and python version checking code out of the main file and into site_init.py which runs before the SConstruct starts. This will be a place to put really generic code which has to do with the very fundemental aspects of getting scons to work. Other checks, like checks for particular tools or particular versions of tools, will happen in other more specialized files. Change-Id: Icd00ecadbe1141aef4dbadcf42d6ddef1f3a701f Reviewed-on: https://gem5-review.googlesource.com/5561 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-10-31base: Introducing utility for writing raw data in png formatGiacomo Travaglini
Originally it was possible to use a Bitmap writer class for dumping a framebuffer snapshot in a .bmp file. This patch enables you to choose another format. In particular it implements the writing of PNG Images using libpng library. The latter has to be already installed in your machine, otherwise gem5 will default to the Bitmap format. This configurable writer has been introduced in the VNC frame dumping mechanism, which is storing changed frame buffers from the VNC server Change-Id: Id7e5763c82235f1ce90381c8486b85a7cce734ce Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/5181 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-10-17scons: Stop generating inc.d in the isa parser.Gabe Black
Generating dependency/build product information in the isa parser breaks scons idea of how a build is supposed to work. Arm twisting it into working forced a lot of false dependencies which slowed down the build. Change-Id: Iadee8c930fd7c80136d200d69870df7672a6b3ca Reviewed-on: https://gem5-review.googlesource.com/5081 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-08-31scons: bump required python version to 2.7 to support pybind11Paul Rosenfeld
Change-Id: Ic3652f975477f2e5d144e054489ab73ed9f82b55 Reviewed-on: https://gem5-review.googlesource.com/4440 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Joe Gross <joe.gross@amd.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-08-01sim: Use named constants for pseudo opsAndreas Sandberg
Use named constants from a shared header instead of magic values when handling pseudo ops. Change-Id: If157060bbcd772ce7e8556482b44ca714f4319b1 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/4262 Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-06-06scons: Try to handle problems with gcc, lto and partial linking.Gabe Black
gcc has had a lot of problems with incremental linking and partial linking at the same time. Basically, the partial link assumes that it's the only link that's going to happen, and it converts weak external symbols into regular external symbols. Then when the real final link happens, those symbols are duplicated and the link fails. Versions of gcc 6 and greater add an option called -flinker-output which lets you tell the linker to do an incremental link. Unfortunately, other bugs make that fail, and so gcc 6 doesn't work either. Hopefully version 7 works better. A --force-lto option was added so that, when only one of lto and partial linking is available, you can switch from having partial linking to having lto. Change-Id: I5e293f5cfb07a14343dc74030d99cb161fb8bbbe Reviewed-on: https://gem5-review.googlesource.com/3680 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2017-06-04scons: Add use_tuntap to export listJason Lowe-Power
Fixes broken build after c58537c. Change-Id: I686ffaaad4fe558b6e51c89c9b26121318c2b721 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/3647 Reviewed-by: Gabe Black <gabeblack@google.com>
2017-06-03dev: Add a version of EtherTap which uses the tap driver.Gabe Black
The object is called EtherTap (as opposed to EtherTapStub, what the former EtherTap was renamed to), and its existance is gated on the linux/if_tun.h header file existing. That's probably overly strict, but it will hopefully be minimally likely to break the build for other systems. Change-Id: Ie03507fadf0d843a4d4d52f283c44a416c6f2a74 Reviewed-on: https://gem5-review.googlesource.com/3646 Reviewed-by: Nathan Binkert <nate@binkert.org> Maintainer: Nathan Binkert <nate@binkert.org>
2017-05-22scons: Enable explicitly building something with no variant.Gabe Black
The SConstruct currently expects all explicit targets to be under a variant directory like ARM or X86 which tells it what settings to use, etc. There are things which scons knows how to build however, which do not live under a variant directory, specifically everything under ext. This change makes scons not look for a variant directory when it encounters a target which is built by something in ext. This enables things like explicitly building the systemc libraries, for example. Change-Id: I8982a96fe49e3cb970ec78e11cea08703990c686 Reviewed-on: https://gem5-review.googlesource.com/3460 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Christian Menard <christian.menard@tu-dresden.de> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2017-05-10scons: Use the generalized switching headers on the GPU ISA.Gabe Black
Now that the switching header implementation has been generalized, there's no need to have two nearly identical implementations for the two different groups of headers. Change-Id: Ie7c24fcddbc672ac5ca2d69bfc35696f42c55580 Reviewed-on: https://gem5-review.googlesource.com/2984 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-05-10scons: arch: Generalize the switching header code.Gabe Black
Factor out the ISA ness of the switching header generating function. Also turn it into a SCons builder which builds a single header, and a wrapping method which uses the builder on a group of header files which all target the same subdirectory. Change-Id: I87705f97b6ebd9baebd4ebcfea19cc1218a64ad0 Reviewed-on: https://gem5-review.googlesource.com/2983 Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2017-05-09scons: Get rid of the all_isa_deps variable.Gabe Black
This value can be computed more directly and more locally near where it's used. Change-Id: Ib5f45015494a6c8033ce0ac4b8931688f37492c8 Reviewed-on: https://gem5-review.googlesource.com/2982 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-05-08scons: Get rid of the PHONY_BASE construction variable.Gabe Black
The value of that variable can be computed more directly and more locally to where it's consumed. Change-Id: I5ca1f732a34e22d4dae2aeb6ee7fc8adebe1caa0 Reviewed-on: https://gem5-review.googlesource.com/2981 Maintainer: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-05-03scons: Fix the compiler flag used for partial linking.Gabe Black
It seems that g++ can generally handle the -r flag for generating a relocatable object file, but ld can't always handle the --relocatable flag. Change-Id: I15f32e469590a814131d4e992b392a7ad6c52b83 Reviewed-on: https://gem5-review.googlesource.com/3001 Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-05-02scons: Remove SWIG supportAndreas Sandberg
Remove remaining SWIG support from the build infrastructure. Change-Id: I7549cd0f952ca3a51481918eefef3a29f03af359 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2920 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
2017-05-02python: Use PyBind11 instead of SWIG for Python wrappersAndreas Sandberg
Use the PyBind11 wrapping infrastructure instead of SWIG to generate wrappers for functionality that needs to be exported to Python. This has several benefits: * PyBind11 can be redistributed with gem5, which means that we have full control of the version used. This avoid a large number of hard-to-debug SWIG issues we have seen in the past. * PyBind11 doesn't rely on a custom C++ parser, instead it relies on wrappers being explicitly declared in C++. The leads to slightly more boiler-plate code in manually created wrappers, but doesn't doesn't increase the overall code size. A big benefit is that this avoids strange compilation errors when SWIG doesn't understand modern language features. * Unlike SWIG, there is no risk that the wrapper code incorporates incorrect type casts (this has happened on numerous occasions in the past) since these will result in compile-time errors. As a part of this change, the mechanism to define exported methods has been redesigned slightly. New methods can be exported either by declaring them in the SimObject declaration and decorating them with the cxxMethod decorator or by adding an instance of PyBindMethod/PyBindProperty to the cxx_exports class variable. The decorator has the added benefit of making it possible to add a docstring and naming the method's parameters. The new wrappers have the following known issues: * Global events can't be memory managed correctly. This was the case in SWIG as well. Change-Id: I88c5a95b6cf6c32fa9e1ad31dfc08b2e8199a763 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Andrew Bardsley <andrew.bardsley@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2231 Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-05-02ext: Add pybind rev f4b81b3Andreas Sandberg
Change-Id: I52e4fc9ebf2f59da57d8cf8f3e37cc79598c2f5f Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2229 Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
2017-05-01scons: Add builders for partially linked object files.Gabe Black
These intermediate object files can be used to perform a hierarchical link. Change-Id: I27634731734eebe6531ce6b0894abdd59ffdc5c9 Reviewed-on: https://gem5-review.googlesource.com/2944 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-04-28scons: Add a Transform() for when linking shared libraries.Gabe Black
Change-Id: I7ddba0cc7be559633328011c1c7e2282f509b78c Reviewed-on: https://gem5-review.googlesource.com/2943 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-04-28scons: Find ext build directories automatically.Gabe Black
The ext directories with SConscripts in them are easy to find automatically. Avoid boilerplate listing them out and SConscript()ing them manually. Change-Id: Ib723882aebc00e639eb8ec44904bb05ffa2c6b55 Reviewed-on: https://gem5-review.googlesource.com/2942 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>