[all-commits] [llvm/llvm-project] 527b0f: [Driver] Allow -mnop-mcount for SystemZ and -mfent...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Dec 22 00:04:04 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 527b0f8c7448707aa6b8159e6e4707a49f1dcb87
      https://github.com/llvm/llvm-project/commit/527b0f8c7448707aa6b8159e6e4707a49f1dcb87
  Author: Fangrui Song <maskray at google.com>
  Date:   2019-12-22 (Sun, 22 Dec 2019)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/mcount.c
    A clang/test/Driver/mfentry.c

  Log Message:
  -----------
  [Driver] Allow -mnop-mcount for SystemZ and -mfentry for X86 and SystemZ

gcc/config/{i386,s390} support -mnop-mcount. We currently only support
-mnop-mcount for SystemZ. The function attribute "mnop-mcount" is
ignored on other targets.

gcc/config/{i386,s390} support -mfentry. We currently only support
-mfentry for X86 and SystemZ. TargetOpcode::FENTRY_CALL is not handled
on other targets.

  % clang -target aarch64 -pg -mfentry a.c -c
  fatal error: error in backend: Not supported instr: <MCInst 21>

-mfentry, -mrecord-mcount, and -mnop-mcount were invented for Linux
ftrace. Linux uses $(call cc-option-yn,-mrecord-mcount) to detect if the
specific feature is available. Reject unsupported features so that Linux
build system will not wrongly consider them available and cause
build/runtime failures.

Note, GCC has stricter checks that we do not implement, e.g. -fpic/-fpie
-fnop-mcount is not allowed on x86, -fpic/-fpie -mfentry is not allowed
on x86-32.




More information about the All-commits mailing list