Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-iv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-iv
  • Repository
Switch branch/tag
  • linux-iv
  • include
  • linux
  • compiler-gcc.h
Find file BlameHistoryPermalink
  • David Rientjes's avatar
    compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled · 9a04dbcf
    David Rientjes authored Jul 06, 2017
    The motivation for commit abb2ea7d ("compiler, clang: suppress
    warning for unused static inline functions") was to suppress clang's
    warnings about unused static inline functions.
    
    For configs without CONFIG_OPTIMIZE_INLINING enabled, such as any non-x86
    architecture, `inline' in the kernel implies that
    __attribute__((always_inline)) is used.
    
    Some code depends on that behavior, see
      https://lkml.org/lkml/2017/6/13/918:
    
      net/built-in.o: In function `__xchg_mb':
      arch/arm64/include/asm/cmpxchg.h:99: undefined reference to `__compiletime_assert_99'
      arch/arm64/include/asm/cmpxchg.h:99: undefined reference to `__compiletime_assert_99
    
    The full fix would be to identify these breakages and annotate the
    functions with __always_inline instead of `inline'.  But since we are
    late in the 4.12-rc cycle, simply carry forward the forced inlining
    behavior and work toward moving arm64, and other architectures, toward
    CONFIG_OPTIMIZE_INLINING behavior.
    
    Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1706261552200.1075@chino.kir.corp.google.com
    
    
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Reported-by: default avatarSodagudi Prasad <psodagud@codeaurora.org>
    Tested-by: default avatarSodagudi Prasad <psodagud@codeaurora.org>
    Tested-by: default avatarMatthias Kaehlcke <mka@chromium.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9a04dbcf