Friday, February 01, 2019

UPDATE: lang/flang 7.0.1

Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/lang/flang/Makefile.inc,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile.inc
--- Makefile.inc 30 Jan 2019 00:30:09 -0000 1.5
+++ Makefile.inc 1 Feb 2019 21:28:17 -0000
@@ -2,8 +2,7 @@

# Also ppc64le
ONLY_FOR_ARCHS = amd64 arm64
-BROKEN = needs updating for llvm-7.0.1, being worked on
-#BROKEN-arm64 = see flang issue 557, temporary
+BROKEN-arm64 = see flang issue 557, temporary

CATEGORIES ?= lang

Index: driver/Makefile
===================================================================
RCS file: /cvs/ports/lang/flang/driver/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- driver/Makefile 25 Jan 2019 20:06:48 -0000 1.13
+++ driver/Makefile 1 Feb 2019 21:28:17 -0000
@@ -1,14 +1,13 @@
# $OpenBSD: Makefile,v 1.13 2019/01/25 20:06:48 bcallah Exp $

# If you are updating to a new version
-# (e.g. 6.0->6.1 or 7.0), you need to sync
+# (e.g. 7.0->7.1 or 8.0), you need to sync
# patches with devel/llvm
COMMENT = LLVM Fortran compiler driver
-DISTNAME = flang-driver-6.0.0.20181012
-REVISION = 0
+DISTNAME = flang-driver-7.0.1.20181218

GH_PROJECT = flang-driver
-GH_COMMIT = f90d905b99ef497cc654b4a8433f1ac35a870f11
+GH_COMMIT = 24bd54da5c41af04838bbe7b68f830840d47fc03

WANTLIB += ${COMPILER_LIBCXX} c m z

@@ -21,8 +20,16 @@ MODULES = devel/cmake \
BUILD_DEPENDS = devel/llvm \
textproc/libxml

+CONFIGURE_ARGS = -DLIBCLANG_BUILD_STATIC=On
+
pre-configure:
@${SUBST_CMD} ${WRKSRC}/lib/Driver/ToolChains/OpenBSD.cpp
+
+# Don't use the LLVM shared library.
+post-configure:
+ sed -i \
+ 's,-lLLVM-7,`llvm-config --libs all --link-static --ignore-libllvm` -lz,g' \
+ ${WRKBUILD}/build.ninja

# We don't want yet another copy of clang and its utilities on the system.
# Doubly true since flang is statically linked to its clang libs.
Index: driver/distinfo
===================================================================
RCS file: /cvs/ports/lang/flang/driver/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- driver/distinfo 16 Oct 2018 14:56:38 -0000 1.10
+++ driver/distinfo 1 Feb 2019 21:28:17 -0000
@@ -1,2 +1,2 @@
-SHA256 (flang-driver-6.0.0.20181012-f90d905b.tar.gz) = ApdRnjeFdlRb0aiTO0GlcSu6+rB1oYQrQmHmldsuzMY=
-SIZE (flang-driver-6.0.0.20181012-f90d905b.tar.gz) = 16785531
+SHA256 (flang-driver-7.0.1.20181218-24bd54da.tar.gz) = Z54V9PfCA7i6dfxKEvC2NI3fnITSIagEkw/ljha0lu0=
+SIZE (flang-driver-7.0.1.20181218-24bd54da.tar.gz) = 17649879
Index: driver/patches/patch-include_clang_Basic_DiagnosticSemaKinds_td
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-include_clang_Basic_DiagnosticSemaKinds_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_clang_Basic_DiagnosticSemaKinds_td
--- driver/patches/patch-include_clang_Basic_DiagnosticSemaKinds_td 16 Jun 2018 20:08:28 -0000 1.3
+++ driver/patches/patch-include_clang_Basic_DiagnosticSemaKinds_td 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-include_clang_Basic_Diag
Index: include/clang/Basic/DiagnosticSemaKinds.td
--- include/clang/Basic/DiagnosticSemaKinds.td.orig
+++ include/clang/Basic/DiagnosticSemaKinds.td
-@@ -5883,7 +5883,7 @@ def warn_pointer_indirection_from_incompatible_type :
+@@ -5827,7 +5827,7 @@ def warn_pointer_indirection_from_incompatible_type :
InGroup<UndefinedReinterpretCast>, DefaultIgnore;
def warn_taking_address_of_packed_member : Warning<
"taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
@@ -12,7 +12,7 @@ Index: include/clang/Basic/DiagnosticSem

