1
0
Fork 0
alistair23-linux/arch/powerpc
Nathan Chancellor afd954170f powerpc: Don't add -mabi= flags when building with Clang
[ Upstream commit 465bfd9c44 ]

When building pseries_defconfig, building vdso32 errors out:

  error: unknown target ABI 'elfv1'

This happens because -m32 in clang changes the target to 32-bit,
which does not allow the ABI to be changed.

Commit 4dc831aa88 ("powerpc: Fix compiling a BE kernel with a
powerpc64le toolchain") added these flags to fix building big endian
kernels with a little endian GCC.

Clang doesn't need -mabi because the target triple controls the
default value. -mlittle-endian and -mbig-endian manipulate the triple
into either powerpc64-* or powerpc64le-*, which properly sets the
default ABI.

Adding a debug print out in the PPC64TargetInfo constructor after line
383 above shows this:

  $ echo | ./clang -E --target=powerpc64-linux -mbig-endian -o /dev/null -
  Default ABI: elfv1

  $ echo | ./clang -E --target=powerpc64-linux -mlittle-endian -o /dev/null -
  Default ABI: elfv2

  $ echo | ./clang -E --target=powerpc64le-linux -mbig-endian -o /dev/null -
  Default ABI: elfv1

  $ echo | ./clang -E --target=powerpc64le-linux -mlittle-endian -o /dev/null -
  Default ABI: elfv2

Don't specify -mabi when building with clang to avoid the build error
with -m32 and not change any code generation.

-mcall-aixdesc is not an implemented flag in clang so it can be safely
excluded as well, see commit 238abecde8 ("powerpc: Don't use gcc
specific options on clang").

pseries_defconfig successfully builds after this patch and
powernv_defconfig and ppc44x_defconfig don't regress.

Reviewed-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
[mpe: Trim clang links in change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191119045712.39633-2-natechancellor@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-04 19:18:23 +01:00
..
boot kbuild: remove ar-option and KBUILD_ARFLAGS 2019-10-01 09:20:33 +09:00
configs powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs 2019-08-30 09:56:30 +10:00
crypto treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
include powerpc/fixmap: Use __fix_to_virt() instead of fix_to_virt() 2020-01-04 19:18:14 +01:00
kernel powerpc/book3s/mm: Update Oops message to print the correct translation in use 2020-01-04 19:18:10 +01:00
kvm KVM: PPC: Book3S HV: Fix regression on big endian hosts 2019-12-31 16:46:21 +01:00
lib powerpc/memcpy: Fix stack corruption for smaller sizes 2019-09-12 09:27:00 +10:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mm powerpc/book3s64/hash: Add cond_resched to avoid soft lockup warning 2020-01-04 19:17:12 +01:00
net powerpc/bpf: Fix tail call implementation 2019-11-02 00:32:26 +01:00
oprofile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
perf powerpc/perf: fix imc allocation failure handling 2019-08-20 21:22:20 +10:00
platforms powerpc/pseries/cmm: Implement release() function for sysfs device 2020-01-04 19:17:51 +01:00
purgatory treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
sysdev powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts 2019-12-17 19:56:42 +01:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 19:16:56 +01:00
xmon powerpc: Avoid clang warnings around setjmp and longjmp 2019-12-17 19:56:47 +01:00
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kconfig powerpc updates for 5.4 2019-09-20 11:48:06 -07:00
Kconfig.debug powerpc/xmon: add read-only mode 2019-05-03 02:54:57 +10:00
Makefile powerpc: Don't add -mabi= flags when building with Clang 2020-01-04 19:18:23 +01:00
Makefile.postlink kbuild: add $(BASH) to run scripts with bash-extension 2019-09-04 22:54:13 +09:00