08 Apr, 2014

1 commit

  • Pull kbuild changes from Michal Marek:
    - cleanups in the main Makefiles and Documentation/DocBook/Makefile
    - make O=... directory is automatically created if needed
    - mrproper/distclean removes the old include/linux/version.h to make
    life easier when bisecting across the commit that moved the version.h
    file

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: docbook: fix the include error when executing "make help"
    kbuild: create a build directory automatically for out-of-tree build
    kbuild: remove redundant '.*.cmd' pattern from make distclean
    kbuild: move "quote" to Kbuild.include to be consistent
    kbuild: docbook: use $(obj) and $(src) rather than specific path
    kbuild: unconditionally clobber include/linux/version.h on distclean
    kbuild: docbook: specify KERNELDOC dependency correctly
    kbuild: docbook: include cmd files more simply
    kbuild: specify build_docproc as a phony target

    Linus Torvalds
     

30 Mar, 2014

1 commit


14 Feb, 2014

1 commit


08 Apr, 2013

1 commit

  • The kbuild's ld-option function is broken because
    the command
    $(CC) /dev/null -c -o "$$TMPO"
    does not create object file!

    I have used a relatively old mips gcc 3.4.6 cross-compiler
    and a relatively new gcc 4.7.2 to check this fact
    but the results are the same.

    EXAMPLE:
    $ rm /tmp/1.o
    $ mips-linux-gcc /dev/null -c -o /tmp/1.o
    mips-linux-gcc: /dev/null: linker input file unused because linking not done
    $ ls -la /tmp/1.o
    ls: cannot access /tmp/1.o: No such file or directory

    We can easily fix the problem by adding
    the '-x c' compiler option.

    EXAMPLE:
    $ rm /tmp/1.o
    $ mips-linux-gcc -x c /dev/null -c -o /tmp/1.o
    $ ls -la /tmp/1.o
    -rw-r--r-- 1 antony antony 778 Apr 2 20:40 /tmp/1.o

    Also fix wrong ld-option example.

    Signed-off-by: Antony Pavlov
    Signed-off-by: Michal Marek

    Antony Pavlov
     

08 Oct, 2012

1 commit

  • Pull kbuild fixes from Michal Marek:
    "Here are two fixes I intended to send after v3.6-rc7, but failed to do
    so. So please pull them for v3.7-rc1 and they will be picked up by
    stable.

    The first one fixes gcc -x syntax in various build-time
    tests, which icecream and possible other gcc wrappers did not
    understand (and yes, icecream is going to be fixed as well).

    The second one fixes make tar-pkg so that unpacking the tarball does
    not replace the /lib -> /usr/lib symlink on recent Fedora releases."

    * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: Fix gcc -x syntax
    kbuild: Do not package /boot and /lib in make tar-pkg

    Linus Torvalds
     

06 Oct, 2012

1 commit

  • The call if_changed mechanism does not work when the command contains
    backslashes. This basically is an issue with lzo and bzip2 compressed
    kernels. The compressed binaries do not contain the uncompressed image
    size, so these use size_append to append the size. This results in
    backslashes in the executed command. With this if_changed always
    detects a change in the command and rebuilds the compressed image even
    if nothing has changed.

    Fix this by escaping backslashes in make-cmd

    Signed-off-by: Sascha Hauer
    Signed-off-by: Jan Luebbe
    Cc: Sam Ravnborg
    Cc: Bernhard Walle
    Cc: Michal Marek
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sascha Hauer
     

03 Oct, 2012

1 commit

  • The correct syntax for gcc -x is "gcc -x assembler", not
    "gcc -xassembler". Even though the latter happens to work, the former
    is what is documented in the manual page and thus what gcc wrappers
    such as icecream do expect.

    This isn't a cosmetic change. The missing space prevents icecream from
    recognizing compilation tasks it can't handle, leading to silent kernel
    miscompilations.

    Besides me, credits go to Michael Matz and Dirk Mueller for
    investigating the miscompilation issue and tracking it down to this
    incorrect -x parameter syntax.

    Signed-off-by: Jean Delvare
    Acked-by: Ingo Molnar
    Cc: stable@vger.kernel.org
    Cc: Bernhard Walle
    Cc: Michal Marek
    Cc: Ralf Baechle
    Signed-off-by: Michal Marek

    Jean Delvare
     

25 Mar, 2012

