Skip to content

Commit

Permalink
llvm: update to v19.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm committed Sep 30, 2024
1 parent 2f7e305 commit 921e755
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 151 deletions.
28 changes: 24 additions & 4 deletions mingw-w64-flang/0004-do-not-define-pid_t-on-mingw.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
From 4ce2573dcb2e9e74a1ed0d61a5b82e7b2fb86539 Mon Sep 17 00:00:00 2001
From: oltolm <[email protected]>
Date: Mon, 30 Sep 2024 00:01:58 +0200
Subject: [PATCH] do not define pid_t on mingw

---
include/flang/Optimizer/Builder/Runtime/RTBuilder.h | 2 +-
include/flang/Runtime/command.h | 2 +-
runtime/command.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/flang/Optimizer/Builder/Runtime/RTBuilder.h b/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
index 845ba38..a09a506 100644
--- a/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
+++ b/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
@@ -28,7 +28,7 @@
@@ -29,7 +29,7 @@
#include <cstdint>
#include <functional>

Expand All @@ -9,6 +22,8 @@
// On Windows* OS GetCurrentProcessId returns DWORD aka uint32_t
typedef std::uint32_t pid_t;
#endif
diff --git a/include/flang/Runtime/command.h b/include/flang/Runtime/command.h
index 7ab3f64..3add66d 100644
--- a/include/flang/Runtime/command.h
+++ b/include/flang/Runtime/command.h
@@ -12,7 +12,7 @@
Expand All @@ -20,6 +35,8 @@
// On Windows* OS GetCurrentProcessId returns DWORD aka uint32_t
typedef std::uint32_t pid_t;
#else
diff --git a/runtime/command.cpp b/runtime/command.cpp
index a555e26..bed4d95 100644
--- a/runtime/command.cpp
+++ b/runtime/command.cpp
@@ -15,7 +15,7 @@
Expand All @@ -28,6 +45,9 @@

-#ifdef _WIN32
+#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include "flang/Common/windows-include.h"
#include <direct.h>
#define getcwd _getcwd
--
2.46.0.windows.1

Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
Index: flang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- flang/lib/Frontend/CompilerInvocation.cpp
+++ flang/lib/Frontend/CompilerInvocation.cpp
@@ -64,8 +64,8 @@
From 46eee1636a609c513d9e2d09a51125a9895dd3c9 Mon Sep 17 00:00:00 2001
From: oltolm <[email protected]>
Date: Mon, 30 Sep 2024 00:05:50 +0200
Subject: [PATCH] Rename flang-new -flang-experimental-exec to flang

---
lib/Frontend/CompilerInvocation.cpp | 6 +++---
lib/Frontend/FrontendActions.cpp | 2 +-
lib/FrontendTool/ExecuteCompilerInvocation.cpp | 3 +--
tools/f18/CMakeLists.txt | 10 +++++-----
tools/flang-driver/CMakeLists.txt | 12 ++++++------
tools/flang-driver/driver.cpp | 7 ++++---
6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 8c892d9..693df9c 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -65,8 +65,8 @@ CompilerInvocationBase::~CompilerInvocationBase() = default;
static bool parseShowColorsArgs(const llvm::opt::ArgList &args,
bool defaultColor = true) {
// Color diagnostics default to auto ("on" if terminal supports) in the
Expand All @@ -13,7 +27,7 @@ Index: flang/lib/Frontend/CompilerInvocation.cpp
// Support both clang's -f[no-]color-diagnostics and gcc's
// -f[no-]diagnostics-colors[=never|always|auto].
enum {
@@ -833,7 +833,7 @@
@@ -880,7 +880,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
}
}

Expand All @@ -22,11 +36,11 @@ Index: flang/lib/Frontend/CompilerInvocation.cpp
res.getFrontendOpts().showColors =
parseShowColorsArgs(args, /*defaultDiagColor=*/false);