def err_objc_object_assignment : Error<
"cannot assign to class object (%0 invalid)">;
-@@ -6842,7 +6842,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
+@@ -6804,7 +6804,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
"sending to parameter of different type}0,1"
"|%diff{casting $ to type $|casting between types}0,1}2"
" converts between pointers to integer types with different sign">,
Index: driver/patches/patch-include_clang_Driver_Options_td
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-include_clang_Driver_Options_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_clang_Driver_Options_td
--- driver/patches/patch-include_clang_Driver_Options_td 16 Jun 2018 20:08:28 -0000 1.3
+++ driver/patches/patch-include_clang_Driver_Options_td 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-include_clang_Driver_Opt
Index: include/clang/Driver/Options.td
--- include/clang/Driver/Options.td.orig
+++ include/clang/Driver/Options.td
-@@ -2170,7 +2170,7 @@ def pthreads : Flag<["-"], "pthreads">;
+@@ -2359,7 +2359,7 @@ def pthreads : Flag<["-"], "pthreads">;
def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
HelpText<"Support POSIX threads in generated code">;
def no_pthread : Flag<["-"], "no-pthread">, Flags<[CC1Option]>;
Index: driver/patches/patch-include_clang_Frontend_CompilerInvocation_h
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-include_clang_Frontend_CompilerInvocation_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-include_clang_Frontend_CompilerInvocation_h
--- driver/patches/patch-include_clang_Frontend_CompilerInvocation_h 31 Dec 2017 18:06:38 -0000 1.1.1.1
+++ driver/patches/patch-include_clang_Frontend_CompilerInvocation_h 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-include_clang_Frontend_C
Index: include/clang/Frontend/CompilerInvocation.h
--- include/clang/Frontend/CompilerInvocation.h.orig
+++ include/clang/Frontend/CompilerInvocation.h
-@@ -48,7 +48,7 @@ class DiagnosticsEngine;
+@@ -53,7 +53,7 @@ class TargetOptions;
/// report the error(s).
bool ParseDiagnosticArgs(DiagnosticOptions &Opts, llvm::opt::ArgList &Args,
DiagnosticsEngine *Diags = nullptr,
Index: driver/patches/patch-include_clang_Sema_Sema_h
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-include_clang_Sema_Sema_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-include_clang_Sema_Sema_h
--- driver/patches/patch-include_clang_Sema_Sema_h 9 May 2018 22:27:41 -0000 1.2
+++ driver/patches/patch-include_clang_Sema_Sema_h 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-include_clang_Sema_Sema_
Index: include/clang/Sema/Sema.h
--- include/clang/Sema/Sema.h.orig
+++ include/clang/Sema/Sema.h
-@@ -10361,6 +10361,7 @@ class Sema { (public)
+@@ -10454,6 +10454,7 @@ class Sema { (public)
FST_FreeBSDKPrintf,
FST_OSTrace,
FST_OSLog,
Index: driver/patches/patch-lib_Driver_ToolChains_Arch_AArch64_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_Arch_AArch64_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Driver_ToolChains_Arch_AArch64_cpp
--- driver/patches/patch-lib_Driver_ToolChains_Arch_AArch64_cpp 9 May 2018 22:27:41 -0000 1.2
+++ driver/patches/patch-lib_Driver_ToolChains_Arch_AArch64_cpp 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-lib_Driver_ToolChains_Ar
Index: lib/Driver/ToolChains/Arch/AArch64.cpp
--- lib/Driver/ToolChains/Arch/AArch64.cpp.orig
+++ lib/Driver/ToolChains/Arch/AArch64.cpp
-@@ -149,7 +149,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, S
+@@ -152,7 +152,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, S
return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
}

@@ -13,7 +13,7 @@ Index: lib/Driver/ToolChains/Arch/AArch6
std::vector<StringRef> &Features) {
Arg *A;
bool success = true;
-@@ -191,9 +192,11 @@ void aarch64::getAArch64TargetFeatures(const Driver &D
+@@ -194,9 +195,11 @@ void aarch64::getAArch64TargetFeatures(const Driver &D
}

if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
Index: driver/patches/patch-lib_Driver_ToolChains_Clang_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_Clang_cpp,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Driver_ToolChains_Clang_cpp
--- driver/patches/patch-lib_Driver_ToolChains_Clang_cpp 26 Aug 2018 00:40:22 -0000 1.5
+++ driver/patches/patch-lib_Driver_ToolChains_Clang_cpp 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-lib_Driver_ToolChains_Cl
Index: lib/Driver/ToolChains/Clang.cpp
--- lib/Driver/ToolChains/Clang.cpp.orig
+++ lib/Driver/ToolChains/Clang.cpp
-@@ -332,7 +332,7 @@ static void getTargetFeatures(const ToolChain &TC, con
+@@ -341,7 +341,7 @@ static void getTargetFeatures(const ToolChain &TC, con
break;
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_be:
@@ -12,7 +12,7 @@ Index: lib/Driver/ToolChains/Clang.cpp
break;
case llvm::Triple::x86:
case llvm::Triple::x86_64:
-@@ -3423,9 +3423,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -3539,9 +3539,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing;
// We turn strict aliasing off by default if we're in CL mode, since MSVC
// doesn't do any TBAA.
@@ -27,7 +27,7 @@ Index: lib/Driver/ToolChains/Clang.cpp
CmdArgs.push_back("-relaxed-aliasing");
if (!Args.hasFlag(options::OPT_fstruct_path_tbaa,
options::OPT_fno_struct_path_tbaa))
-@@ -4011,7 +4014,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4147,7 +4150,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
options::OPT_fno_strict_overflow)) {
if (A->getOption().matches(options::OPT_fno_strict_overflow))
CmdArgs.push_back("-fwrapv");
@@ -37,7 +37,7 @@ Index: lib/Driver/ToolChains/Clang.cpp

if (Arg *A = Args.getLastArg(options::OPT_freroll_loops,
options::OPT_fno_reroll_loops))
-@@ -4842,6 +4846,18 @@ ObjCRuntime Clang::AddObjCRuntimeArgs(const ArgList &a
+@@ -5015,6 +5019,18 @@ ObjCRuntime Clang::AddObjCRuntimeArgs(const ArgList &a
#else
unsigned nonFragileABIVersion = 2;
#endif
Index: driver/patches/patch-lib_Driver_ToolChains_CommonArgs_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_CommonArgs_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Driver_ToolChains_CommonArgs_cpp
--- driver/patches/patch-lib_Driver_ToolChains_CommonArgs_cpp 9 May 2018 22:27:41 -0000 1.1
+++ driver/patches/patch-lib_Driver_ToolChains_CommonArgs_cpp 1 Feb 2019 21:28:17 -0000
@@ -5,7 +5,7 @@ Appease lld.
Index: lib/Driver/ToolChains/CommonArgs.cpp
--- lib/Driver/ToolChains/CommonArgs.cpp.orig
+++ lib/Driver/ToolChains/CommonArgs.cpp
-@@ -183,6 +183,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
+@@ -187,6 +187,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
// Add Fortan "main" before the first linker input
if (!SeenFirstLinkerInput) {
if (needFortranMain(D, Args)) {
@@ -13,7 +13,7 @@ Index: lib/Driver/ToolChains/CommonArgs.
CmdArgs.push_back("-lflangmain");
}
SeenFirstLinkerInput = true;
-@@ -206,6 +207,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
+@@ -210,6 +211,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
}

if (!SeenFirstLinkerInput && needFortranMain(D, Args)) {
Index: driver/patches/patch-lib_Driver_ToolChains_Gnu_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_Gnu_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Driver_ToolChains_Gnu_cpp
--- driver/patches/patch-lib_Driver_ToolChains_Gnu_cpp 9 May 2018 22:27:41 -0000 1.2
+++ driver/patches/patch-lib_Driver_ToolChains_Gnu_cpp 1 Feb 2019 21:28:17 -0000
@@ -1,9 +1,9 @@
-$OpenBSD: patch-lib_Driver_ToolChains_Gnu_cpp,v 1.2 2018/05/09 22:27:41 bcallah Exp $
+$OpenBSD$

Index: lib/Driver/ToolChains/Gnu.cpp
--- lib/Driver/ToolChains/Gnu.cpp.orig
+++ lib/Driver/ToolChains/Gnu.cpp
-@@ -2253,6 +2253,9 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
+@@ -2422,6 +2422,9 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
case llvm::Triple::systemz:
case llvm::Triple::mips:
case llvm::Triple::mipsel:
@@ -13,13 +13,3 @@ Index: lib/Driver/ToolChains/Gnu.cpp
return true;
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
-@@ -2260,7 +2263,8 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
- // identify the ABI in use (Debian) or only use N64 for MIPS64 (Android).
- // Other targets are unable to distinguish N32 from N64.
- if (getTriple().getEnvironment() == llvm::Triple::GNUABI64 ||
-- getTriple().isAndroid())
-+ getTriple().isAndroid() ||
-+ getTriple().isOSOpenBSD())
- return true;
- return false;
- default:
Index: driver/patches/patch-lib_Driver_ToolChains_OpenBSD_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_OpenBSD_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Driver_ToolChains_OpenBSD_cpp
--- driver/patches/patch-lib_Driver_ToolChains_OpenBSD_cpp 16 Jun 2018 20:08:28 -0000 1.4
+++ driver/patches/patch-lib_Driver_ToolChains_OpenBSD_cpp 1 Feb 2019 21:28:17 -0000
@@ -1,4 +1,4 @@
-$OpenBSD: patch-lib_Driver_ToolChains_OpenBSD_cpp,v 1.4 2018/06/16 20:08:28 bcallah Exp $
+$OpenBSD$

Index: lib/Driver/ToolChains/OpenBSD.cpp
--- lib/Driver/ToolChains/OpenBSD.cpp.orig
@@ -9,9 +9,9 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
#include "clang/Driver/Compilation.h"
+#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
+ #include "clang/Driver/SanitizerArgs.h"
#include "llvm/Option/ArgList.h"
-
-@@ -165,16 +166,23 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+@@ -168,17 +169,23 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
}
}

@@ -20,6 +20,7 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
- Triple.replace(0, 6, "amd64");
- CmdArgs.push_back(
- Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple + "/4.2.1"));
+- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
-
Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
options::OPT_e, options::OPT_s, options::OPT_t,
@@ -38,11 +39,11 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
+ CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib"));
+ CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
+
+ bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
+ bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
-
- if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
-@@ -189,8 +197,16 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-
+@@ -202,8 +209,16 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+ }
// FIXME: For some reason GCC passes -lgcc before adding
// the default system libraries. Just mimic this for now.
- CmdArgs.push_back("-lgcc");
@@ -59,7 +60,7 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
if (Args.hasArg(options::OPT_pthread)) {
if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg))
CmdArgs.push_back("-lpthread_p");
-@@ -205,7 +221,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+@@ -218,7 +233,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
CmdArgs.push_back("-lc");
}

