aboutsummaryrefslogtreecommitdiff
path: root/util/lint
AgeCommit message (Collapse)Author
2012-11-27build system: Split linking into multiple stepsPatrick Georgi
After collecting dependencies for ramstage, add an intermediate step in which object files are linked per directory. The results are then linked into the final binary. This reduces the maximum command line length and might also help with future use of LTO linking. Also adapt the lint test for build dir handling, since printall doesn't provide individual object files for ramstage anymore. Change-Id: Ie40febd8c1eaf4609944eedeab46d870639e53df Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/1911 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-10-05lint: Get absolute path in compare_outputZheng Bao
The classes in $(top)/Makefile uses $(abspath) to get the path. The $(abspath) can not resolve symlink. If the coreboot is located in a symlink directory, the run_printall produces the absolute path while the $PWD just produces the path with symlink. Use `pwd -P` to get the abs path. Change-Id: Icf6b364d030c14a9c78991767b17dafc701baf3c Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/1551 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-10-04lint: Stop searching when one GNUmake is foundZheng Bao
After make 3.81 is copied to /usr/local/bin, the old make 3.80, which doesn't work for coreboot, will replace $MAKE with gnumake. That is not we want. Change-Id: I87fbe95c70228a22f2c233ff071df29639b63726 Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/1550 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-09-28lint: Add template for mktemp to meet BSD requirementsZheng Bao
Change-Id: I86cecf6aee1fcb682cb32bd0f03e014fd1afe594 Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/1549 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-09-17lint: Dont highlight the matching text in grepZheng Bao
Sometimes we like to make grep auto-highlight the match text by setting the GREP_OPTIONS. This will make the compare_output in lint-002 catch the difference between 2 strings which text are same but color are different. Override the GREP_OPTIONS. Change-Id: Ia257214fe5149e084e8eac3fb551a494eaa46ae6 Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/1526 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-08-04Make the device tree available in the rom stageStefan Reinauer
We thought about two ways to do this change. The way we decided to try was to 1. drop all ops from devices in romstage 2. constify all devices in romstage (make them read-only) so we can compile static.c into romstage 3. the device tree "devices" can be used to read configuration from the device tree (and nothing else, really) 4. the device tree devices are accessed through struct device * in romstage only. device_t stays the typedef to int in romstage 5. Use the same static.c file in ramstage and romstage We declare structs as follows: ROMSTAGE_CONST struct bus dev_root_links[]; ROMSTAGE_CONST is const in romstage and empty in ramstage; This forces all of the device tree into the text area. So a struct looks like this: static ROMSTAGE_CONST struct device _dev21 = { #ifndef __PRE_RAM__ .ops = 0, #endif .bus = &_dev7_links[0], .path = {.type=DEVICE_PATH_PCI,{.pci={ .devfn = PCI_DEVFN(0x1c,3)}}}, .enabled = 0, .on_mainboard = 1, .subsystem_vendor = 0x1ae0, .subsystem_device = 0xc000, .link_list = NULL, .sibling = &_dev22, #ifndef __PRE_RAM__ .chip_ops = &southbridge_intel_bd82x6x_ops, #endif .chip_info = &southbridge_intel_bd82x6x_info_10, .next=&_dev22 }; Change-Id: I722454d8d3c40baf7df989f5a6891f6ba7db5727 Signed-off-by: Ronald G. Minnich <rminnich@chromium.org> Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/1398 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-04lint: Avoid downloading blobs repositoryPatrick Georgi
The stable lint test "build-dir-handling" ran the build system in a way that made it download the blobs repository. Since this is part of the pre-commit hook, this might have kicked in with users desiring not to have them. Change-Id: I44a00137352c5966ff7fe2a030673276f6803908 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/999 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-17lint: tighten whitespace check some morePatrick Georgi
Don't test executable files nor object files, even if the former might render the test useless on win32 (executable bit isn't well defined there). Change-Id: Ifb6fc83243289d266f439316c14b6b009f8da5fc Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/890 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-05Ignore .exe files in whitespace testPatrick Georgi
On windows, we sometimes require getopt executables, which end up in the source tree. These shouldn't break the whitespace test. Change-Id: Iaf86e38b94605bebb69a317e00f932eefcf468b9 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/863 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-03-09Fix lint-stable checkin hooks on MacOS XStefan Reinauer
- wc adds a number of leading spaces which broke cut - sed can't replace spaces with new lines, so use tr for that. - make sure directories are created if they're not there. Change-Id: Ia0db059683abe3d97b0ab6feaece660a1f4e5079 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/774 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
2012-03-07Move C labels to start-of-linePatrick Georgi
Also mark the corresponding lint test stable. Change-Id: Ib7c9ed88c5254bf56e68c01cdbd5ab91cd7bfc2f Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/772 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-03-07lint: test that labels begin at start-of-linePatrick Georgi
Some attempt at enforcing style Change-Id: Ibbfb86402ecc57e8db6c3857c8e0193085ed4fc2 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/771 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-03-01lint: create two classes of tests, stable and devPatrick Georgi
We have tests that pass (and should be enforced soonish) and those that don't pass yet (and thus shouldn't break the build). The plan is simple: As soon as a test passes, it's marked stable so things remain that way. "make lint" runs all tests, "make lint-stable" runs only those that shouldn't fail. Change-Id: Iaa85d71141606d9756e29b37c7a34c2a15e573ac Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/681 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-03-01Fix lint test for build directoriesPatrick Georgi
config files are rename()d, which fails across filesystem borders. So force temporary config files in current directory. Change-Id: I583c2ab9a822a6f99f838778aa17ffd2d47eaed1 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/680 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-02-17Remove whitespace.Patrick Georgi
Fix issues reported by new lint test. Change-Id: I077a829cb4a855cbb3b71b6eb5c66b2068be6def Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/646 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-02-17lint: Add test for whitespace issues in the codePatrick Georgi
So far it tests for trailing whitespace. "Upstream" files (bison/flex's .?_shipped, kconfig, vendorcode) are ignored. Change-Id: I7af1954d537fd05f06cd210ac130dac87892159b Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/645 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-07-07Fix lint-002-build-dir-handlingPatrick Georgi
That lint test requires some Kconfig defaults and uses allyesconfig for that. Unfortunately that also draws in ccache and scanbuild support, which significantly change the behaviour of the toplevel Makefile. Notably, the ccache support breaks if no ccache is installed. Change-Id: I17cbb7974be33fc077e5cbd5fb616a5b00a47d97 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/80 Tested-by: build bot (Jenkins)
2011-05-23exclude src/vendorcode from GPLv2 license checks.Stefan Reinauer
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6609 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2011-05-21Add regression test for build directory handling to make lint targetPatrick Georgi
A couple of scenarios that were fixed in the last few revisions are tested to ensure that it's easy to determine breakage. Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6607 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-11-19Add test to check for up-to-date GPL license headers to lint.Patrick Georgi
"make lint" should not stop after first failed test. Improve "make lint" output. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6097 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-11-18Make lint script executable, otherwise invocation fails.Uwe Hermann
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6093 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-11-18lint tests can now describe what they do (for the benefit ofPatrick Georgi
make lint users) Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6092 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-11-18Set locale to POSIX to avoid problems with invalid 8bit characterPatrick Georgi
sequences. Increase scanning speed. Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6090 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-11-12Consensus seems that this is wanted, integrated into the tree somehow.Patrick Georgi
This isn't hooked up anywhere, so won't affect anything, except for developers trying to remove configuration #defines. Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6065 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1