[all-commits] [llvm/llvm-project] 64da6e: [Driver][Gnu] -r: imply -nostdlib like GCC

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 13 11:25:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64da6eb06570adf38c96075de0116f6d29d5ba81
      https://github.com/llvm/llvm-project/commit/64da6eb06570adf38c96075de0116f6d29d5ba81
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-13 (Thu, 13 Jan 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/test/Driver/linux-cross.cpp

  Log Message:
  -----------
  [Driver][Gnu] -r: imply -nostdlib like GCC

See `gcc -dumpspecs` that -r essentially implies -nostdlib and suppresses
default -l* and crt*.o. The behavior makes sense because otherwise there will be
assuredly conflicting definitions when the relocatable output is linked into the
final executable/shared object.

Reviewed By: thesamesam, phosek

Differential Revision: https://reviews.llvm.org/D116843




More information about the All-commits mailing list