1 commit

  • "echo -e" is a GNU extension. When cross-compiling the kernel on a
    BSD-like operating system (Mac OS X in my case), this doesn't work.

    One could install a GNU version of echo, put that in the $PATH before
    the system echo and use "/usr/bin/env echo", but the solution with
    printf is simpler.

    Since it is no disadvantage on Linux, I hope that gets accepted even if
    cross-compiling the Linux kernel on another Unix operating system is
    quite a rare use case.

    Signed-off-by: Bernhard Walle
    Andreas Bießmann
    Signed-off-by: Michal Marek

    Bernhard Walle
     

10 Jun, 2011

1 commit


16 May, 2011

1 commit

  • Based on a patch by Rabin Vincent.

    Fix building with KBUILD_NOCMDDEP=1, which currently does not work
    because it does not build built-in.o with no dependencies:

    LD fs/notify/built-in.o
    ld: cannot find fs/notify/dnotify/built-in.o: No such file or directory
    ld: cannot find fs/notify/inotify/built-in.o: No such file or directory
    ld: cannot find fs/notify/fanotify/built-in.o: No such file or directory

    Reported-and-tested-by: Rabin Vincent
    Signed-off-by: Michal Marek

    Michal Marek
     

03 May, 2011

1 commit

  • Starting with 4.4, gcc will happily accept -Wno- in the
    cc-option test and complain later when compiling a file that has some
    other warning. This rather unexpected behavior is intentional as per
    http://gcc.gnu.org/PR28322, so work around it by testing for support of
    the opposite option (without the no-). Introduce a new Makefile function
    cc-disable-warning that does this and update two uses of cc-option in
    the toplevel Makefile.

    Reported-and-tested-by: Stephen Rothwell
    Signed-off-by: Michal Marek

    Michal Marek
     

20 Apr, 2011

1 commit


12 Dec, 2009

1 commit

  • To make it easier for module-init-tools and scripts like mkinitrd to
    distinguish builtin and missing modules, install a modules.builtin file
    listing all builtin modules. This is done by generating an additional
    config file (tristate.conf) with tristate options set to uppercase 'Y'
    or 'M'. If we source that config file, the builtin modules appear in
    obj-Y.

    Signed-off-by: Michal Marek

    Michal Marek
     

12 Oct, 2009

1 commit


20 Sep, 2009