@@ -71,7 +72,7 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
}

if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-@@ -226,8 +245,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+@@ -257,8 +275,7 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args)
: Generic_ELF(D, Triple, Args) {
@@ -80,8 +81,8 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
+ getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
}

- Tool *OpenBSD::buildAssembler() const {
-@@ -235,3 +253,62 @@ Tool *OpenBSD::buildAssembler() const {
+ void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+@@ -274,3 +291,48 @@ Tool *OpenBSD::buildAssembler() const {
}

Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
@@ -127,20 +128,6 @@ Index: lib/Driver/ToolChains/OpenBSD.cpp
+ getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/${GCC_CONFIG}");
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/backward");
-+ break;
-+ }
-+}
-+
-+void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
-+ ArgStringList &CmdArgs) const {
-+ switch (GetCXXStdlibType(Args)) {
-+ case ToolChain::CST_Libcxx:
-+ CmdArgs.push_back("-lc++");
-+ CmdArgs.push_back("-lc++abi");
-+ CmdArgs.push_back("-lpthread");
-+ break;
-+ case ToolChain::CST_Libstdcxx:
-+ CmdArgs.push_back("-lestdc++");
+ break;
+ }
+}
Index: driver/patches/patch-lib_Driver_ToolChains_OpenBSD_h
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Driver_ToolChains_OpenBSD_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-lib_Driver_ToolChains_OpenBSD_h
--- driver/patches/patch-lib_Driver_ToolChains_OpenBSD_h 31 Dec 2017 18:06:38 -0000 1.1.1.1
+++ driver/patches/patch-lib_Driver_ToolChains_OpenBSD_h 1 Feb 2019 21:28:17 -0000
@@ -3,16 +3,14 @@ $OpenBSD: patch-lib_Driver_ToolChains_Op
Index: lib/Driver/ToolChains/OpenBSD.h
--- lib/Driver/ToolChains/OpenBSD.h.orig
+++ lib/Driver/ToolChains/OpenBSD.h
-@@ -59,6 +59,13 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
- bool IsObjCNonFragileABIDefault() const override { return true; }
- bool isPIEDefault() const override { return true; }
+@@ -61,6 +61,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
+ void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs) const override;

+ CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
+ void AddClangCXXStdlibIncludeArgs(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
-+ void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
-+ llvm::opt::ArgStringList &CmdArgs) const override;
+
unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
return 2;
Index: driver/patches/patch-lib_Sema_SemaChecking_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Sema_SemaChecking_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Sema_SemaChecking_cpp
--- driver/patches/patch-lib_Sema_SemaChecking_cpp 9 May 2018 22:27:41 -0000 1.2
+++ driver/patches/patch-lib_Sema_SemaChecking_cpp 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-lib_Sema_SemaChecking_cp
Index: lib/Sema/SemaChecking.cpp
--- lib/Sema/SemaChecking.cpp.orig
+++ lib/Sema/SemaChecking.cpp
-@@ -5136,7 +5136,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
+@@ -6431,7 +6431,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
return llvm::StringSwitch<FormatStringType>(Format->getType()->getName())
.Case("scanf", FST_Scanf)
@@ -12,7 +12,7 @@ Index: lib/Sema/SemaChecking.cpp
.Cases("NSString", "CFString", FST_NSString)
.Case("strftime", FST_Strftime)
.Case("strfmon", FST_Strfmon)
-@@ -5233,6 +5233,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
+@@ -6528,6 +6528,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
case FST_Kprintf:
case FST_FreeBSDKPrintf:
case FST_Printf:
@@ -20,7 +20,7 @@ Index: lib/Sema/SemaChecking.cpp
Diag(FormatLoc, diag::note_format_security_fixit)
<< FixItHint::CreateInsertion(FormatLoc, "\"%s\", ");
break;
-@@ -6777,8 +6778,9 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8079,8 +8080,9 @@ static void CheckFormatString(Sema &S, const FormatStr
}

if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
@@ -32,7 +32,7 @@ Index: lib/Sema/SemaChecking.cpp
CheckPrintfHandler H(
S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
(Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str,
-@@ -6788,7 +6790,7 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8090,7 +8092,7 @@ static void CheckFormatString(Sema &S, const FormatStr
if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
S.getLangOpts(),
S.Context.getTargetInfo(),
Index: driver/patches/patch-lib_Sema_SemaDeclAttr_cpp
===================================================================
RCS file: /cvs/ports/lang/flang/driver/patches/patch-lib_Sema_SemaDeclAttr_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Sema_SemaDeclAttr_cpp
--- driver/patches/patch-lib_Sema_SemaDeclAttr_cpp 9 May 2018 22:27:41 -0000 1.2
+++ driver/patches/patch-lib_Sema_SemaDeclAttr_cpp 1 Feb 2019 21:28:17 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-lib_Sema_SemaDeclAttr_cp
Index: lib/Sema/SemaDeclAttr.cpp
--- lib/Sema/SemaDeclAttr.cpp.orig
+++ lib/Sema/SemaDeclAttr.cpp
-@@ -3206,6 +3206,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
+@@ -3179,6 +3179,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
.Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
.Case("os_trace", SupportedFormat)
.Case("os_log", SupportedFormat)
Index: driver/patches/patch-tools_libclang_CMakeLists_txt
===================================================================
RCS file: driver/patches/patch-tools_libclang_CMakeLists_txt
diff -N driver/patches/patch-tools_libclang_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ driver/patches/patch-tools_libclang_CMakeLists_txt 1 Feb 2019 21:28:17 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Don't build a shared libclang.so...
+I don't want to make flang anything but a single static binary.
+
+Index: tools/libclang/CMakeLists.txt
+--- tools/libclang/CMakeLists.txt.orig
++++ tools/libclang/CMakeLists.txt
+@@ -73,7 +73,7 @@ if(MSVC)
+ set(LLVM_EXPORTED_SYMBOL_FILE)
+ endif()
+
+-if( LLVM_ENABLE_PIC )
++if( 0 )
+ set(ENABLE_SHARED SHARED)
+ endif()
+
Index: flang/Makefile
===================================================================
RCS file: /cvs/ports/lang/flang/flang/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- flang/Makefile 25 Jan 2019 20:06:48 -0000 1.34
+++ flang/Makefile 1 Feb 2019 21:28:17 -0000
@@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.34 2019/01/25 20:06:48 bcallah Exp $

COMMENT = LLVM Fortran compiler passes and runtime library
-DISTNAME = flang-6.0.0.20190124
+DISTNAME = flang-7.0.1.20190124

SHARED_LIBS += flang 1.4 # 6.0
SHARED_LIBS += flangrti 3.0 # 6.0
Index: flang/distinfo
===================================================================
RCS file: /cvs/ports/lang/flang/flang/distinfo,v
retrieving revision 1.29
diff -u -p -r1.29 distinfo
--- flang/distinfo 25 Jan 2019 20:06:48 -0000 1.29
+++ flang/distinfo 1 Feb 2019 21:28:17 -0000
@@ -1,2 +1,2 @@
-SHA256 (flang-6.0.0.20190124-17fd8acf.tar.gz) = fXaPJSpVTtHe9/Ovd/hJOoaY11imcUMoveS10gm95+I=
-SIZE (flang-6.0.0.20190124-17fd8acf.tar.gz) = 4703330
+SHA256 (flang-7.0.1.20190124-17fd8acf.tar.gz) = fXaPJSpVTtHe9/Ovd/hJOoaY11imcUMoveS10gm95+I=
+SIZE (flang-7.0.1.20190124-17fd8acf.tar.gz) = 4703330
Index: libpgmath/Makefile
===================================================================
RCS file: /cvs/ports/lang/flang/libpgmath/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- libpgmath/Makefile 25 Jan 2019 20:06:48 -0000 1.21
+++ libpgmath/Makefile 1 Feb 2019 21:28:17 -0000
@@ -2,7 +2,7 @@

# Sync version with lang/flang/flang always!
COMMENT = LLVM Fortran math library
-DISTNAME = flang-6.0.0.20190124
+DISTNAME = flang-7.0.1.20190124
PKGNAME = ${DISTNAME:S/flang/libpgmath/}

SHARED_LIBS += pgmath 4.0 # 6.0
Index: libpgmath/distinfo
===================================================================
RCS file: /cvs/ports/lang/flang/libpgmath/distinfo,v
retrieving revision 1.20
diff -u -p -r1.20 distinfo
--- libpgmath/distinfo 25 Jan 2019 20:06:48 -0000 1.20
+++ libpgmath/distinfo 1 Feb 2019 21:28:17 -0000
@@ -1,2 +1,2 @@
-SHA256 (flang-6.0.0.20190124-17fd8acf.tar.gz) = fXaPJSpVTtHe9/Ovd/hJOoaY11imcUMoveS10gm95+I=
-SIZE (flang-6.0.0.20190124-17fd8acf.tar.gz) = 4703330
+SHA256 (flang-7.0.1.20190124-17fd8acf.tar.gz) = fXaPJSpVTtHe9/Ovd/hJOoaY11imcUMoveS10gm95+I=
+SIZE (flang-7.0.1.20190124-17fd8acf.tar.gz) = 4703330
Hi ports --

Every time we update LLVM, flang needs to be updated and it takes me
some time to get it done.

It's done now. The patch is attached.

Some notes:
1. Haven't turned arm64 back on. I expect it to work but would like to
compile/run test it first instead of blindly turning it on.

2. flang-7 wants to use -lLLVM and build and link to its own separate
libclang.so. I don't want to do either of those things to avoid
potential conflicts, so I've disabled building libclang.so and
ham-fisted a replacement for -lLLVM-7 in a post-configure target,
forcing it to use the LLVM static libs. This creates a very huge (>80MB)
binary. But I think this is fine since the only archs that flang works
on are amd64 and arm64 anyway.

3. Everything is good with the NIST Fortran 77 test suite.

Tests appreciated.

~Brian

No comments:

Post a Comment