aboutsummaryrefslogtreecommitdiffstats
path: root/scripts (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-05-14docproc: print a comment about autogeneration for rst outputJani Nikula1-0/+7
Leave a hint to folks which file to edit instead. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14docproc: add support for reStructuredText format via --rst optionJani Nikula1-10/+80
Expect reStructuredText input and have kernel-doc produce reStructuredText output with the new --rst option. Also add --docbook option for completeness. If no option is given, default to reStructuredText if the input file has ".rst" extension, DocBook otherwise. Directives for reStructuredText use .. ! instead of just !, to make them reStructuredText comments. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14docproc: abstract terminating lines at first spaceJani Nikula1-13/+21
Cleaner code. Also fixes a bug when F or P directives didn't in fact have space. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14docproc: abstract docproc directive detectionJani Nikula1-10/+20
Helps follow-up work. No functional changes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14docproc: reduce unnecessary indentationJani Nikula1-46/+47
Improves clarity. No functional changes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14docproc: add variables for subcommand and filenameJani Nikula1-6/+11
Improves clarity. No functional changes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14kernel-doc: use rst C domain directives and references for typesJani Nikula1-10/+9
First, the headings for structs, enums and typedefs will be similar to functions. Second, this provides a kind of namespace for cross references. Third, and most importantly, the return and parameter types from .. c:function:: definitions will automagically become cross references to the documented types. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14kernel-doc: produce RestructuredText outputJonathan Corbet1-0/+233
If given the -rst flag, output will now be in RestructuredText. Various glitches to be worked out yet. In the end I decided not to use RST section headings within the kerneldoc comments. gpu.tmpl already has headings five levels deep; adding more is not going to bring clarity. This is really just Jani Nikula's asciidoc change with the serial numbers filed off. It's a hack job that doubtless needs a lot of cleaning up. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-14kernel-doc: rewrite usage description, remove duplicated commentsJani Nikula1-46/+37
Instead of having the kernel-doc usage in both comments and in output to the user, merge them all to one here document. While at it, imrove the text and make it pretty. Give shoemaker's children some shoes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2016-05-13ld-version: Drop the 4th and 5th version componentsMaciej W. Rozycki1-1/+1
... making upstream development binutils snapshots work as expected, e.g.: $ mips64el-linux-ld --version GNU ld (GNU Binutils) 2.20.1.20100303 [...] $ Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Acked-by: Michal Marek <mmarek@suse.cz> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-kbuild@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/12537/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-05-11kbuild: move -Wunused-const-variable to W=1 warning levelArnd Bergmann1-0/+1
gcc-6 started warning by default about variables that are not used anywhere and that are marked 'const', generating many false positives in an allmodconfig build, e.g.: arch/arm/mach-davinci/board-da830-evm.c:282:20: warning: 'da830_evm_emif25_pins' defined but not used [-Wunused-const-variable=] arch/arm/plat-omap/dmtimer.c:958:34: warning: 'omap_timer_match' defined but not used [-Wunused-const-variable=] drivers/bluetooth/hci_bcm.c:625:39: warning: 'acpi_bcm_default_gpios' defined but not used [-Wunused-const-variable=] drivers/char/hw_random/omap-rng.c:92:18: warning: 'reg_map_omap4' defined but not used [-Wunused-const-variable=] drivers/devfreq/exynos/exynos5_bus.c:381:32: warning: 'exynos5_busfreq_int_pm' defined but not used [-Wunused-const-variable=] drivers/dma/mv_xor.c:1139:34: warning: 'mv_xor_dt_ids' defined but not used [-Wunused-const-variable=] This is similar to the existing -Wunused-but-set-variable warning that was added in an earlier release and that we disable by default now and only enable when W=1 is set, so it makes sense to do the same here. Once we have eliminated the majority of the warnings for both, we can put them back into the default list. We probably want this in backport kernels as well, to allow building them with gcc-6 without introducing extra warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Lee Jones <lee.jones@linaro.org> Cc: stable@vger.kernel.org Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kbuild: fix if_change and friends to consider argument orderMasahiro Yamada1-6/+5
Currently, arg-check is implemented as follows: arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ $(filter-out $(cmd_$@), $(cmd_$(1))) ) This does not care about the order of arguments that appear in $(cmd_$(1)) and $(cmd_$@). So, if_changed and friends never rebuild the target if only the argument order is changed. This is a problem when the link order is changed. Apparently, obj-y += foo.o obj-y += bar.o and obj-y += bar.o obj-y += foo.o should be distinguished because the link order determines the probe order of drivers. So, built-in.o should be rebuilt when the order of objects is changed. This commit fixes arg-check to compare the old/current commands including the argument order. Of course, this change has a side effect; Kbuild will react to the change of compile option order. For example, "-DFOO -DBAR" and "-DBAR -DFOO" should give no difference to the build result, but false positive should be better than false negative. I am moving space_escape to the top of Kbuild.include just for a matter of preference. In practical terms, space_escape can be defined after arg-check because arg-check uses "=" flavor, not ":=". Having said that, collecting convenient variables in one place makes sense from the point of readability. Chaining "%%%SPACE%%%" to "_-_SPACE_-_" is also a matter of taste at this point. Actually, it can be arbitrary as long as it is an unlikely used string. The only problem I see in "%%%SPACE%%%" is that "%" is a special character in "$(patsubst ...)" context. This commit just uses "$(subst ...)" for arg-check, but I am fixing it now in case we might want to use it in $(patsubst ...) context in the future. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kconfig/symbol.c: handle choice_values that depend on 'm' symbolsDirk Gouders1-0/+14
If choices consist of choice_values of type tristate that depend on symbols set to 'm', those choice_values are not set to 'n' if the choice is changed from 'm' to 'y' (in which case only one active choice_value is allowed). Those values are also written to the config file causing modules to be built when they should not. The following config can be used to reproduce and examine the problem; with the frontend of your choice set "Choice 0" and "Choice 1" to 'm', then set "Tristate Choice" to 'y' and save the configuration: config modules boolean modules default y option modules config dependency tristate "Dependency" default m choice prompt "Tristate Choice" default choice0 config choice0 tristate "Choice 0" config choice1 tristate "Choice 1" depends on dependency endchoice This patch sets tristate choice_values' visibility that depend on symbols set to 'm' to 'n' if the corresponding choice is set to 'y'. This makes them disappear from the choice list and will also cause the choice_values' value set to 'n' in sym_calc_value() and as a result they are written as "not set" to the resulting .config file. Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Dirk Gouders <dirk@gouders.net> Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10builddeb: fix missing headers in linux-headers packageAzriel Samson1-1/+1
The kernel headers package (linux-headers) doesn't include header files from other architectures required to build out-of-tree modules. For e.g. on ARM64, opcodes.h includes the same file from ARM which causes the following error: ./arch/arm64/include/asm/opcodes.h:1:43: fatal error: ../../arm/include/asm/opcodes.h: No such file or directory compilation terminated. Signed-off-by: Azriel Samson <asamson@codeaurora.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10builddeb: include objtool binary in headers packageBjørn Mork1-0/+3
"objtool" is required for building external m dules if "Compile-time stack metadata validation" is enabled. Otherwise all builds based on the headers package fail with: make[1]: Entering directory '/usr/src/linux-headers-4.6.0-rc6' make[2]: *** No rule to make target 'tools/objtool/objtool', needed by 'foo.o'. Stop. Makefile:1598: recipe for target 'foo.ko' failed make[1]: *** [foo.ko] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.6.0-rc6' Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kbuild: fix adjust_autoksyms.sh for modules that need only one symbolNicolas Pitre1-1/+1
When only one symbol was listed and therefore the line didn't contain any space to separate multiple symbols, that symbol got ignored. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kbuild: fix ksym_dep_filter when multiple EXPORT_SYMBOL() on the same lineNicolas Pitre1-1/+1
In kernel/cgroup.c there is: #define SUBSYS(_x) \ DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_enabled_key); \ DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_on_dfl_key); \ EXPORT_SYMBOL_GPL(_x ## _cgrp_subsys_enabled_key); \ EXPORT_SYMBOL_GPL(_x ## _cgrp_subsys_on_dfl_key); The expansion of this macro causes multiple EXPORT_SYMBOL_GPL() instances to appear on the same preprocessor line output, confusing the sed script expecting only one of them per line. Unfortunately this can't be fixed nicely in the sed script as sed's regexp can't do non greedy matching. Fix this by turning any semicolon into a line break before filtering. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-10kconfig: add unexpected data itself to warningPaul Bolle1-1/+3
If the .config parser runs into unexpected data it emits warnings like: .config:6911:warning: unexpected data Add the unexpected data itself to this warning. That makes it easier to discover what is actually going wrong: .config:6911:warning: unexpected data: CONFOG_CHARGER_TPS65217=m Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-09Merge 4.6-rc7 into char-misc-testingGreg Kroah-Hartman1-24/+45
This resolves a merge issue with drivers/hv/ring_buffer.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-05modpost: fix module autoloading for OF devices with generic compatible propertyPhilipp Zabel1-24/+45
Since the wildcard at the end of OF module aliases is gone, autoloading of modules that don't match a device's last (most generic) compatible value fails. For example the CODA960 VPU on i.MX6Q has the SoC specific compatible "fsl,imx6q-vpu" and the generic compatible "cnm,coda960". Since the driver currently only works with knowledge about the SoC specific integration, it doesn't list "cnm,cod960" in the module device table. This results in the device compatible "of:NvpuT<NULL>Cfsl,imx6q-vpuCcnm,coda960" not matching the module alias "of:N*T*Cfsl,imx6q-vpu" anymore, whereas before commit 2f632369ab79 ("modpost: don't add a trailing wildcard for OF module aliases") it matched the module alias "of:N*T*Cfsl,imx6q-vpu*". This patch adds two module aliases for each compatible, one without the wildcard and one with "C*" appended. $ modinfo coda | grep imx6q alias: of:N*T*Cfsl,imx6q-vpuC* alias: of:N*T*Cfsl,imx6q-vpu Fixes: 2f632369ab79 ("modpost: don't add a trailing wildcard for OF module aliases") Link: http://lkml.kernel.org/r/1462203339-15340-1-git-send-email-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Cc: Javier Martinez Canillas <javier@osg.samsung.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: <stable@vger.kernel.org> [4.5+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-01checkkconfigsymbols.py: Fix typo in help messageAndreas Ziegler1-1/+1
Fix a typo in the help message for the -d parameter by removing one 'm'. Signed-off-by: Andreas Ziegler <andreas.ziegler@fau.de> Acked-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-27kbuild: adjust ksym_dep_filter for some cmd_* renamesNicolas Pitre1-4/+6
The following renames occurred recently: cmd_cc_i_c --> cmd_cpp_i_c cmd_as_s_S --> cmd_cpp_s_S The respective cc_*_c and as_*_S patterns no longer match the above therefore additional patterns are needed. Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-26localmodconfig: Fix whitespace repeat count after "tristate"Benjamin Poirier1-1/+1
Also recognize standalone "prompt". Before this patch we incorrectly identified some symbols as not having a prompt and potentially needing to be selected by something else. Note that this patch could theoretically change the resulting .config, causing it to have fewer symbols turned on. However, given the current set of Kconfig files, this situation does not occur because the symbols newly added to %prompts are absent from %selects. Link: http://lkml.kernel.org/r/1461696998-3953-1-git-send-email-bpoirier@suse.com Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-26localmodconfig: Reset certificate pathsBenjamin Poirier1-0/+34
When using `make localmodconfig` and friends, if the input config comes from a kernel that was built in a different environment (for example, the canonical case of using localmodconfig to trim a distribution kernel config) the key files for module signature checking will not be available and should be regenerated or omitted. Otherwise, the user will be faced with annoying errors when trying to build with the generated .config: make[1]: *** No rule to make target 'keyring.crt', needed by 'certs/x509_certificate_list'. Stop. Makefile:1576: recipe for target 'certs/' failed Link: http://lkml.kernel.org/r/1461696721-3001-1-git-send-email-bpoirier@suse.com Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-26localmodconfig: Add missing $ to reference a variableBenjamin Poirier1-1/+1
That is clearly what the original intention was. This does not change the output .config but it prevents some useless processing. ! eq "m" is changed to the simpler eq "y"; symbols with values other than m|y are not included in %orig_configs. Link: http://lkml.kernel.org/r/1460333193-16361-3-git-send-email-bpoirier@suse.com Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-26localmodconfig: Fix parsing of "help" textBenjamin Poirier1-1/+1
Help text may start with "help" or "---help---". This patch fixes read_kconfig() to recognize the second variant. This removes useless junk from %depends and %selects. That junk is due to help text that contains the words "selects" and "depends". Link: http://lkml.kernel.org/r/1460333193-16361-2-git-send-email-bpoirier@suse.com Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-26localmodconfig: Recognize more keywords that end a menu entryBenjamin Poirier1-2/+2
Based on the list in Documentation/kbuild/kconfig-language.txt This removes junk from %depends because parsing of a menu entry spilled over to another menu entry. Link: http://lkml.kernel.org/r/1460333193-16361-1-git-send-email-bpoirier@suse.com Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-26localmodconfig: Fix parsing of Kconfig "source" statementsBenjamin Poirier1-1/+1
The parameter of Kconfig "source" statements does not need to be quoted. The current regex causes many kconfig files to be skipped and hence, dependencies to be missed. Also fix the whitespace repeat count. Link: http://lkml.kernel.org/r/1459619722-13695-1-git-send-email-bpoirier@suse.com Tested-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-20kbuild: Get rid of KBUILD_STRMichal Marek1-4/+4
The compiler can accept -DKBUILD_MODNAME="foo", it's just a matter of quoting. That way, we reduce the gcc command line a bit. Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20kbuild: rename cmd_as_s_S to cmd_cpp_s_SMasahiro Yamada1-3/+3
This command just preprocesses .S files into .s files, so cmd_cpp_s_S seems more suitable. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20kbuild: rename cmd_cc_i_c to cmd_cpp_i_cMasahiro Yamada1-3/+3
This command just preprocesses .c files into .i files, so cmd_cpp_i_c seems more suitable. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20kbuild/mkspec: support 'update-bootloader'-based systemsJiri Kosina1-0/+5
When uninstalling kernel RPM, we're unconditionally calling "new-kernel-pkg --remove". This is useless on systems which are based on 'update-bootloader' script instead. Support update-bootloader removal method as well in case the script is present; contrary to new-kernel-pkg, this needs to be done in %postun, otherwise update-bootloader will refuse to remove entry for kernel for which the binary still exists. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20scripts: coccinelle: remove check to move constants to rightWolfram Sang1-171/+0
The header mentions this check depends on personal taste. I agree. Running coccicheck on patches before I apply them, this SmPL produced enough false positives for me that I'd rather see it removed. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20Coccinelle: setup_timer: Add space in front of parenthesesVaishali Thakkar1-2/+2
Add space in front of the offending parentheses to silent the parse error for older Coccinelle versions. This makes the rule usable with all Coccinelle versions. Reported-by: Nishanth Menon <nm@ti.com> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Fixes: c5eda8fd10c6 ("Coccinelle: Add api/setup_timer.cocci") Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-20scripts: genksyms: fix resource leakMaxim Zhukov1-0/+3
This commit fixed resource leak at func main Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2016-04-19Merge 4.6-rc4 into driver-core-nextGreg Kroah-Hartman1-1/+1
We want those fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-12debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usageNicolai Stange1-0/+67
In order to protect against file removal races, debugfs files created via debugfs_create_file() now get wrapped by a struct file_operations at their opening. If the original struct file_operations are known to be safe against removal races by themselves already, the proxy creation may be bypassed by creating the files through debugfs_create_file_unsafe(). In order to help debugfs users who use the common DEFINE_SIMPLE_ATTRIBUTE() + debugfs_create_file() idiom to transition to removal safe struct file_operations, the helper macro DEFINE_DEBUGFS_ATTRIBUTE() has been introduced. Thus, the preferred strategy is to use DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe() now. Introduce a Coccinelle script that searches for DEFINE_SIMPLE_ATTRIBUTE()-defined struct file_operations handed into debugfs_create_file(). Suggest to turn these usages into the DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe() pattern. Signed-off-by: Nicolai Stange <nicstange@gmail.com> Acked-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-07ARM: 8553/1: kallsyms: remove --page-offset command line optionArd Biesheuvel1-8/+0
The --page-offset command line option was only used for ARM, to filter symbol addresses below CONFIG_PAGE_OFFSET. This is no longer needed, so remove the functionality altogether. Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-04-07ARM: 8552/1: kallsyms: remove special lower address limit for CONFIG_ARMArd Biesheuvel1-4/+0
Now that we no longer emit .stubs symbols into a section VMA loaded at absolute address 0x1000, we can drop the ARM-specific override that sets a lower limit based on CONFIG_PAGE_OFFSET, below which symbols are filtered from the kallsyms output. Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-04-07ARM: 8555/1: kallsyms: ignore ARM mode switching veneersArd Biesheuvel1-0/+2
On ARM, the linker may emit veneers to deal with relative branch instructions that appear too far away from their targets. Since the second kallsyms pass results in an increase of the kernel size, it may result in additional veneers to be emitted, potentially affecting the output of kallsyms itself if these symbols are visible to it, and for that reason, symbols whose names end in '_veneer' are ignored explicitly. However, when building Thumb2 kernels, such veneers are named differently if they also incur a mode switch, and since they are not filtered by kallsyms, they may cause the build to fail. So filter symbols whose names end in '_from_arm' or '_from_thumb' as well. Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-04-06ASN.1: fix open failure check on headernameColin Ian King1-1/+1
The check for a failed open on headername is incorrectly checking on the out FILE pointer rather than the hdr. Fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David Howells <dhowells@redhat.com>
2016-03-31dtc: turn off dtc unit address warnings by defaultRob Herring1-0/+5
The newly added dtc warning to check DT unit-address without reg property and vice-versa generates lots of warnings. Turn off the check unless building with W=1 or W=2. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Michal Marek <mmarek@suse.com> Cc: linux-kbuild@vger.kernel.org
2016-03-29kbuild: create/adjust generated/autoksyms.hNicolas Pitre1-0/+101
Given the list of exported symbols needed by all modules, we can create a header file containing preprocessor defines for each of those symbols. Also, when some symbols are added and/or removed from the list, we can update the time on the corresponding files used as build dependencies for those symbols. And finally, if any symbol did change state, the corresponding source files must be rebuilt. The insertion or removal of an EXPORT_SYMBOL() entry within a module may create or remove the need for another exported symbol. This is why this operation has to be repeated until the list of needed exported symbols becomes stable. Only then the final kernel and modules link take place. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-29kbuild: add fine grained build dependencies for exported symbolsNicolas Pitre2-0/+28
Like with kconfig options, we now have the ability to compile in and out individual EXPORT_SYMBOL() declarations based on the content of include/generated/autoksyms.h. However we don't want the entire world to be rebuilt whenever that file is touched. Let's apply the same build dependency trick used for CONFIG_* symbols where the time stamp of empty files whose paths matching those symbols is used to trigger fine grained rebuilds. In our case the key is the symbol name passed to EXPORT_SYMBOL(). However, unlike config options, we cannot just use fixdep to parse the source code for EXPORT_SYMBOL(ksym) because several variants exist and parsing them all in a separate tool, and keeping it in synch, is not trivially maintainable. Furthermore, there are variants such as EXPORT_SYMBOL_GPL(pci_user_read_config_##size); that are instanciated via a macro for which we can't easily determine the actual exported symbol name(s) short of actually running the preprocessor on them. Storing the symbol name string in a special ELF section doesn't work for targets that output assembly or preprocessed source. So the best way is really to leverage the preprocessor by having it output actual symbol names anchored by a special sequence that can be easily filtered out. Then the list of symbols is simply fed to fixdep to be merged with the other dependencies. That implies the preprocessor is executed twice for each source file. A previous attempt relied on a warning pragma for each EXPORT_SYMBOL() instance that was filtered apart from stderr by the build system with a sed script during the actual compilation pass. Unfortunately the preprocessor/compiler diagnostic output isn't stable between versions and this solution, although more efficient, was deemed too fragile. Because of the lowercasing performed by fixdep, there might be name collisions triggering spurious rebuilds for similar symbols. But this shouldn't be a big issue in practice. (This is the case for CONFIG_* symbols and I didn't want to be different here, whatever the original reason for doing so.) To avoid needless build overhead, the exported symbol name gathering is performed only when CONFIG_TRIM_UNUSED_KSYMS is selected. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-29kbuild: de-duplicate fixdep usageNicolas Pitre2-15/+9
The generation and postprocessing of automatic dependency rules is duplicated in rule_cc_o_c, rule_as_o_S and if_changed_dep. Since this is not a trivial one-liner action, it is now abstracted under cmd_and_fixdep to simplify things and make future changes in this area easier. In the rule_cc_o_c and rule_as_o_S cases that means the order of some commands has been altered, namely fixdep and related file manipulations are executed earlier, but they didn't depend on those commands that now execute later. Signed-off-by: Nicolas Pitre <nico@linaro.org>
2016-03-29fixdep: accept extra dependencies on stdinNicolas Pitre1-15/+45
... and merge them in the list of parsed dependencies. Signed-off-by: Nicolas Pitre <nico@linaro.org>
2016-03-29scripts/dtc: Update to upstream version 53bf130b1cddRob Herring4-7/+31
Sync to upstream dtc commit 53bf130b1cdd ("libfdt: simplify fdt_node_check_compatible()"). This adds the following commits from upstream: 53bf130 libfdt: simplify fdt_node_check_compatible() c9d9121 Warn on node name unit-address presence/absence mismatch 2e53f9d Catch unsigned 32bit overflow when parsing flattened device tree offsets Signed-off-by: Rob Herring <robh@kernel.org>
2016-03-29kbuild: record needed exported symbols for modulesNicolas Pitre1-2/+11
Kernel modules are partially linked object files with some undefined symbols that are expected to be matched with EXPORT_SYMBOL() entries from elsewhere. Each .tmp_versions/*.mod file currently contains two line of text separated by a newline character. The first line has the actual module file name while the second line has a list of object files constituting that module. Those files are parsed by modpost (scripts/mod/sumversion.c), scripts/Makefile.modpost, scripts/Makefile.modsign, etc. Only the modpost utility cares about the second line while the others retrieve only the first line. Therefore we can add a third line to record the list of undefined symbols aka required EXPORT_SYMBOL() entries for each module into that file without breaking anything. Like for the second line, symbols are separated by a blank and the list is terminated with a newline character. To avoid needless build overhead, the undefined symbols extraction is performed only when CONFIG_TRIM_UNUSED_KSYMS is selected. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-24Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds8-9/+215
Pull kbuild misc updates from Michal Marek: "The non-critical part of kbuild for v4.6-rc1: - coccinelle cleanup and a new patch - make tags rule for kprobe helpers - make rpm fix to avoid spurious grub2 entries - make rpm support for %postun script (Fedora only at the moment)" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild/mkspec: clean boot loader configuration on rpm removal kbuild/mkspec: fix grub2 installkernel issue Coccinelle: Add api/setup_timer.cocci coccinelle: bugon: reduce rule applicability Coccinelle: pm_runtime: reduce rule applicability Coccinelle: array_size: reduce rule applicability Coccinelle: reduce rule applicability scripts/tags.sh: add regex to map kprobe helpers scripts/coccinelle: modernize &
2016-03-24Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuildLinus Torvalds2-6/+10
Pull kconfig updates from Michal Marek: "Just two kconfig commits this time: - kconfig Makefile fix for make 3.80 - Fix calculating symbols so that KCONFIG_ALLCONFIG=... does not disable CONFIG_MODULES silently" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: unbreak allmodconfig KCONFIG_ALLCONFIG=... scripts/kconfig: allow building with make 3.80 again