29 Jan, 2015
1 commit
-
If the kernel is compiled with function tracer support the -pg compile option
is passed to gcc to generate extra code into the prologue of each function.This patch replaces the "open-coded" -pg compile flag with a CC_FLAGS_FTRACE
makefile variable which architectures can override if a different option
should be used for code generation.Acked-by: Steven Rostedt
Signed-off-by: Heiko Carstens
Signed-off-by: Martin Schwidefsky
02 Oct, 2014
1 commit
-
Kconfig never defines CONFIG_* as 'n'.
Now obj-n is only used in firmware/Makefile and it can be
replaced with obj-. No makefile uses lib-n.Let's rip off obj-n and lib-n.
Signed-off-by: Masahiro Yamada
Acked-by: Peter Foley
Signed-off-by: Michal Marek
19 Aug, 2014
1 commit
-
The comment in scripts/Makefile.build says as follows:
We would rather have a list of rules like
foo.o: $(foo-objs)
but that's not so easy, so we rather make all composite objects depend
on the set of all their partsThis commit makes it possible!
For example, assume a Makefile like this
obj-m = foo.o bar.o
foo-objs := foo1.o foo2.o
bar-objs := bar1.o bar2.oWithout this patch, foo.o depends on all of
foo1.o foo2.o bar1.o bar2.o.
It looks funny that foo.o is regenerated when bar1.c is updated.Now we can handle the dependency of foo.o and bar.o separately.
Signed-off-by: Masahiro Yamada
Signed-off-by: Michal Marek
30 Apr, 2014
1 commit
-
Signed-off-by: Masahiro Yamada
Signed-off-by: Michal Marek
17 Apr, 2014
1 commit
-
W=... provides extra gcc checks.
Having such code in scripts/Makefile.build results in the same flags
being added to KBUILD_CFLAGS multiple times becuase
scripts/Makefile.build is invoked every time Kbuild descends into
the subdirectories.Since the top Makefile is already too cluttered, this commit moves
all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
which is included from the top Makefile.Signed-off-by: Masahiro Yamada
CC: Sam Ravnborg
Signed-off-by: Michal Marek
10 Apr, 2014
1 commit
-
When compiling kernel with clang, disable warnings which are too noisy, and
add the clang flag catch-undefined-behavior.Signed-off-by: Jan-Simon Möller
Signed-off-by: Behan Webster
Signed-off-by: Mark Charlebois
Cc: PaX Team
14 Feb, 2014
1 commit
-
The asm-offset.c technique to fish data out of the assembler file
does not work with LTO. Just disable for the asm-offset.c build.Signed-off-by: Andi Kleen
Link: http://lkml.kernel.org/r/1391846481-31491-11-git-send-email-ak@linux.intel.com
Signed-off-by: H. Peter Anvin
20 Mar, 2013
1 commit
-
Pass symbol-prefix to genksyms instead of arch, so that the decision
what symbol prefix to use is kept in one place.Basically genksyms used to take a -a $ARCH argument and it used that to
determine whether to add an underscore symbol prefix. It's now changed
to take a -s $SYMBOL_PREFIX argument so that the caller decides whether
a symbol prefix is required. The build system then uses
CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX to determine whether to pass the
argument.Signed-off-by: James Hogan
Signed-off-by: Rusty Russell
08 Oct, 2012
1 commit
-
Add a simple ASN.1 grammar compiler. This produces a bytecode output that can
be fed to a decoder to inform the decoder how to interpret the ASN.1 stream it
is trying to parse.Action functions can be specified in the grammar by interpolating:
({ foo })
after a type, for example:
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING ({ do_key_data })
}The decoder is expected to call these after matching this type and parsing the
contents if it is a constructed type.The grammar compiler does not currently support the SET type (though it does
support SET OF) as I can't see a good way of tracking which members have been
encountered yet without using up extra stack space.Currently, the grammar compiler will fail if more than 256 bytes of bytecode
would be produced or more than 256 actions have been specified as it uses
8-bit jump values and action indices to keep space usage down.Signed-off-by: David Howells
Signed-off-by: Rusty Russell
26 Jan, 2012
1 commit
-
-Wmissing-field-initializers is too noisy to be useful on W=1. Let's
move it to W=2.Signed-off-by: Kirill A. Shutemov
Signed-off-by: Michal Marek
31 Aug, 2011
1 commit
-
Usage of these flags has been deprecated for nearly 4 years by:
commit f77bf01425b11947eeb3b5b54685212c302741b8
Author: Sam Ravnborg
Date: Mon Oct 15 22:25:06 2007 +0200kbuild: introduce ccflags-y, asflags-y and ldflags-y
Moreover, these flags (at least EXTRA_CFLAGS) have been documented for
command line use. By default, gmake(1) do not override command line
setting, so this is likely to result in build failure or unexpected
behavior.Do not advertise for its usage.
Cc: Sam Ravnborg
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Arnaud Lacombe
Signed-off-by: Michal Marek
25 May, 2011
1 commit
-
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
scripts/kallsyms.c: fix potential segfault
scripts/gen_initramfs_list.sh: Convert to a /bin/sh script
kbuild: Fix GNU make v3.80 compatibility
kbuild: Fix passing -Wno-* options to gcc 4.4+
kbuild: move scripts/basic/docproc.c to scripts/docproc.c
kbuild: Fix Makefile.asm-generic for um
kbuild: Allow to combine multiple W= levels
kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
Fix handling of backlash character in LINUX_COMPILE_BY name
kbuild: asm-generic support
kbuild: implement several W= levels
kbuild: Fix build with binutils <= 2.19
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros
kbuild: Use the deterministic mode of ar
kbuild: Call gzip with -n
kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile
Kconfig: improve KALLSYMS_ALL documentationFix up trivial conflict in Makefile
19 May, 2011
1 commit
-
Modifications to recordmcount must be performed on all object
files to stay consistent with what the kernel code may expect.
Add the recordmcount files to the main dependencies to make sure
any change to them causes a full recompile.Signed-off-by: Michal Marek
Link: http://lkml.kernel.org/r/20110517133646.GP13293@sepie.suse.cz
Signed-off-by: Steven Rostedt
17 May, 2011
1 commit
-
When mcount is called in a section that ftrace will not modify it into
a nop, we want to warn about this. But not warn about this always. Now
if the user builds the kernel with the option RECORDMCOUNT_WARN=1 then
the build will warn about mcount callers that are ignored and will just
waste execution time.Acked-by: Michal Marek
Cc: linux-kbuild@vger.kernel.org
Link: http://lkml.kernel.org/r/20110421023738.714956282@goodmis.org
Signed-off-by: Steven Rostedt
02 May, 2011
1 commit
-
Add support for make W=12, make W=123 and so on, to enable warnings from
multiple W= levels. Normally, make W= does not include warnings
from the previous level.Signed-off-by: Michal Marek
Acked-by: Sam Ravnborg
Reviewed-By: Valdis Kletnieks
29 Apr, 2011
1 commit
-
Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0
It produces more false positives than useful warnings.This can still be enabled using W=1
Signed-off-by: Dave Jones
Acked-by: Sam Ravnborg
Tested-by: Sam Ravnborg
Signed-off-by: Michal Marek
28 Apr, 2011
1 commit
-
Building a kernel with "make W=1" produces far too much noise to be
useful.Divide the warning options in three groups:
W=1 - warnings that may be relevant and does not occur too often
W=2 - warnings that occur quite often but may still be relevant
W=3 - the more obscure warnings, can most likely be ignoredWhen building the whole kernel, those levels produce:
W=1 - 4859 warnings
W=2 - 1394 warnings
W=3 - 86666 warningsrespectively. Warnings have been counted with Geert's script at
http://www.kernel.org/pub/linux/kernel/people/geert/linux-log/linux-log-summary.pl
Many warnings occur from .h files so fixing one file may have a nice
effect on the total number of warnings.With these changes I am actually tempted to try W=1 now and then.
Previously there was just too much noise.Borislav:
- make the W= levels exclusive
- move very noisy and making little sense for the kernel warnings to W=3
- drop -Woverlength-strings due to useless warning message
- copy explanatory text for the different warning levels to 'make help'
- recount warnings per levelSigned-off-by: Sam Ravnborg
Signed-off-by: Borislav Petkov
Cc: Dave Jones
Cc: Geert Uytterhoeven
Signed-off-by: Michal Marek
20 Apr, 2011
1 commit
-
The D option of ar is only available in newer versions.
Signed-off-by: Michal Marek
18 Apr, 2011
1 commit
-
Signed-off-by: Michal Marek
09 Mar, 2011
1 commit
-
Add a 'W=1' Makefile switch which adds additional checking per build
object.The idea behind this option is targeted at developers who, in the
process of writing their code, want to do the occasionalmake W=1 [target.o]
and let gcc do more extensive code checking for them. Then, they
could eyeball the output for valid gcc warnings about various
bugs/discrepancies which are not reported during the normal build
process.For more background information and a use case, read through this
thread: http://marc.info/?l=kernel-janitors&m=129802065918147&w=2Cc: Michal Marek
Cc: linux-kbuild@vger.kernel.org
Acked-by: Sam Ravnborg
Acked-by: Ingo Molnar
Signed-off-by: Borislav Petkov
Signed-off-by: Michal Marek
19 Nov, 2010
1 commit
-
cmd_record_mcount is used to locate the _mcount symbols in the object
files, only the files compiled with -pg has the _mcount symbol, so, it
is only needed for such files, but the current cmd_record_mcount is used
for all of the object files, so, we need to fix it and speed it up.Since -pg may be removed by the method used in kernel/trace/Makefile:
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))Or may be removed by the method used in arch/x86/kernel/Makefile:
CFLAGS_REMOVE_file.o = -pg
So, we must check the last variable stores the compiling flags, that is
c_flags(Please refer to cmd_cc_o_c and rule_cc_o_c defined in
scripts/Makefile.build) and since the CFLAGS_REMOVE_file.o is already
filtered in _c_flags(Please refer to scripts/Makefile.lib) and _c_flags
has less symbols, therefore, we only need to check _c_flags.---------------
Changes from v1:o Don't touch Makefile for CONFIG_FTRACE_MCOUNT_RECORD is enough
o Use _c_flags intead of KBUILD_CFLAGS to cover CONFIG_REMOVE_file.o = -pg
(feedback from Steven Rostedt )Acked-by: Michal Marek
Signed-off-by: Wu Zhangjin
LKML-Reference:[ changed if [ .. == .. ] to if [ .. = .. ] to handle dash environments ]
Signed-off-by: Steven Rostedt
22 Oct, 2010
1 commit
-
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (278 commits)
arm: remove machine_desc.io_pg_offst and .phys_io
arm: use addruart macro to establish debug mappings
arm: return both physical and virtual addresses from addruart
arm/debug: consolidate addruart macros for CONFIG_DEBUG_ICEDCC
ARM: make struct machine_desc definition coherent with its comment
eukrea_mbimxsd-baseboard: Pass the correct GPIO to gpio_free
cpuimx27: fix compile when ULPI is selected
mach-pcm037_eet: fix compile errors
Fixing ethernet driver compilation error for i.MX31 ADS board
cpuimx51: update board support
mx5: add cpuimx51sd module and its baseboard
iomux-mx51: fix GPIO_1_xx 's IOMUX configuration
imx-esdhc: update devices registration
mx51: add resources for SD/MMC on i.MX51
iomux-mx51: fix SD1 and SD2's iomux configuration
clock-mx51: rename CLOCK1 to CLOCK_CCGR for better readability
clock-mx51: factorize clk_set_parent and clk_get_rate
eukrea_mbimxsd: add support for DVI displays
cpuimx25 & cpuimx35: fix OTG port registration in host mode
i.MX31 and i.MX35 : fix errate TLSbo65953 and ENGcm09472
...
19 Oct, 2010
1 commit
-
When DYNAMIC_FTRACE is enabled and we use the C version of recordmcount,
all objects are run through the recordmcount program to create a
separate section that stores all the callers of mcount.The build process has a special file: scripts/mod/empty.o. This is
built from empty.c which is literally an empty file (except for a
single comment). This file is used to find information about the target
elf format, like endianness and word size.The problem comes up when we need to build recordmcount. The
build process requires that empty.o is built first. The build rules
for empty.o will try to execute recordmcount on the empty.o file.
We get an error that recordmcount does not exist.To avoid this recursion, the build file will skip running recordmcount
if the file that it is building is script/mod/empty.o.[ extra comment Suggested-by: Sam Ravnborg ]
Reported-by: Ingo Molnar
Tested-by: Ingo Molnar
Cc: Michal Marek
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Steven Rostedt
16 Oct, 2010
1 commit
-
The C version of recordmcount is compiled to a binary, which will
end up located in the objtree. If the kernel is built with O=path,
the srctree will not include the binary recordmcount caller.Cc: Michal Marek
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Steven Rostedt
15 Oct, 2010
1 commit
-
This patch adds the support for the C version of recordmcount and
compile times show ~ 12% improvement.After verifying this works, other archs can add:
HAVE_C_MCOUNT_RECORD
in its Kconfig and it will use the C version of recordmcount
instead of the perl version.Cc:
Cc: Michal Marek
Cc: linux-kbuild@vger.kernel.org
Cc: John Reiser
Signed-off-by: Steven Rostedt
02 Sep, 2010
1 commit
-
On ARM, we have two ABIs, and the ABI used is controlled via a config
option. Object files built with one ABI can't be merged with object
files built with the other ABI. So, record_mcount.pl needs to use the
same compiler flags as the kernel when generating the object file with
the mcount locations. Ensure this by passing CFLAGS to the script.Acked-by: Steven Rostedt
Signed-off-by: Rabin Vincent
Signed-off-by: Russell King
03 Aug, 2010
2 commits
-
It is now possible to assign options to AS and CC
on the command line - which is only used for built-in code.{A,C}FLAGS_KERNEL was used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC without overriding
the original value.Introduce a new set of variables KBUILD_{A,C}FLAGS_KERNEL
that is used by arch specific files and free up
{A,C}FLAGS_KERNEL so they can be assigned on
the command line.All arch Makefiles that used the old variables has been updated.
Signed-off-by: Sam Ravnborg
Cc: Tony Luck
Cc: Hirokazu Takata
Signed-off-by: Michal Marek -
It is now possible to assign options to AS, CC and LD
on the command line - which is only used when building modules.{A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC, LD when building modules
without overriding the original value.Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
that is used by arch specific files and free up
{A,C,LD}FLAGS_MODULE so they can be assigned on
the command line.All arch Makefiles that used the old variables has been updated.
Note: Previously we had a MODFLAGS variable for both
AS and CC. But in favour of consistency this was dropped.
So in some cases arch Makefile has one assignmnet replaced by
two assignmnets.Note2: MODFLAGS was not documented and is dropped
without any notice. I do not expect much/any breakage
from this.Signed-off-by: Sam Ravnborg
Cc: Denys Vlasenko
Cc: Haavard Skinnemoen
Cc: Mike Frysinger
Cc: Tony Luck
Cc: Geert Uytterhoeven
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt
Cc: Martin Schwidefsky
Cc: Chen Liqin
Acked-by: Mike Frysinger [blackfin]
Acked-by: Haavard Skinnemoen [avr32]
Signed-off-by: Michal Marek
04 Jun, 2010
1 commit
-
commit 37a8d9f67f18de1e2cbc7387311ce22d4dbff518 tried to combine some
duplicate code and accidentally broke how KBUILD_SYMTYPES workedThis fixes the code to match the original intention by the author who
originally added the code I believe.The fixes include:
- removing extra whitespaces in the if-statements
- moving the if-statement from around the -r to the -T
- adding a second arg to cmd_gensymtypes to simplify the options passed
to genksyms.Tested by instrumenting genksyms and seeing what options were passed in
during a make, KBUILD_SYMTYPES make, and when a foo.symref was created.Everything compiled and looked ok.
Signed-off-by: Don Zickus
Signed-off-by: Michal Marek
02 Feb, 2010
1 commit
-
This patch fixes the link error "built-in.o: no such file or directory".
The problem happens if "dirx/Makefile" contains only "obj-m += diry/
dirz/" and the empty "dirx/built-in.o" is missing. Adding $(subdir-m)
into check for builtin-target fixes this error.Signed-off-by: Jiafu He
Signed-off-by: Michal Marek
17 Dec, 2009
1 commit
-
MIPS and some other architectures need this argument to handle
big/little endian respectively.Signed-off-by: Wu Zhangjin
Cc: Nicholas Mc Guire
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: Frederic Weisbecker
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/674/
Acked-by: Steven Rostedt
Signed-off-by: Ralf Baechle
21 Sep, 2009
1 commit
-
Adding a reference to to x86's causes
the x86 linker script to have syntax errors, because the ALIGN and
ENTRY keywords get redefined to the assembly implementations of those.
One could fix this by adjusting the include structure, but I think any
solution based on that approach would be fragile.Currently, it is impossible when writing a header to do something
different for assembly files and linker scripts, even though there are
clearly cases where one wants them to define macros differently for
the two (ENTRY being an excellent example).
So I think the right solution here is to introduce a new preprocessor
definition, called LINKER_SCRIPT that is set along with __ASSEMBLY__
for linker scripts, and to use that to not define ALIGN and ENTRY in
linker scripts.
I suspect we'll find other uses for this mechanism in
the future.Signed-off-by: Tim Abbott
Signed-off-by: Sam Ravnborg
20 Sep, 2009
3 commits
-
Albin Tonnerre reported:
Bash 4 filters out variables which contain a dot in them.
This happends to be the case of CPPFLAGS_vmlinux.lds.
This is rather unfortunate, as it now causes
build failures when using SHELL=/bin/bash to compile,
or when bash happens to be used by make (eg when it's /bin/sh)Remove the common definition of CPPFLAGS_vmlinux.lds by
pushing relevant stuff to either Makefile.build or the
arch specific kernel/Makefile where we build the linker script.This is also nice cleanup as we move the information out where
it is used.Notes for the different architectures touched:
arm - we use an already exported symbol
cris - we use a config symbol aleady available
[Not build tested]
mips - the jiffies complexity has moved to vmlinux.lds.S where we need it.
Added a few variables to CPPFLAGS - they are only used by
the linker script.
[Not build tested]
powerpc - removed assignment that is not needed
[not build tested]
sparc - simplified it using $(BITS)
um - introduced a few new exported variables to deal with this
xtensa - added options to CPP invocation
[not build tested]Cc: Albin Tonnerre
Cc: Russell King
Cc: Mikael Starvik
Cc: Jesper Nilsson
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: "David S. Miller"
Cc: Jeff Dike
Cc: Chris Zankel
Signed-off-by: Sam Ravnborg -
When this script fails the build should fail too. Otherwise there
are mysterious build failures later.Signed-off-by: Andi Kleen
Signed-off-by: Andrew Morton
Signed-off-by: Sam Ravnborg -
I had some problems with record_mcount in the Makefile and it was hard
to track down. Echo it by default to make it easier to diagnose.Signed-off-by: Andi Kleen
Signed-off-by: Andrew Morton
Signed-off-by: Sam Ravnborg
19 Apr, 2009
1 commit
-
Following patch introduce support for setting options
to gcc that has effect for current directory and all
subdirectories.The typical use case are an architecture or a subsystem that
decide to cover all files with -Werror.
Today alpha, mips and sparc uses -Werror in almost all their
Makefile- with subdir-ccflag-y it is now simpler to do so
as only the top-level directories needs to be covered.Likewise if we decide to cover a full subsystem such
as net/ with -Werror this is done by adding a single
line to net/Makefile.Signed-off-by: Sam Ravnborg
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: Thomas Gleixner
03 Feb, 2009
1 commit
15 Jan, 2009
1 commit
-
This reverts commit ad7a953c522ceb496611d127e51e278bfe0ff483.
And commit: ("allow stripping of generated symbols under CONFIG_KALLSYMS_ALL")
9bb482476c6c9d1ae033306440c51ceac93ea80cThese stripping patches has caused a set of issues:
1) People have reported compatibility issues with binutils due to
lack of support for `--strip-unneeded-symbols' with objcopy 2.15.92.0.2
Reported by: Wenji
2) ccache and distcc no longer works as expeced
Reported by: Ted, Roland, + others
3) The installed modules increased a lot in size
Reported by: Ted, Davej + othersReported-by: Wenji Huang
Reported-by: "Theodore Ts'o"
Reported-by: Dave Jones
Reported-by: Roland McGrath
Signed-off-by: Sam Ravnborg
14 Jan, 2009
1 commit
-
In IA64, module build and kernel build use different option.
Make recordmcount.pl differentiate the two cases.Signed-off-by: Shaohua Li
Acked-by: Sam Ravnborg
Signed-off-by: Steven Rostedt
Signed-off-by: Ingo Molnar
29 Dec, 2008
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (25 commits)
allow stripping of generated symbols under CONFIG_KALLSYMS_ALL
kbuild: strip generated symbols from *.ko
kbuild: simplify use of genksyms
kernel-doc: check for extra kernel-doc notations
kbuild: add headerdep used to detect inclusion cycles in header files
kbuild: fix string equality testing in tags.sh
kbuild: fix make tags/cscope
kbuild: fix make incompatibility
kbuild: remove TAR_IGNORE
setlocalversion: add git-svn support
setlocalversion: print correct subversion revision
scripts: improve the decodecode script
scripts/package: allow custom options to rpm
genksyms: allow to ignore symbol checksum changes
genksyms: track symbol checksum changes
tags and cscope support really belongs in a shell script
kconfig: fix options to check-lxdialog.sh
kbuild: gen_init_cpio expands shell variables in file names
remove bashisms from scripts/extract-ikconfig
kbuild: teach mkmakfile to be silent
...