1. 22 7月, 2016 1 次提交
    • T
      scripts: Fix size mismatch of kexec_purgatory_size · 21532b9e
      Tautschnig, Michael 提交于
      bin2c is used to create a valid C file out of a binary file where two
      symbols will be globally defined: <name> and <name>_size. <name> is
      passed as the first parameter of the host binary.
      
      Building using goto-cc reported that the purgatory binary code (the only
      current user of this utility) declares kexec_purgatory_size as 'size_t'
      where bin2c generate <name>_size to be 'int' so in a 64-bit host where
      sizeof(size_t) > sizeof(int) this type mismatch will always yield the
      wrong value for big-endian architectures while for little-endian it will
      be wrong if the object laid in memory directly after
      kexec_purgatory_size contains non-zero value at the time of reading.
      
      This commit changes <name>_size to be size_t instead.
      
      Note:
      
      Another way to fix the problem is to change the type of
      kexec_purgatory_size to be 'int' as there's this check in code:
      (kexec_purgatory_size <= 0)
      Signed-off-by: NMichael Tautschnig <tautschn@amazon.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Acked-by: NDave Young <dyoung@redhat.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      21532b9e
  2. 19 7月, 2016 2 次提交
    • A
      Kbuild: don't add obj tree in additional includes · db547ef1
      Arnd Bergmann 提交于
      When building with separate object directories and driver specific
      Makefiles that add additional header include paths, Kbuild adjusts
      the gcc flags so that we include both the directory in the source
      tree and in the object tree.
      
      However, due to another bug I fixed earlier, this did not actually
      include the correct directory in the object tree, so we know that
      we only really need the source tree here. Also, including the
      object tree sometimes causes warnings about nonexisting directories
      when the include path only exists in the source.
      
      This changes the logic to only emit the -I argument for the srctree,
      not for objects. We still need both $(srctree)/$(src) and $(obj)
      though, so I'm adding them manually.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      db547ef1
    • A
      Kbuild: don't add ../../ to include path · b999596b
      Arnd Bergmann 提交于
      When we build with O=objdir and objdir is directly below the source tree,
      $(srctree) becomes '..'.
      
      When a Makefile adds a CFLAGS option like -Ipath/to/headers and
      we are building with a separate object directory, Kbuild tries to
      add two -I options, one for the source tree and one for the object
      tree. An absolute path is treated as a special case, and don't add
      this one twice. This also normally catches -I$(srctree)/$(src)
      as $(srctree) usually is an absolute directory like /home/arnd/linux/.
      
      The combination of the two behaviors however results in an invalid
      path name to be included: we get both ../$(src) and ../../$(src),
      the latter one pointing outside of the source tree, usually to a
      nonexisting directory. Building with 'make W=1' makes this obvious:
      
      cc1: error: ../../arch/arm/mach-s3c24xx/include: No such file or directory [-Werror=missing-include-dirs]
      
      This adds another special case, treating path names starting with ../
      like those starting with / so we don't try to prefix that with
      $(srctree).
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      b999596b
  3. 20 6月, 2016 1 次提交
    • W
      kbuild: setlocalversion: print error to STDERR · 78283edf
      Wolfram Sang 提交于
      I tried to use 'make O=...' from an unclean source tree. This triggered
      the error path of setlocalversion. But by printing to STDOUT, it created
      a broken localversion which then caused another (unrelated) error:
      
      "4.7.0-rc2Error: kernelrelease not valid - run make prepare to update it" exceeds 64 characters
      
      After printing to STDERR, the true build error gets displayed later:
      
        /home/wsa/Kernel/linux is not clean, please run 'make mrproper'
        in the '/home/wsa/Kernel/linux' directory.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      78283edf
  4. 08 6月, 2016 4 次提交
    • E
      Add sancov plugin · 543c37cb
      Emese Revfy 提交于
      The sancov gcc plugin inserts a __sanitizer_cov_trace_pc() call
      at the start of basic blocks.
      
      This plugin is a helper plugin for the kcov feature. It supports
      all gcc versions with plugin support (from gcc-4.5 on).
      It is based on the gcc commit "Add fuzzing coverage support" by Dmitry Vyukov
      (https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=revision&revision=231296).
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      543c37cb
    • E
      Add Cyclomatic complexity GCC plugin · 0dae776c
      Emese Revfy 提交于
      Add a very simple plugin to demonstrate the GCC plugin infrastructure. This GCC
      plugin computes the cyclomatic complexity of each function.
      
      The complexity M of a function's control flow graph is defined as:
      M = E - N + 2P
      where
      E = the number of edges
      N = the number of nodes
      P = the number of connected components (exit nodes).
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      0dae776c
    • E
      GCC plugin infrastructure · 6b90bd4b
      Emese Revfy 提交于
      This patch allows to build the whole kernel with GCC plugins. It was ported from
      grsecurity/PaX. The infrastructure supports building out-of-tree modules and
      building in a separate directory. Cross-compilation is supported too.
      Currently the x86, arm, arm64 and uml architectures enable plugins.
      
      The directory of the gcc plugins is scripts/gcc-plugins. You can use a file or a directory
      there. The plugins compile with these options:
       * -fno-rtti: gcc is compiled with this option so the plugins must use it too
       * -fno-exceptions: this is inherited from gcc too
       * -fasynchronous-unwind-tables: this is inherited from gcc too
       * -ggdb: it is useful for debugging a plugin (better backtrace on internal
          errors)
       * -Wno-narrowing: to suppress warnings from gcc headers (ipa-utils.h)
       * -Wno-unused-variable: to suppress warnings from gcc headers (gcc_version
          variable, plugin-version.h)
      
      The infrastructure introduces a new Makefile target called gcc-plugins. It
      supports all gcc versions from 4.5 to 6.0. The scripts/gcc-plugin.sh script
      chooses the proper host compiler (gcc-4.7 can be built by either gcc or g++).
      This script also checks the availability of the included headers in
      scripts/gcc-plugins/gcc-common.h.
      
      The gcc-common.h header contains frequently included headers for GCC plugins
      and it has a compatibility layer for the supported gcc versions.
      
      The gcc-generate-*-pass.h headers automatically generate the registration
      structures for GIMPLE, SIMPLE_IPA, IPA and RTL passes.
      
      Note that 'make clean' keeps the *.so files (only the distclean or mrproper
      targets clean all) because they are needed for out-of-tree modules.
      
      Based on work created by the PaX Team.
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      6b90bd4b
    • E
      Shared library support · 24403874
      Emese Revfy 提交于
      Infrastructure for building independent shared library targets.
      
      Based on work created by the PaX Team.
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      24403874
  5. 24 5月, 2016 17 次提交
  6. 21 5月, 2016 9 次提交
  7. 20 5月, 2016 3 次提交
  8. 19 5月, 2016 1 次提交
  9. 16 5月, 2016 1 次提交
  10. 14 5月, 2016 1 次提交