Index: flang/lib/Frontend/FrontendActions.cpp
===================================================================
--- flang/lib/Frontend/FrontendActions.cpp
+++ flang/lib/Frontend/FrontendActions.cpp
@@ -225,7 +225,7 @@
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index 5c86bd9..aa0c4fd 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -230,7 +230,7 @@ bool CodeGenAction::beginSourceFileAction() {
llvm::SMDiagnostic err;
llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx);
if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) {
Expand All @@ -35,11 +49,11 @@ Index: flang/lib/Frontend/FrontendActions.cpp
unsigned diagID = ci.getDiagnostics().getCustomDiagID(
clang::DiagnosticsEngine::Error, "Could not parse IR");
ci.getDiagnostics().Report(diagID);
Index: flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
===================================================================
--- flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -152,8 +152,7 @@
diff --git a/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index e2cbd51..09ac129 100644
--- a/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -154,8 +154,7 @@ bool executeCompilerInvocation(CompilerInstance *flang) {
// Honor -help.
if (flang->getFrontendOpts().showHelp) {
clang::driver::getDriverOptTable().printHelp(
Expand All @@ -49,110 +63,55 @@ Index: flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
/*ShowHidden=*/false, /*ShowAllAliases=*/false,
llvm::opt::Visibility(clang::driver::options::FC1Option));
return true;
--- flang/tools/f18/CMakeLists.txt
+++ flang/tools/f18/CMakeLists.txt
@@ -23,7 +23,7 @@
)
diff --git a/tools/f18/CMakeLists.txt b/tools/f18/CMakeLists.txt
index cec4e2d..cbe083f 100644
--- a/tools/f18/CMakeLists.txt
+++ b/tools/f18/CMakeLists.txt
@@ -36,7 +36,7 @@ set(MODULES ${MODULES_WITH_IMPLEMENTATION} ${MODULES_WITHOUT_IMPLEMENTATION})
set(module_objects "")

# Create module files directly from the top-level module source directory.
-# If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was
+# If CMAKE_CROSSCOMPILING, then the newly built flang executable was
# cross compiled, and thus can't be executed on the build system and thus
# can't be used for generating module files.
if (NOT CMAKE_CROSSCOMPILING)
@@ -61,9 +61,9 @@

add_custom_command(OUTPUT ${base}.mod
@@ -92,9 +92,9 @@ if (NOT CMAKE_CROSSCOMPILING)
# TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support
add_custom_command(OUTPUT ${base}.mod ${object_output}
COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
- COMMAND flang-new ${opts} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
+ COMMAND flang ${opts} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
${FLANG_SOURCE_DIR}/module/${filename}.f90
- DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends}
+ DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends}
)
list(APPEND MODULE_FILES ${base}.mod)
install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang")
@@ -119,9 +119,9 @@ if (NOT CMAKE_CROSSCOMPILING)
set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib)
add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod
COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
- COMMAND flang-new -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
+ COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
${FLANG_SOURCE_DIR}/module/${filename}.f90
- DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}
+ DEPENDS flang ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}
${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90
- DEPENDS flang-new ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends}
+ DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends}
)
add_custom_command(OUTPUT ${base}.f18.mod
DEPENDS ${base}.mod
Index: flang/tools/f18/flang-to-external-fc.in
===================================================================
--- flang/tools/f18/flang-to-external-fc.in
+++ flang/tools/f18/flang-to-external-fc.in
@@ -209,7 +209,7 @@

if
# The options claimed by Flang. This list needs to be compatible with
- # what's supported by Flang's compiler driver (i.e. `flang-new`).
+ # what's supported by Flang's compiler driver (i.e. `flang`).
[[ $opt == "-cpp" ]] ||
[[ $opt =~ ^-D.* ]] ||
[[ $opt == "-E" ]] ||
@@ -236,7 +236,7 @@
[[ $opt == "-Werror" ]]; then
flang_opts+=($opt)
elif
- # We translate the following into equivalents understood by `flang-new`
+ # We translate the following into equivalents understood by `flang`
[[ $opt == "-Mfixed" ]] || [[ $opt == "-Mfree" ]]; then
case $opt in
-Mfixed)
@@ -248,7 +248,7 @@
;;

*)
- echo "ERROR: $opt has no equivalent in 'flang-new'"
+ echo "ERROR: $opt has no equivalent in 'flang'"
exit 1
;;
esac
@@ -309,9 +309,9 @@

# Preprocess fortran sources using Flang
for idx in "${!fortran_srcs[@]}"; do
- if ! "$wd/bin/flang-new" -E "${opts[@]}" "${fortran_srcs[$idx]}" ${output_definition:+$output_definition}
+ if ! "$wd/bin/flang" -E "${opts[@]}" "${fortran_srcs[$idx]}" ${output_definition:+$output_definition}
then status=$?
- echo flang: in "$PWD", flang-new failed with exit status $status: "$wd/bin/flang-new" "${opts[@]}" "$@" >&2
+ echo flang: in "$PWD", flang failed with exit status $status: "$wd/bin/flang" "${opts[@]}" "$@" >&2
exit $status
fi
done
@@ -320,7 +320,7 @@
for idx in "${!other_srcs[@]}"; do
if ! $ext_fc -E "${opts[@]}" "${other_srcs[$idx]}" ${output_definition:+$output_definition}
then status=$?
- echo flang: in "$PWD", flang-new failed with exit status $status: "$wd/bin/flang-new" "${opts[@]}" "$@" >&2
+ echo flang: in "$PWD", flang failed with exit status $status: "$wd/bin/flang" "${opts[@]}" "$@" >&2
exit $status
fi
done
@@ -412,11 +412,11 @@
[[ ! -z ${INTRINSICS_MOD_DIR} ]] && flang_options+=("-intrinsics-module-directory ${INTRINSICS_MOD_DIR}")
for idx in "${!fortran_source_files[@]}"; do
set +e
- "$wd/bin/flang-new" "${flang_options[@]}" "${fortran_source_files[$idx]}" -o "${unparsed_file_base}_${idx}.f90"
+ "$wd/bin/flang" "${flang_options[@]}" "${fortran_source_files[$idx]}" -o "${unparsed_file_base}_${idx}.f90"
ret_status=$?
set -e
if [[ $ret_status != 0 ]]; then
- echo flang: in "$PWD", flang-new failed with exit status "$ret_status": "$wd/bin/flang-new" "${flang_options[@]}" "$@" >&2
+ echo flang: in "$PWD", flang failed with exit status "$ret_status": "$wd/bin/flang" "${flang_options[@]}" "$@" >&2
exit "$ret_status"
fi
done
Index: flang/tools/flang-driver/CMakeLists.txt
===================================================================
--- flang/tools/flang-driver/CMakeLists.txt
+++ flang/tools/flang-driver/CMakeLists.txt
@@ -11,7 +11,7 @@
diff --git a/tools/flang-driver/CMakeLists.txt b/tools/flang-driver/CMakeLists.txt
index 9f33cdf..615c673 100644
--- a/tools/flang-driver/CMakeLists.txt
+++ b/tools/flang-driver/CMakeLists.txt
@@ -11,18 +11,18 @@ set( LLVM_LINK_COMPONENTS
TargetParser
)

