summaryrefslogtreecommitdiffstats
path: root/Makefile.main
Commit message (Collapse)AuthorAgeFilesLines
* build: CFLAGS compile with -mcpu=power7Nicholas Piggin2017-08-221-1/+2
| | | | | | | | | | | | The gcc powerpc64le cross compiler for x86 builds with -mcpu=power8 by default, which does not match the powerpc64 compiler, and is not the right thing to do for POWER7 support. Pass -mcpu=power7 explicitly. This may cause a change of target on existing BE toolchains. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* build: CFLAGS compile with -fpie and -fno-picNicholas Piggin2017-08-221-1/+1
| | | | | | | | | | | | | When gcc is configured with --enabled-default-pie, sets -fpic which does not need to be enabled, so remove it. Pass -fpie explicitly as well just to be careful. This was observed with the powerpc64le cross compiler for Debian. This allows the powerpc64le toolchain to compile an almost identical binary as the powerpc64 toolchain. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* build: LDFLAGS pass -pie flag explicitly to ldNicholas Piggin2017-08-221-0/+1
| | | | | | | | | | | | | | When building with some toolchains, the gcc -pie option does not enable the linker pie without explicitly passing it to ld, resulting in a non-PIE binary that silently fails (due to relocation failure). This was observed with the powerpc64le cross compiler for Debian. Pass -Wl,-pie explicitly, which allows the powerpc64le toolchain to create a position independnet binary that boots. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Makefile.check: Fix `make check`Cyril Bur2017-08-011-4/+3
| | | | | | | | | | | | | | Recent reworks were tested on the travis-ci system. Unfortunately, there are configurations of running `make check` which the travis-ci doesn't do. On some systems extra problems crop up. Removing the stack size check is only done for the host compiler as the check is only critical for skiboot its self where stack space is contained. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* gcov: properly handle gard and pflash code coverageStewart Smith2017-07-191-1/+12
| | | | | | | | We end up with a bit of a nasty hack to count the libflash symlinks in gard and pflash as part of libflash code coverage, but it does work and is unlikely to break anytime soon. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Makefile: gard/pflash targets for CI build with HOSTCFLAGS/HOSTGCOVFLAGSStewart Smith2017-07-191-2/+2
| | | | | | | This enables us to do coverage reports on gard/pflash. Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* skiboot: Add a library for xzHemant Kumar2017-06-271-2/+3
| | | | | | | | | | | | | | | This patch adds a library for compression/decompression using xz. The code comes from http://tukaani.org/xz/embedded.html. The codebase has been kept as-is with a new Makefile.inc. For libxz/Makefile.inc and Makefile.main : Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pore: Always use libporeOliver O'Halloran2017-05-101-7/+2
| | | | | | | | | In the days of yore libpore was closed source and people wanted the option to not use it. That's no longer the case so lets ditch all the #ifdef crap. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb/create-container: Add full container build and sign with imprint keysDave Heller2017-04-071-2/+2
| | | | | | | | | | This adds support for writing all the public key and signature fields to the container header, and for dumping the prefix and software headers so they may may be signed, and for signing those headers with the imprint keys. Signed-off-by: Dave Heller <hellerda@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: fixup warnings&build, include openssl-devel in CI dockerfiles] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Makefile: Update clean target for stbMichael Neuling2017-03-161-1/+1
| | | | | | | | stb leaves a bunch of files around even after clean. Fix this. Signed-off-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: use explicit TARGET rather than *.stb] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Dead code and data eliminationNicholas Piggin2017-02-061-1/+9
| | | | | | | | | | | | | | | | | | | | | Add an experimental option to do basic dead code and data elimintation with -ffunction-sections/-fdata-sections/--gc-sections. This saves about 80kB of text/data. Also remove the use of of -ffunction-sections by default. This predates git history, but I don't think there is a good reason to use it without --gc-sections. The GCC manual says: Only use these options when there are significant benefits from doing so. When you specify these options, the assembler and linker create larger object and executable files and are also slower. You cannot use gprof on all systems if you specify this option, and you may have problems with debugging if you specify both this option and -g. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Initial support for the ELFv2 ABINicholas Piggin2017-02-061-1/+10
| | | | | | | | | | | | Provide an experimental option to compile using ELFv2 ABI even on big endian builds. ELFv2 + BE is not officially supported by the toolchain, but it works quite well. It may be useful as a small step toward a little-endian build. This saves about 200kB of text/data. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Makefile: Disable stack protector due to gcc problemsBenjamin Herrenschmidt2016-12-221-3/+9
| | | | | | | | | | | | | | Depending on how it was built, gcc will use the canary from a global (works for us) or from the TLS (doesn't work for us and accesses random stuff instead). Fixing that would be tricky. There are talks of adding a gcc option to force use of globals, but in the meantime, disable the stack protector Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add -fno-stack-protector] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Makefile: Use -ffixed-r13Benjamin Herrenschmidt2016-12-221-0/+1
| | | | | | | We use r13 for our own stuff, make sure it's properly fixed Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* stb: create-container and wrap skiboot in Secure/Trusted Boot containerStewart Smith2016-11-241-0/+7
| | | | | | | | | | | | | | | We produce **UNSIGNED** skiboot.lid.stb and skiboot.lid.xz.stb as build artifacts These are suitable blobs for flashing onto Trusted Boot enabled op-build builds *WITH* the secure boot jumpers *ON* (i.e. *NOT* in secure mode). It's just enough of the Secure and Trusted Boot container format to make Hostboot behave. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Tested-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* travis-ci: use Docker containers for a matrix of platformsStewart Smith2016-11-021-1/+1
| | | | | | | | | | | | This greatly simplifies the build process for travis, yet makes it more powerful and increases coverage without increasing wall time to test. Travis has the concept of a build matrix, and we want to ensure we continue to build succesfully on a variety of platforms and compiler combinations. We limit what we run on some OSs to conserve vital sanity. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* extract-gcov: build with -m64 if compiler supports itStewart Smith2016-10-251-0/+1
| | | | | | | | | Fixes build break on 32bit ppc64 (e.g. PowerMac G5, where user space is mostly 32bit). Fixes: https://github.com/open-power/skiboot/issues/42 Reported-by: Andrei Warkenti <andrey.warkentin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb: add required container header structuresClaudio Carvalho2016-10-101-1/+2
| | | | | | | | | | | | | The full container header layout will be released soon either as a separate github project or as part of hostboot. This adds the secure boot header structures required by skiboot, and also implements some helper routines related to containers. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: Add unit test, print utility, use zero length arrays to ensure sizeof() works correctly, add parsing function] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* consolidate gcov flags into HOSTGCOVFLAGS for host binariesStewart Smith2016-09-021-0/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Don't set -fstack-protector-all unconditionallyBenjamin Herrenschmidt2016-08-181-1/+1
| | | | | | | | | We set it already in DEBUG builds and we use -fstack-protector-strong in release builds which provides most of the benefits and is more efficient. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Build host programs (and checks) with debug enabledBenjamin Herrenschmidt2016-08-181-0/+1
| | | | | | | | This enables memory poisoning in allocations and list checking among other things. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add global DEBUG make flagBenjamin Herrenschmidt2016-08-181-0/+4
| | | | | | | | And use it to control the stack checker, memory poisoning and CCAN's list debugging. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make: Add skiboot.lid.xz to make cleanVasant Hegde2016-08-101-1/+1
| | | | | | | Fixes: 5fc07eaa (Produce XZ compressed skiboot.lid as part of build) CC: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Produce XZ compressed skiboot.lid as part of buildStewart Smith2016-07-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | With a recent HostBoot change, we can have an XZ compressed PAYLOAD that's automagically detected (looking at magic numbers). This gives us three great benefits: 1) it's transparent, uncompressed skiboot.lid works everywhere 2) it lets us grow greater than 1MB binary, as long as we compress down to <1MB 3) It speeds up boot. We currently compress down to 230kb rather than 922kb, which is much quicker to read off flash. This patch produces skiboot.lid.xz alongside standard skiboot.lid. We currently use crc32 as this is supported by hostboot. Future HB may support crc64, but this seems to be disabled currently. Having CRC32 in the PAYLOAD partition also gives the advantage of error detection in PAYLOAD, which we previously did not have as it was not an ECC protected partition. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add .version to make cleanStewart Smith2016-06-071-1/+1
| | | | | | | | | .version is missing from the clean target. Fix this. Found with 'make; make clean; git clean -dfx' Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix 'make clean'Vasant Hegde2016-03-111-0/+1
| | | | | | | Include 'extract-gcov' in make clean. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'stable'Stewart Smith2015-12-031-2/+2
|\
| * Fix up extract-gcov for gcc > 4.8Stewart Smith2015-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The story of extract-gcov is not necessarily a pleasant one, involving GCC internals, padding of data structures, differences in data structures that are designed to change whenever GCC wants to and a strong desire to not implement a VFS in skiboot or some other streaming interface (and associated userspace and other such blergh). This patch makes us be all explicit about padding in the structures, enabling -Wpadding for extract-gcov.c. We also get all strict over the size of things and add support for gcc 5.1, which added an extra counter. There is likely GCC hacking in my future to make this a lot less fragile. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
| * libflash: Provide an internal parity implementation, to remove libgcc dependencyJeremy Kerr2015-12-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 8f5b8616, we introduced a dependency on libgcc, for the __builtin_parityl() function in commit 6cfaa3ba. However, if we're building with a biarch compiler, we may not have a libgcc available. This commit removes the __builtin_parityl() call, and replaces with the equivalent instructions, and removes the dependency on libgcc. Although this is untested, I have confirmed that the __builtin_parityl() functions emits the same instructions (on power7 and power8, with gcc-4.9) as we're using in the parity() function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: only use inline asm for skiboot build] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Update hack for building pflash for coverity scanStewart Smith2015-11-271-0/+4
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Enable building pflash for coverity (travis)Stewart Smith2015-11-171-0/+2
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Enable -Werror for -WformatStewart Smith2015-11-161-1/+1
| | | | | | | | | | | | | | We create our own inttypes.h to get the correct printf formatting for 64bit numbers. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | libflash: Provide an internal parity implementation, to remove libgcc dependencyJeremy Kerr2015-11-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 8f5b8616, we introduced a dependency on libgcc, for the __builtin_parityl() function in commit 6cfaa3ba. However, if we're building with a biarch compiler, we may not have a libgcc available. This commit removes the __builtin_parityl() call, and replaces with the equivalent instructions, and removes the dependency on libgcc. Although this is untested, I have confirmed that the __builtin_parityl() functions emits the same instructions (on power7 and power8, with gcc-4.9) as we're using in the parity() function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: only use inline asm for skiboot build] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Enable -fstack-protector-strong if supported by compilerStewart Smith2015-11-131-1/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Skip -std=gnu11 for sparseStewart Smith2015-11-091-0/+1
|/ | | | | | | Some versions of sparse (all?) don't support -std=gnu11 CFLAG, so filter it out when calling sparse. Doesn't affect non-sparse build Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* coverity scan through travis-ciStewart Smith2015-09-081-0/+4
| | | | | | Include a bit of a hack to build gard for coverity too Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix try-cflag makefile foo for ancient GCC (e.g. 4.4 shipped with RHEL6)Stewart Smith2015-08-181-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Use target CC for __GNUC__ version defines in extract-gcovStewart Smith2015-08-181-1/+4
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Enforce GNU 11 as default C dialectJoel Stanley2015-08-131-0/+2
| | | | | | | | | | | | We do not set a C version level, leaving it to the compiler to enforce whatever it saw fit. We require GCC 4.8 or above, which supports C11, and GCC 5.2 and clang 3.7 default to this version of the standard, so set it as the default. Signed-off-by: Joel Stanley <joel@jms.id.au> [stewart@linux.vnet.ibm.com: rework to use new try-cflag magic] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Newer GCC can automatically vectorise code. We do not want that.Stewart Smith2015-08-121-0/+6
| | | | | | | | Using vector instructions in skiboot needs care as we do not: a) enable them during boot b) save/restore the registers Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Test compiler flags before using, force abiv1 if neededStewart Smith2015-08-121-4/+19
| | | | | | | | | We will now test if the compiler supports a certain complier flag before using it (ones that have been introduced "recently"). We also add -mabi=elfv1 if compiler supports it (e.g. gcc 4.9) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* versioning: Unify all versioning to match skiboot versionsCyril Bur2015-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Previously there has been some uncertainty as to how separate binaries were to be versioned compared to the firmware version as they could change (or not change) out of sync with skiboot versioning. Historically pflash was born with its own version which didn't help the issue. It has been decided that make_version.sh should always return one version which is shall be the skiboot firmware version, external binaries can supply their own prefix which will be s/skiboot/$prefix/ but the default behaviour is the git tag versioning. The main reason for versioning here is so developers can identify which version of the code someone is running, versions which closly match the source tree are easiest to deal with. The idea with one version and every binary getting a bump regardless of changes is that there is a lot of shared code (libflash/libffs are a prime example) and even if an external binary isn't explicitly updated it is possible that changes to shared code may be missed. This patch simplifies make_version.sh which had been updated to deal with pflash- git tags. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Be explicit about wanting GCOV branch coverageStewart Smith2015-06-261-3/+3
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* force elf64-powerpc output format and big endian for linkerStewart Smith2015-06-051-0/+3
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Have make_version be able to generate versions for toolsCyril Bur2015-06-011-1/+1
| | | | | | | | | | | | | | | | The goal here is to be able to set tags for versions to some of the userspace tools that are kept in this repository. For this to work, make_version must be able to generate a version for a tag prefix not just the last tag in the repo. The new usage of make_version is to specify a tag prefix when calling it so that it knows what tag to look for. This option is ignored if not in a git repository and the current behaviour of relying on a .version file or $SKIBOOT_VERSION variable remains. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix HOSTEND check in Makefile.main for ppc64leStewart Smith2015-05-201-1/+1
| | | | | | | Otherwise we build with -DHAVE_BIG_ENDIAN on ppc64le, which is *NOT* what we want for HOSTCC on ppc64le. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fix extract-gcov compilation when using a build directoryCédric Le Goater2015-05-201-1/+1
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Don't exclude sections during linkStewart Smith2015-05-151-1/+1
| | | | | | We seem to need this to get the gcc generated ctors not discarded Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add extract-gcov utility for extracting gcda from skiboot dumpStewart Smith2015-05-151-1/+4
| | | | | | | | | | | | | | | | | | | | | If you dump the (relocated) skiboot memory (2MB, from 0x30000000) and point extract-gcov at it, you'll get a bunch of gcda files extracted in pwd that you can then feed to gcov to get real usage data. This is a different approach than, say, the linux kernel, which when built with gcov provides a debugfs interface to the gcda files that you can just copy with normal userspace utilities. For skiboot, I have no desire to add a VFS style interface and since if you're dealing with GCOV+skiboot you should probably pretty well know what you're doing, parsing the gcov data structures in userspace from a dump of memory is actually not too bad. You can grab this memory from linux, FSP, mambo or any debug mechanism that lets you dump out a section of physical memory. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Construct linked list of gcov data structuresStewart Smith2015-05-151-1/+1
| | | | | | | | The gcov constructors call __gcov_init() for each gcov covered file, which we then need to turn into a linked list of all gcov files so that we can traverse them later to pull out gcov profiling data. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud