aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
AgeCommit message (Collapse)AuthorFilesLines
2016-08-10Make: Add skiboot.lid.xz to make cleanVasant Hegde1-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> (cherry picked from commit 742b7226124b140f129d181c07d23dbe36c18ea3) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-04Produce XZ compressed skiboot.lid as part of buildStewart Smith1-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>
2016-06-07Add .version to make cleanStewart Smith1-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>
2016-03-11Fix 'make clean'Vasant Hegde1-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>
2015-12-03Merge branch 'stable'Stewart Smith1-2/+2
2015-12-03Fix up extract-gcov for gcc > 4.8Stewart Smith1-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>
2015-12-02libflash: Provide an internal parity implementation, to remove libgcc dependencyJeremy Kerr1-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>
2015-11-27Update hack for building pflash for coverity scanStewart Smith1-0/+4
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-17Enable building pflash for coverity (travis)Stewart Smith1-0/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-16Enable -Werror for -WformatStewart Smith1-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>
2015-11-13libflash: Provide an internal parity implementation, to remove libgcc dependencyJeremy Kerr1-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>
2015-11-13Enable -fstack-protector-strong if supported by compilerStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09Skip -std=gnu11 for sparseStewart Smith1-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>
2015-09-08coverity scan through travis-ciStewart Smith1-0/+4
Include a bit of a hack to build gard for coverity too Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-18Fix try-cflag makefile foo for ancient GCC (e.g. 4.4 shipped with RHEL6)Stewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-18Use target CC for __GNUC__ version defines in extract-gcovStewart Smith1-1/+4
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-13Enforce GNU 11 as default C dialectJoel Stanley1-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>
2015-08-12Newer GCC can automatically vectorise code. We do not want that.Stewart Smith1-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>
2015-08-12Test compiler flags before using, force abiv1 if neededStewart Smith1-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>
2015-07-31versioning: Unify all versioning to match skiboot versionsCyril Bur1-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>
2015-06-26Be explicit about wanting GCOV branch coverageStewart Smith1-3/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-05force elf64-powerpc output format and big endian for linkerStewart Smith1-0/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-01Have make_version be able to generate versions for toolsCyril Bur1-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>
2015-05-20Fix HOSTEND check in Makefile.main for ppc64leStewart Smith1-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>
2015-05-20fix extract-gcov compilation when using a build directoryCédric Le Goater1-1/+1
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-15Don't exclude sections during linkStewart Smith1-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>
2015-05-15Add extract-gcov utility for extracting gcda from skiboot dumpStewart Smith1-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>
2015-05-15Construct linked list of gcov data structuresStewart Smith1-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>
2015-05-15Enable SKIBOOT_GCOV build option for building with profilingStewart Smith1-0/+4
Enable build options for building skiboot with GCOV profiling, including a skeleton -lgcov replacement in the form of core/gcov-profiling.c We don't actually have to do anything as part of the gcov routines, gcov auto generates everything we need. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-26sparse: add make variable C to run sparse when compiling skibootCédric Le Goater1-0/+3
As this is done on the Linux kernel, one can now run sparse using C=1 on the command line. The variable CF can be used to tune the sparse options. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-23Makefile: Link with libgccMichael Neuling1-2/+3
Add linking with libgcc so that we can access functions like __builtin_*. Final size of skiboot remains unchanged with this patch. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-01-28Makefile: Move -m options from CPPFLAGS to CFLAGS & AFLAGSJeremy Kerr1-3/+3
The -m options are for the compiler, not the preprocessor. Since we may execute CC without CPPFLAGS, move these options to CFLAGS & AFLAGS. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-18Run the CCAN unit tests and add to coverage-reportStewart Smith1-3/+3
With some fun Makefile rules, we can pick up all CCAN unit tests. We exclude the unit test source files from the lcov report itself. Add skeleton ccan config.h and tap.h that are enough for us to build and run the test suite. Currently, the minimalist versions should be fine (and we don't need CCAN configurator). Also includes -Werror fixes for ccan tests. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-15Fix makefile dependency generation, especially for HOSTCCStewart Smith1-1/+1
Instead of having individual rules to generate .d, add -MMD to HOSTCC parameters, and just include the generated .d files. This fixes a few weird dependency issues. Also, make the mambo hello_kernel test depend on skiboot.lid Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-10Enable -WerrorStewart Smith1-2/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Reduce -Wstack-usage down to 1024 bytes.Stewart Smith1-2/+2
We now warn on any function or stack frame that's going to use more than 1024 bytes of stack. The current biggest user with 912 bytes is p7ioc_init_ci_routing() Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-26fix Makefile when using a build directoryCédric Le Goater1-1/+2
When using a build directory different from the source tree, .C files and make_version.sh are not found : make: *** No rule to make target `libpore/p8_pore_table_gen_api_fixed.o', needed by `libpore/built-in.o'. make: *** No rule to make target `make_version.sh', needed by `version.c'. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-22Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt1-12/+24
2014-11-19don't echo version during make.Stewart Smith1-1/+0
whoops Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-19Fail build when SKIBOOT_VERSION not set and not in git treeskiboot-4.0Stewart Smith1-1/+6
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-19Implement skiboot versioningStewart Smith1-8/+16
We grab a version from git tags (or SKIBOOT_VERSION environment variable), optionally tack on EXTRA_VERSION (if from git) as well as add things to the git version number if we're ahead of the most recent tag or the tree is dirty. Also fix-up makefiles so that we don't have to rebuild version.c every time you run make. fsp attn area needed updating as we can have >40 character version strings. We also export the version string via device tree rather than just the gitid. For buildroot builds, setting SKIBOOT_VERSION environment variable to the tag you grab will do the correct thing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-18Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt1-5/+10
We use a double link technique, doing a first pass with a .o containing a dummy symbol map, then re-linking with a new .o Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Stack checking extensionsBenjamin Herrenschmidt1-1/+10
This patch adds: - Normal builds are done with -fstack-protector (we want to investigate using -fstack-protector-strong on gcc4.9 but for now we just use that - Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and will check the stack in mcount Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Quote built-in kernel path from MakefileBenjamin Herrenschmidt1-1/+1
Otherwise, if your path contains something like "linux-foo" then the "linux" part gets replaced by the preprocessor due to stupid built-ins. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-22Preliminary code coverage reporting infrastructureStewart Smith1-0/+8
Add support in core/test/Makefile.check to build -gcov binaries (with -lgcov and -fprofile-blah-blah) as well as some targets for producing lcov HTML code coverage reports. As part of this, I had to fix up an oddity in run-mem_region_init where that due to running under Valgrind, we'd be malloc()ed a heap with a small address, well inside the mem_regions we added but when not running under valgrind (e.g. for code coverage reporting) we would get a much larger address, outside this range and hit an assert. So, after fiddling with the memory stuff for this test, I think I have it right - it passes both under valgrind and not and does produce code coverage data. Currently, we're at this level of code coverage by unit tests: Hit Total Coverage Lines: 1936 2574 75.2 % Functions: 177 225 78.7 % Branches: 1243 2360 52.7 % The totals should largely be ignored due to the only code being counted is that linked into the unit tests (total LOC is ~50kLOC according to sloccount... so unit tests currently cover < 5%) Try the "make coverage-report" target, you'll get coverage-report directory with a LCOV HTML report Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-08-13Fix gitid generation when not in a git repositoryJoel Stanley1-1/+3
If skiboot doesn't live in a git repository, the makefile will go searching up the directory tree for one. To save confusion, only look in the source tree for the git repository. The gitid can be overridden by passing GIT_SHA=foo as an argument to make. This is useful for doing builds outside of a git tree, as buildroot does. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Pretty print objcopy in build outputJoel Stanley1-1/+1
The objcopy call was the odd one out in our build output. Before: [LD] hw/built-in.o [LD] skiboot.elf powerpc-linux-gnu-objcopy -O binary -S skiboot.elf skiboot.lid [NM] skiboot.map After: [LD] hw/built-in.o [LD] skiboot.elf [OBJCOPY] skiboot.lid [NM] skiboot.map Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Build with -ffreestanding so we can override printfStewart Smith1-3/+3
It turns out that GCC will use a builtin printf implementation that directly wraps vfprintf (or something), so when I tried to do my neat trick of overriding printf() with a call to vprlog() adding the timebase and default log level to the log message, it wouldn't work as GCC was being helpful. This change to compiler options will mean that other places where GCC is being helpful and using builtins rather than our implementations will go away, potentially helping/hurting us. We probably want to build with -ffreestanding anyway though. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+154
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>