-add_flang_tool(flang-new
+add_flang_tool(flang
driver.cpp
fc1_main.cpp

@@ -24,13 +24,13 @@
Fortran_main
)

-target_link_libraries(flang-new
Expand All @@ -167,7 +126,7 @@ Index: flang/tools/flang-driver/CMakeLists.txt
PRIVATE
clangDriver
clangBasic
@@ -38,9 +38,9 @@
@@ -30,9 +30,9 @@ clang_target_link_libraries(flang-new

option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON)

Expand All @@ -180,11 +139,11 @@ Index: flang/tools/flang-driver/CMakeLists.txt

-install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}")
+install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}")
Index: flang/tools/flang-driver/driver.cpp
===================================================================
--- flang/tools/flang-driver/driver.cpp
+++ flang/tools/flang-driver/driver.cpp
@@ -88,14 +88,15 @@
diff --git a/tools/flang-driver/driver.cpp b/tools/flang-driver/driver.cpp
index 52136df..39198d2 100644
--- a/tools/flang-driver/driver.cpp
+++ b/tools/flang-driver/driver.cpp
@@ -88,14 +88,15 @@ int main(int argc, const char **argv) {
llvm::InitLLVM x(argc, argv);
llvm::SmallVector<const char *, 256> args(argv, argv + argc);

Expand All @@ -202,7 +161,7 @@ Index: flang/tools/flang-driver/driver.cpp
auto firstArg = std::find_if(args.begin() + 1, args.end(),
[](const char *a) { return a != nullptr; });
if (firstArg != args.end()) {
@@ -104,7 +104,7 @@
@@ -104,7 +105,7 @@ int main(int argc, const char **argv) {
<< "Valid tools include '-fc1'.\n";
return 1;
}
Expand All @@ -211,3 +170,6 @@ Index: flang/tools/flang-driver/driver.cpp
if (llvm::StringRef(args[1]).starts_with("-fc1")) {
return executeFC1Tool(args);
}
--
2.46.0.windows.1

10 changes: 5 additions & 5 deletions mingw-w64-flang/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _compiler=clang
_realname=flang
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
_version=18.1.8
_version=19.1.0
_rc=""
_tag=llvmorg-${_version}${_rc}
pkgver=${_version}${_rc/-/}
Expand Down Expand Up @@ -44,14 +44,14 @@ source=("${_url}/${_pkgfn}.tar.xz"{,.sig}
"0006-Rename-flang-new-flang-experimental-exec-to-flang.patch"
"0007-add-municode-flag-on-mingw.patch"
"0008-do-not-use-clock_gettime-on-mingw.patch")
sha256sums=('3532b790760f83d5086b913c0ee2479b42605720090dd47f91f58512ab17493c'
sha256sums=('fdc401c8d21ce56948ef939cda224640f2be2d1b0076a078aef2a86a402792d6'
'SKIP'
'59badef592dd34893cd319d42b323aaa990b452d05c7180ff20f23ab1b41e837'
'dc78b6a9ac8a097ca6ac0f23c06821d65e6ea3bf666026f529994c1d01056ae7'
'SKIP'
'77fb0612217b6af7a122f586a9d0d334cd48bb201509bf72e8f8e6244616e895'
'522dabff1ae18218c4dfea484d472f9fac3cd3f597de2afde1e338ed57363405'
'b5d16336fc878d12a224b88133eae6943f2d9ac7b4454f0fbb275930b609e1f2'
'a1811227e2a26c2786b0c8577528580e679111f6c0889afea57d08333e2d5e4f'
'8f98b693171de1aa573372041275dd73b282ab417e0553c7a8be1d1848b1f1ad'
'53ab2300549fbade3850a3a30f07016e0c2297927b1e5d48c2e0687af0a6ef11'
'45f8da68b2cb48c85db7099e174e7eebeabe90207a23ff19c7fe1e7f1f8541d8'
'be1265d4922f45cc4e7ec6a80247baba8b1e648e1e514718ebd1004958bae967')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D' # Hans Wennborg, Google.
Expand Down
14 changes: 7 additions & 7 deletions mingw-w64-libc++/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _realname=libc++
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-libunwind")
_version=18.1.8
_version=19.1.0
_rc=""
_tag=llvmorg-${_version}${_rc}
pkgver=${_version}${_rc/-/}
Expand Down Expand Up @@ -38,17 +38,17 @@ source=("${_url}/libcxx-${pkgver}.src.tar.xz"{,.sig}
"${_url}/runtimes-${pkgver}.src.tar.xz"{,.sig}
"${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
"${_url}/cmake-${pkgver}.src.tar.xz"{,.sig})
sha256sums=('bdecf90be0072bc720fd5c9c8ab061cdb197edd0c8ad3e170dc3e6bfaa49f388'
sha256sums=('99b3020a8b2134a2efc0c26e2ef9b1f07003f65330fa8eb9c2458f14bbf32f39'
'SKIP'
'256c30d724eeb72713bc08ae1692f53aaf4ebe8a1d662c92bf59e69d6c53dce9'
'0108a40b18d586a4706c03d8eeb78714a242e64ed930aeb74a0574e1c6668a6d'
'SKIP'
'c31577d16978b0da0e472ef751f74893a5b459a7ea4a383b75f7ab93cf1e6877'
'c5e9205f785511e8487bb1c5a51dbb57bfdf946d48bbc4ef5cfb413ff8fdc259'
'SKIP'
'9997c2e91e5438e2963306ba5019d85b5384b467535632738d8670ced8f07cb3'
'e5fc29e02198bc1f900c7e42590720cf4b664d4bee75e5d02bc45a4483f2a3b1'
'SKIP'
'f68cf90f369bc7d0158ba70d860b0cb34dbc163d6ff0ebc6cfa5e515b9b2e28d'
'a8b141cbfa13f50d84ce545899bd311aaa60d59dfbf7f3a0cf84f25badc1544d'
'SKIP'
'59badef592dd34893cd319d42b323aaa990b452d05c7180ff20f23ab1b41e837'
'dc78b6a9ac8a097ca6ac0f23c06821d65e6ea3bf666026f529994c1d01056ae7'
'SKIP')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D' # Hans Wennborg, Google.
'474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard
Expand Down
6 changes: 3 additions & 3 deletions mingw-w64-lldb/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi
_realname=lldb
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
_version=18.1.8
_version=19.1.0
_rc=""
_tag=llvmorg-${_version}${_rc}
pkgver=${_version}${_rc/-/}
Expand Down Expand Up @@ -41,9 +41,9 @@ _pkgfn=$_realname-$pkgver.src
source=($_url/$_pkgfn.tar.xz{,.sig}
${_url}/cmake-${pkgver}.src.tar.xz{,.sig}
"104874.patch"::"https://github.com/llvm/llvm-project/pull/104874.patch")
sha256sums=('cac2db253ee3566c01774a888cc0ac3853f1e141c5c9962f04ee562bdb0af426'
sha256sums=('f3269b8261f713542aaba8ada00950ccb24d1fda302c04be962d369190251d6b'
'SKIP'
'59badef592dd34893cd319d42b323aaa990b452d05c7180ff20f23ab1b41e837'
'dc78b6a9ac8a097ca6ac0f23c06821d65e6ea3bf666026f529994c1d01056ae7'
'SKIP'
'87695f7128fe0fb3f0b698a132f6d18cbe513d35ff1e0ebe25afac395ead8e9f')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D' # Hans Wennborg, Google.
Expand Down
Loading

0 comments on commit 921e755

Please sign in to comment.