[PATCH] D73664: [PowerPC][Future] Add Support For Functions That Do Not Use A TOC.

Nathan Chancellor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 13:02:52 PDT 2020


nathanchance added a comment.

For what it's worth, this patch introduces a regression when building the Linux kernel's `powernv_defconfig` with Clang and linking with `ld.bfd` (for some reason, `ld.lld` is fine):

  $ make -j$(nproc) -s AR=llvm-ar ARCH=powerpc CC=clang CROSS_COMPILE=powerpc64le-linux-gnu- NM=llvm-nm O=out/ppc64le OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size READELF=llvm-readelf STRIP=llvm-strip distclean powernv_defconfig zImage.epapr
  ...
  arch/powerpc/kernel/head_64.o: in function `ppc64_runlatch_on_trampoline':
  (.text+0x2b00): call to `__ppc64_runlatch_on' lacks nop, can't restore toc; (toc save/adjust stub)
  powerpc64le-linux-gnu-ld: final link failed: bad value
  ...
  
  $ make -j$(nproc) -s AR=llvm-ar ARCH=powerpc CC=clang CROSS_COMPILE=powerpc64le-linux-gnu- LD=ld.lld NM=llvm-nm O=out/ppc64le OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size READELF=llvm-readelf STRIP=llvm-strip distclean powernv_defconfig zImage.epapr; echo ${?}
  ...
  0
  
  $ clang --version | head -n1
  ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project 6c4b40def77622a5cf62a219ef4af63dc876e144)
  
  $ powerpc64le-linux-gnu-ld --version | head -n1
  GNU ld (GNU Binutils) 2.34
  
  $ git show -s --format=short | cat
  commit 5364abc57993b3bf60c41923cb98a8f1a594e749
  Merge: 854e80bcfdafb f09d3174f002e
  Author: Linus Torvalds <torvalds at linux-foundation.org>
  
      Merge tag 'arc-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Relevant source files I believe:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/process.c?h=5364abc57993b3bf60c41923cb98a8f1a594e749#n2106

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/exceptions-64s.S?h=5364abc57993b3bf60c41923cb98a8f1a594e749#n2182

My PowerPC knowledge is non-existent so I do not know if this is expected behavior but I would appreciate some input. Cheers!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73664/new/

https://reviews.llvm.org/D73664





More information about the llvm-commits mailing list