UPDATE: LLVM

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UPDATE: LLVM

Brad Smith-14
Bring in some patches from upstream..

Make sure PowerPC backend is in sync with the frontend and enable Secure PLT
support their too.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.216
diff -u -p -u -p -r1.216 Makefile
--- Makefile 9 Mar 2019 06:18:11 -0000 1.216
+++ Makefile 10 Mar 2019 21:39:41 -0000
@@ -20,7 +20,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python = py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 9
+REVISION-main = 10
 REVISION-lldb = 0
 CATEGORIES = devel
 DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
Index: patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
===================================================================
RCS file: patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
diff -N patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp 10 Mar 2019 22:12:43 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+Default to Secure PLT on PPC for NetBSD and OpenBSD.
+This matches the default settings of clang.
+
+Index: lib/Target/PowerPC/PPCSubtarget.cpp
+--- lib/Target/PowerPC/PPCSubtarget.cpp.orig
++++ lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -138,6 +138,9 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU
+   if (isDarwin())
+     HasLazyResolverStubs = true;
+
++  if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD())
++    SecurePlt = true;
++
+   if (HasSPE && IsPPC64)
+     report_fatal_error( "SPE is only supported for 32-bit targets.\n", false);
+   if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU))
Index: patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
===================================================================
RCS file: patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
diff -N patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp 10 Mar 2019 21:47:14 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Use Secure PLT as default on NetBSD/PowerPC.
+
+Index: tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp
+--- tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp.orig
++++ tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp
+@@ -116,7 +116,7 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Dr
+                                               const ArgList &Args) {
+   if (Args.getLastArg(options::OPT_msecure_plt))
+     return ppc::ReadGOTPtrMode::SecurePlt;
+-  if (Triple.isOSOpenBSD())
++  if (Triple.isOSNetBSD() || Triple.isOSOpenBSD())
+     return ppc::ReadGOTPtrMode::SecurePlt;
+   else
+     return ppc::ReadGOTPtrMode::Bss;

Reply | Threaded
Open this post in threaded view
|

Re: UPDATE: LLVM

George Koehler-2
On Sat, 16 Mar 2019 18:35:30 -0400
Brad Smith <[hidden email]> wrote:

> Bring in some patches from upstream..
>
> Make sure PowerPC backend is in sync with the frontend and enable Secure PLT
> support their too.

Hours ago, my PowerPC machine finished a build of devel/llvm.  I tried
to test your diff and my local changes at the same time, but I might
have removed your patch to lib/Target/PowerPC/PPCSubtarget.cpp when I
added my patch to the same file.  If your diff gets into CVS, I will
do another build of devel/llvm.  A build takes about 29 hours.

My patches for PowerPC try to fix compatibility with GCC when
returning a small struct (40736) and enable -fomit-frame-pointer by
default (41094), but I need more time to test them.

- https://bugs.llvm.org/show_bug.cgi?id=40736
- https://bugs.llvm.org/show_bug.cgi?id=41094

> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/devel/llvm/Makefile,v
> retrieving revision 1.216
> diff -u -p -u -p -r1.216 Makefile
> --- Makefile 9 Mar 2019 06:18:11 -0000 1.216
> +++ Makefile 10 Mar 2019 21:39:41 -0000
> @@ -20,7 +20,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
>  PKGNAME-main = llvm-${LLVM_V}
>  PKGNAME-python = py-llvm-${LLVM_V}
>  PKGNAME-lldb = lldb-${LLVM_V}
> -REVISION-main = 9
> +REVISION-main = 10
>  REVISION-lldb = 0
>  CATEGORIES = devel
>  DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
> Index: patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
> ===================================================================
> RCS file: patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
> diff -N patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_Target_PowerPC_PPCSubtarget_cpp 10 Mar 2019 22:12:43 -0000
> @@ -0,0 +1,18 @@
> +$OpenBSD$
> +
> +Default to Secure PLT on PPC for NetBSD and OpenBSD.
> +This matches the default settings of clang.
> +
> +Index: lib/Target/PowerPC/PPCSubtarget.cpp
> +--- lib/Target/PowerPC/PPCSubtarget.cpp.orig
> ++++ lib/Target/PowerPC/PPCSubtarget.cpp
> +@@ -138,6 +138,9 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU
> +   if (isDarwin())
> +     HasLazyResolverStubs = true;
> +
> ++  if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD())
> ++    SecurePlt = true;
> ++
> +   if (HasSPE && IsPPC64)
> +     report_fatal_error( "SPE is only supported for 32-bit targets.\n", false);
> +   if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU))
> Index: patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
> ===================================================================
> RCS file: patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
> diff -N patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-tools_clang_lib_Driver_ToolChains_Arch_PPC_cpp 10 Mar 2019 21:47:14 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Use Secure PLT as default on NetBSD/PowerPC.
> +
> +Index: tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp
> +--- tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp.orig
> ++++ tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp
> +@@ -116,7 +116,7 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Dr
> +                                               const ArgList &Args) {
> +   if (Args.getLastArg(options::OPT_msecure_plt))
> +     return ppc::ReadGOTPtrMode::SecurePlt;
> +-  if (Triple.isOSOpenBSD())
> ++  if (Triple.isOSNetBSD() || Triple.isOSOpenBSD())
> +     return ppc::ReadGOTPtrMode::SecurePlt;
> +   else
> +     return ppc::ReadGOTPtrMode::Bss;
>


--
George Koehler <[hidden email]>