From 348faba600e4df09ad10c11ea0f6184411adbba9 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sun, 18 Nov 2018 13:50:36 +0000 Subject: [PATCH] Revert, it breaks the build on (at least) i386. spotted by sthen@, thanks! --- devel/llvm/Makefile | 4 +- ...clude_clang_Basic_DiagnosticDriverKinds_td | 23 ---------- ..._clang_lib_Driver_ToolChains_Arch_Mips_cpp | 42 ------------------- ...clang_lib_Driver_ToolChains_CommonArgs_cpp | 40 ------------------ 4 files changed, 2 insertions(+), 107 deletions(-) delete mode 100644 devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticDriverKinds_td delete mode 100644 devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_Mips_cpp delete mode 100644 devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_CommonArgs_cpp diff --git a/devel/llvm/Makefile b/devel/llvm/Makefile index 079a2204c06..73f6f940689 100644 --- a/devel/llvm/Makefile +++ b/devel/llvm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.196 2018/11/18 09:02:56 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.197 2018/11/18 13:50:36 ajacoutot Exp $ # XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when # updating this port. @@ -19,7 +19,7 @@ PKGNAME = llvm-${LLVM_V} PKGSPEC-main = llvm-=${LLVM_V} PKGNAME-main = llvm-${LLVM_V} PKGNAME-python = py-llvm-${LLVM_V} -REVISION-main = 15 +REVISION-main = 16 REVISION-python = 2 CATEGORIES = devel DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \ diff --git a/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticDriverKinds_td b/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticDriverKinds_td deleted file mode 100644 index 4f5fa094111..00000000000 --- a/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticDriverKinds_td +++ /dev/null @@ -1,23 +0,0 @@ -$OpenBSD: patch-tools_clang_include_clang_Basic_DiagnosticDriverKinds_td,v 1.3 2018/11/18 09:02:56 ajacoutot Exp $ - -[mips] Improve handling of -fno-[pic/PIC] option - -Index: tools/clang/include/clang/Basic/DiagnosticDriverKinds.td ---- tools/clang/include/clang/Basic/DiagnosticDriverKinds.td.orig -+++ tools/clang/include/clang/Basic/DiagnosticDriverKinds.td -@@ -322,10 +322,12 @@ def warn_drv_unsupported_longcalls : Warning< - "ignoring '-mlong-calls' option as it is not currently supported with " - "%select{|the implicit usage of }0-mabicalls">, - InGroup; --def warn_drv_unsupported_abicalls : Warning< -- "ignoring '-mabicalls' option as it cannot be used with " -- "non position-independent code and the N64 ABI">, -+def warn_drv_unsupported_pic_with_mabicalls : Warning< -+ "ignoring '%0' option as it cannot be used with " -+ "%select{implicit usage of|}1 -mabicalls and the N64 ABI">, - InGroup; -+def err_drv_unsupported_noabicalls_pic : Error< -+ "position-independent code requires \xe2\x80\x98-mabicalls\xe2\x80\x99">; - def err_drv_unsupported_indirect_jump_opt : Error< - "'-mindirect-jump=%0' is unsupported with the '%1' architecture">; - def err_drv_unknown_indirect_jump_opt : Error< diff --git a/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_Mips_cpp b/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_Mips_cpp deleted file mode 100644 index 1faaa820841..00000000000 --- a/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_Mips_cpp +++ /dev/null @@ -1,42 +0,0 @@ -$OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Arch_Mips_cpp,v 1.1 2018/11/18 09:02:56 ajacoutot Exp $ - -[mips] Improve handling of -fno-[pic/PIC] option - -Index: tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp ---- tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp.orig -+++ tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp -@@ -214,6 +214,7 @@ void mips::getMIPSTargetFeatures(const Driver &D, cons - // For case (a) we need to add +noabicalls for N64. - - bool IsN64 = ABIName == "64"; -+ bool IsPIC = false; - bool NonPIC = false; - - Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC, -@@ -225,6 +226,9 @@ void mips::getMIPSTargetFeatures(const Driver &D, cons - NonPIC = - (O.matches(options::OPT_fno_PIC) || O.matches(options::OPT_fno_pic) || - O.matches(options::OPT_fno_PIE) || O.matches(options::OPT_fno_pie)); -+ IsPIC = -+ (O.matches(options::OPT_fPIC) || O.matches(options::OPT_fpic) || -+ O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie)); - } - - bool UseAbiCalls = false; -@@ -234,9 +238,13 @@ void mips::getMIPSTargetFeatures(const Driver &D, cons - UseAbiCalls = - !ABICallsArg || ABICallsArg->getOption().matches(options::OPT_mabicalls); - -- if (UseAbiCalls && IsN64 && NonPIC) { -- D.Diag(diag::warn_drv_unsupported_abicalls); -- UseAbiCalls = false; -+ if (IsN64 && NonPIC && (!ABICallsArg || UseAbiCalls)) { -+ D.Diag(diag::warn_drv_unsupported_pic_with_mabicalls) -+ << LastPICArg->getAsString(Args) << (!ABICallsArg ? 0 : 1); -+ NonPIC = false; -+ } -+ if (ABICallsArg && !UseAbiCalls && IsPIC) { -+ D.Diag(diag::err_drv_unsupported_noabicalls_pic); - } - - if (!UseAbiCalls) diff --git a/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_CommonArgs_cpp b/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_CommonArgs_cpp deleted file mode 100644 index fc494475e91..00000000000 --- a/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_CommonArgs_cpp +++ /dev/null @@ -1,40 +0,0 @@ -$OpenBSD: patch-tools_clang_lib_Driver_ToolChains_CommonArgs_cpp,v 1.1 2018/11/18 09:02:56 ajacoutot Exp $ - -- [mips] Prevent PIC to be set to level 2 -- [mips] Improve handling of -fno-[pic/PIC] option - -Index: tools/clang/lib/Driver/ToolChains/CommonArgs.cpp ---- tools/clang/lib/Driver/ToolChains/CommonArgs.cpp.orig -+++ tools/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -968,12 +968,25 @@ tools::ParsePICArgs(const ToolChain &ToolChain, const - if ((ROPI || RWPI) && (PIC || PIE)) - ToolChain.getDriver().Diag(diag::err_drv_ropi_rwpi_incompatible_with_pic); - -- // When targettng MIPS64 with N64, the default is PIC, unless -mno-abicalls is -- // used. -- if ((Triple.getArch() == llvm::Triple::mips64 || -- Triple.getArch() == llvm::Triple::mips64el) && -- Args.hasArg(options::OPT_mno_abicalls)) -- return std::make_tuple(llvm::Reloc::Static, 0U, false); -+ if (Triple.getArch() == llvm::Triple::mips || -+ Triple.getArch() == llvm::Triple::mipsel || -+ Triple.getArch() == llvm::Triple::mips64 || -+ Triple.getArch() == llvm::Triple::mips64el) { -+ StringRef CPUName; -+ StringRef ABIName; -+ mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName); -+ // When targeting the N64 ABI, PIC is the default, except in the case -+ // when the -mno-abicalls option is used. In that case we exit -+ // at next check regardless of PIC being set below. -+ if (ABIName == "n64") -+ PIC = true; -+ // When targettng MIPS with -mno-abicalls, it's always static. -+ if(Args.hasArg(options::OPT_mno_abicalls)) -+ return std::make_tuple(llvm::Reloc::Static, 0U, false); -+ // Unlike other architectures, MIPS, even with -fPIC/-mxgot/multigot, -+ // does not use PIC level 2 for historical reasons. -+ IsPICLevelTwo = false; -+ } - - if (PIC) - return std::make_tuple(llvm::Reloc::PIC_, IsPICLevelTwo ? 2U : 1U, PIE);