From 1bb8eb56ef2a2116347106c2df381e7d6801f328 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Nov 2019 19:35:09 +0000 Subject: [PATCH] libclang_rt: enable on powerpc* Summary: Enable on powerpc64 and in lib/libclang_rt/Makefile change MACHINE_CPUARCH to MACHINE_ARCH because on powerpc64 MACHINE_ARCH==MACHINE_CPUARCH so the 32-bit library overwrites 64-bit library during installworld. This patch doesn't enable any other libclang_rt libraries because they need to be separately ported. I have verified that games/julius (which fails on powerpc64 elfv2 without this change because of no libclang_rt profiling library) builds. Test Plan: Ship it, test on powerpc and powerpcspe Submitted by: pkubaj Reviewed by: dim, jhibbits Differential Revision: https://reviews.freebsd.org/D22425 MFC after: 1 month X-MFC-With: r353358 --- lib/Makefile | 3 ++- lib/libclang_rt/Makefile.inc | 2 +- tools/build/mk/OptionalObsoleteFiles.inc | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 6d86ef4cbb35..81612f01a0d1 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -159,7 +159,8 @@ SUBDIR.${MK_STATS}+= libstats # built for certain architectures. .if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386") + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "powerpc") _libclang_rt= libclang_rt .endif diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc index bb5c6c9194ac..aeaba094af5e 100644 --- a/lib/libclang_rt/Makefile.inc +++ b/lib/libclang_rt/Makefile.inc @@ -8,7 +8,7 @@ (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") CRTARCH?= armhf .else -CRTARCH?= ${MACHINE_CPUARCH:C/amd64/x86_64/} +CRTARCH?= ${MACHINE_ARCH:C/amd64/x86_64/} .endif CRTSRC= ${SRCTOP}/contrib/compiler-rt diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index fe463edbcd3e..6a49d60b7684 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1576,6 +1576,8 @@ OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-aarch64.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-arm.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-armhf.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.profile-x86_64.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a OLD_FILES+=usr/lib/clang/9.0.0/lib/freebsd/libclang_rt.safestack-i386.a