3 commits

  • The arch/*/boot/Makefile use cc-options to check for GCC command options
    and cc-options use the hardened specs when checking for GCC command
    options. When -fPIE is pass to cc1 it can't use -ffreestanding or
    -fno-toplevel-reorder. Then it fail to build stuff with -ffreestanding
    and -fno-toplevel-reorder.

    Thanks to Fredric Johansson for finding the main problem behind a failed
    build using a hardened toolchain.

    Signed-off-by: Magnus Granberg
    Signed-off-by: Jory A. Pratt
    Cc: Fredric Johansson
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Cc:
    Signed-off-by: Sam Ravnborg

    Jory A. Pratt
     
  • ld-option is used to check if $(LD) supports a specific option.

    Based on patch from Andi Kleen.

    Cc: Andi Kleen
    Signed-off-by: Sam Ravnborg
    First use is to check if option -X is supported (upcoming patch).
    Theis is ne

    Sam Ravnborg
     
  • ld-option is misnamed as it test options to gcc, not to ld.
    Renamed it to reflect this.

    Cc: Andi Kleen
    Cc: Roland McGrath
    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

04 Dec, 2008

3 commits

  • Convert a few echos in the build system to new $(kecho) so we get correct
    output according to build verbosity.

    Signed-off-by: Mike Frysinger
    [sam: added kecho in a few more places for O=... builds]
    Signed-off-by: Sam Ravnborg

    Mike Frysinger
     
  • There is a bunch of places in the build system where we do 'echo' to show
    some nice status lines. This means we still get output when running in
    silent mode. So declare a new KECHO variable that only does 'echo' when we
    are in a suitable verbose build mode.

    Signed-off-by: Mike Frysinger
    [sam: added Documentation]
    Signed-off-by: Sam Ravnborg

    Mike Frysinger
     
  • When adding extra -I options with O=... we could
    end up in a situation where there were no parameters to -I.
    So we had a commandline that looked like this:

    ... -I -Wall ...

    This had the undesired side effect that gcc assumed "-Wall"
    was a path to look for include files so this options was
    effectively ignored.

    This happens only when we build the generated module.mod.c files
    as part of the final modules builds and is as such harmless
    with current kbuild.
    This bug was exposed when we rearranged the options to gcc.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

10 Sep, 2008

1 commit

  • David Sanders wrote:

    > I'm getting this error:
    > as: unrecognized option `-mtune=generic32'
    > I have binutils 2.17.

    Use -c instead of -S in cc-option and cc-option-yn, so we can probe
    options related to the assembler.

    Signed-off-by: H. Peter Anvin
    Cc: Sam Ravnborg
    Cc: kbuild devel
    Signed-off-by: Ingo Molnar

    H. Peter Anvin
     

12 Feb, 2008

1 commit

  • When make -s support were added to filechk to
    combination created with make V=1 were not
    covered.
    Fix it by explicitly cover this case too.

    Signed-off-by: Sam Ravnborg
    Cc: Mike Frysinger

    Sam Ravnborg
     

09 Feb, 2008

1 commit


20 Oct, 2007

1 commit

  • cc-cross-prefix is useful for the architecture that like
    to provide a default CROSS_COMPILE value,
    but may have several to select between.

    Sample usage:

    ifneq ($(SUBARCH),$(ARCH))
    ifeq ($(CROSS_COMPILE),)
    CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
    endif
    endif

    Actual usage by the different archs will taken care of later.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

16 Oct, 2007

1 commit

  • The variable AFLAGS is a wellknown variable and the usage by
    kbuild may result in unexpected behaviour.
    On top of that several people over time has asked for a way to
    pass in additional flags to gcc.

    This patch replace use of AFLAGS with KBUILD_AFLAGS all over
    the tree.

    Patch was tested on following architectures:
    alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k, s390

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

15 Oct, 2007

1 commit

  • The variable CFLAGS is a wellknown variable and the usage by
    kbuild may result in unexpected behaviour.
    On top of that several people over time has asked for a way to
    pass in additional flags to gcc.

    This patch replace use of CFLAGS with KBUILD_CFLAGS all over the
    tree and enabling one to use:
    make CFLAGS=...
    to specify additional gcc commandline options.

    One usecase is when trying to find gcc bugs but other
    use cases has been requested too.

    Patch was tested on following architectures:
    alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k

    Test was simple to do a defconfig build, apply the patch and check
    that nothing got rebuild.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

17 Jul, 2007

1 commit


10 Feb, 2007

1 commit

  • This adds the remaining changes which should have been part of the
    review process.

    - the define command is inappropriate (it's primarily for rule
    definitions)
    - execute commands in the current dir as all other commands
    - .*.tmp (but not .*.null) files are also removed up by "make clean"
    - printf has other side effects, just use "echo -e"
    - proper quoting
    - proper indentation

    Signed-off-by: Roman Zippel
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

09 Feb, 2007

1 commit

  • Michal Ostrowski points out what the real problem was: the spaces at the
    start of the definition of the 'checker-shell' make function.

    Cc: Michal Ostrowski
    Acked-by: David Miller
    Acked-by: Geert Uytterhoeven
    Acked-by: Oleg Verych
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

08 Feb, 2007

2 commits


07 Feb, 2007

1 commit


11 Dec, 2006

1 commit

  • The as-instr/ld-option need to create temporary files, but create them in the
    output directory, when compiling external modules. Reformat them a bit and
    use $(CC) instead of $(AS) as the former is used by kbuild to assemble files.

    Signed-off-by: Roman Zippel
    Cc: Andi Kleen
    Cc: Jan Beulich
    Cc: Sam Ravnborg
    Cc:
    Cc: Horst Schirmeier
    Cc: Daniel Drake
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

26 Sep, 2006

2 commits

  • Current gcc generates calls not jumps to noreturn functions. When that happens the
    return address can point to the next function, which confuses the unwinder.

    This patch works around it by marking asynchronous exception
    frames in contrast normal call frames in the unwind information. Then teach
    the unwinder to decode this.

    For normal call frames the unwinder now subtracts one from the address which avoids
    this problem. The standard libgcc unwinder uses the same trick.

    It doesn't include adjustment of the printed address (i.e. for the original
    example, it'd still be kernel_math_error+0 that gets displayed, but the
    unwinder wouldn't get confused anymore.

    This only works with binutils 2.6.17+ and some versions of H.J.Lu's 2.6.16
    unfortunately because earlier binutils don't support .cfi_signal_frame

    [AK: added automatic detection of the new binutils and wrote description]

    Signed-off-by: Jan Beulich
    Signed-off-by: Andi Kleen

    Jan Beulich
     
  • ... instead of using a CONFIG option. The config option still controls
    if the resulting executable actually has unwind information.

    This is useful to prevent compilation errors when users select
    CONFIG_STACK_UNWIND on old binutils and also allows to use
    CFI in the future for non kernel debugging applications.

    Cc: jbeulich@novell.com
    Cc: sam@ravnborg.org

    Signed-off-by: Andi Kleen

    Andi Kleen
     

25 Sep, 2006

2 commits

  • tell why a a target got build
    enabled by make V=2
    Output (listed in the order they are checked):
    (1) - due to target is PHONY
    (2) - due to target missing
    (3) - due to: file1.h file2.h
    (4) - due to command line change
    (5) - due to missing .cmd file
    (6) - due to target not in $(targets)
    (1) We always build PHONY targets
    (2) No target, so we better build it
    (3) Prerequisite is newer than target
    (4) The command line stored in the file named dir/.target.cmd
    differed from actual command line. This happens when compiler
    options changes
    (5) No dir/.target.cmd file (used to store command line)
    (6) No dir/.target.cmd file and target not listed in $(targets)
    This is a good hint that there is a bug in the kbuild file

    This patch is inspired by a patch from: Milton Miller

    Cc: Milton Miller
    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Consistently decide when to rebuild a target across all of
    if_changed, if_changed_dep, if_changed_rule.
    PHONY targets are now treated alike (ignored) for all targets

    While add it make Kbuild.include almost readable by factoring out a few
    bits to some common variables and reuse this in Makefile.build.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

01 Aug, 2006

2 commits

  • The possibility to specify an optional parameter did not work out as
    expected and it was not used - so remove the possibility.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • The latest toolchains can produce a new ELF section in DSOs and
    dynamically-linked executables. The new section ".gnu.hash" replaces
    ".hash", and allows for more efficient runtime symbol lookups by the
    dynamic linker. The new ld option --hash-style={sysv|gnu|both} controls
    whether to produce the old ".hash", the new ".gnu.hash", or both. In some
    new systems such as Fedora Core 6, gcc by default passes --hash-style=gnu
    to the linker, so that a standard invocation of "gcc -shared" results in
    producing a DSO with only ".gnu.hash". The new ".gnu.hash" sections need
    to be dealt with the same way as ".hash" sections in all respects; only the
    dynamic linker cares about their contents. To work with older dynamic
    linkers (i.e. preexisting releases of glibc), a binary must have the old
    ".hash" section. The --hash-style=both option produces binaries that a new
    dynamic linker can use more efficiently, but an old dynamic linker can
    still handle.

    The new section runs afoul of the custom linker scripts used to build vDSO
    images for the kernel. On ia64, the failure mode for this is a boot-time
    panic because the vDSO's PT_IA_64_UNWIND segment winds up ill-formed.

    This patch addresses the problem in two ways.

    First, it mentions ".gnu.hash" in all the linker scripts alongside ".hash".
    This produces correct vDSO images with --hash-style=sysv (or old tools),
    with --hash-style=gnu, or with --hash-style=both.

    Second, it passes the --hash-style=sysv option when building the vDSO
    images, so that ".gnu.hash" is not actually produced. This is the most
    conservative choice for compatibility with any old userland. There is some
    concern that some ancient glibc builds (though not any known old production
    system) might choke on --hash-style=both binaries. The optimizations
    provided by the new style of hash section do not really matter for a DSO
    with a tiny number of symbols, as the vDSO has. If someone wants to use
    =gnu or =both for their vDSO builds and worry less about that
    compatibility, just change the option and the linker script changes will
    make any choice work fine.

    Signed-off-by: Roland McGrath
    Cc: "Luck, Tony"
    Cc: Kyle McMartin
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Jeff Dike
    Cc: Andi Kleen
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

01 Jul, 2006

1 commit

  • kbuild used $¤(*F to get filename of target without extension.
    This was used in several places all over kbuild, but introducing
    make -rR broke his for all cases where we specified full path to
    target/prerequsite. It is assumed that make -rR disables old style
    suffix-rules which is why is suddenly failed.

    ia64 was impacted by this change because several div* routines in
    arch/ia64/lib are build using explicit paths and then kbuild failed.

    Thanks to David Mosberger-Tang for an explanation
    what was the root-cause and for testing on ia64.

    This patch also fixes two uses of $(*F) in arch/um

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg