1. 13 3月, 2017 2 次提交
  2. 07 3月, 2017 3 次提交
  3. 06 3月, 2017 1 次提交
  4. 04 3月, 2017 31 次提交
  5. 03 3月, 2017 1 次提交
    • L
      give up on gcc ilog2() constant optimizations · 474c9015
      Linus Torvalds 提交于
      gcc-7 has an "optimization" pass that completely screws up, and
      generates the code expansion for the (impossible) case of calling
      ilog2() with a zero constant, even when the code gcc compiles does not
      actually have a zero constant.
      
      And we try to generate a compile-time error for anybody doing ilog2() on
      a constant where that doesn't make sense (be it zero or negative).  So
      now gcc7 will fail the build due to our sanity checking, because it
      created that constant-zero case that didn't actually exist in the source
      code.
      
      There's a whole long discussion on the kernel mailing about how to work
      around this gcc bug.  The gcc people themselevs have discussed their
      "feature" in
      
         https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
      
      but it's all water under the bridge, because while it looked at one
      point like it would be solved by the time gcc7 was released, that was
      not to be.
      
      So now we have to deal with this compiler braindamage.
      
      And the only simple approach seems to be to just delete the code that
      tries to warn about bad uses of ilog2().
      
      So now "ilog2()" will just return 0 not just for the value 1, but for
      any non-positive value too.
      
      It's not like I can recall anybody having ever actually tried to use
      this function on any invalid value, but maybe the sanity check just
      meant that such code never made it out in public.
      Reported-by: NLaura Abbott <labbott@redhat.com>
      Cc: John Stultz <john.stultz@linaro.org>,
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      474c9015
  6. 02 3月, 2017 2 次提交
    • S
      selftests: lib.mk Fix individual test builds · e53aff45
      Shuah Khan 提交于
      In commit a8ba798b ("selftests: enable O and KBUILD_OUTPUT"), added
      support to generate compile targets in a user specified directory. OUTPUT
      variable controls the location which is undefined when tests are built in
      the test directory or with "make -C tools/testing/selftests/x86".
      
      make -C tools/testing/selftests/x86/
      make: Entering directory '/lkml/linux_4.11/tools/testing/selftests/x86'
      Makefile:44: warning: overriding recipe for target 'clean'
      ../lib.mk:51: warning: ignoring old recipe for target 'clean'
      gcc -m64 -o /single_step_syscall_64 -O2 -g -std=gnu99 -pthread -Wall  single_step_syscall.c -lrt -ldl
      /usr/bin/ld: cannot open output file /single_step_syscall_64: Permission denied
      collect2: error: ld returned 1 exit status
      Makefile:50: recipe for target '/single_step_syscall_64' failed
      make: *** [/single_step_syscall_64] Error 1
      make: Leaving directory '/lkml/linux_4.11/tools/testing/selftests/x86'
      
      Same failure with "cd tools/testing/selftests/x86/;make" run.
      
      Fix this with a change to lib.mk to define OUTPUT to be the pwd when
      MAKELEVEL is 0. This covers both cases mentioned above.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      e53aff45
    • J
      objtool, modules: Discard objtool annotation sections for modules · e390f9a9
      Josh Poimboeuf 提交于
      The '__unreachable' and '__func_stack_frame_non_standard' sections are
      only used at compile time.  They're discarded for vmlinux but they
      should also be discarded for modules.
      
      Since this is a recurring pattern, prefix the section names with
      ".discard.".  It's a nice convention and vmlinux.lds.h already discards
      such sections.
      
      Also remove the 'a' (allocatable) flag from the __unreachable section
      since it doesn't make sense for a discarded section.
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Jessica Yu <jeyu@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: d1091c7f ("objtool: Improve detection of BUG() and other dead ends")
      Link: http://lkml.kernel.org/r/20170301180444.lhd53c5tibc4ns77@trebleSigned-off-by: NIngo Molnar <mingo@kernel.org>
      e390f9a9