flang: update to 20.1.0

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2025-03-05 08:01:07 +01:00
parent 4f670a8987
commit ac0aae6c07
2 changed files with 10 additions and 185 deletions

View File

@@ -1,168 +0,0 @@
Index: flang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- flang/lib/Frontend/CompilerInvocation.cpp
+++ flang/lib/Frontend/CompilerInvocation.cpp
@@ -65,8 +65,8 @@
static bool parseShowColorsArgs(const llvm::opt::ArgList &args,
bool defaultColor = true) {
// Color diagnostics default to auto ("on" if terminal supports) in the
- // compiler driver `flang-new` but default to off in the frontend driver
- // `flang-new -fc1`, needing an explicit OPT_fdiagnostics_color.
+ // compiler driver `flang` but default to off in the frontend driver
+ // `flang -fc1`, needing an explicit OPT_fdiagnostics_color.
// Support both clang's -f[no-]color-diagnostics and gcc's
// -f[no-]diagnostics-colors[=never|always|auto].
enum {
@@ -880,7 +880,7 @@
}
}
- // Default to off for `flang-new -fc1`.
+ // Default to off for `flang -fc1`.
res.getFrontendOpts().showColors =
parseShowColorsArgs(args, /*defaultDiagColor=*/false);
Index: flang/lib/Frontend/FrontendActions.cpp
===================================================================
--- flang/lib/Frontend/FrontendActions.cpp
+++ flang/lib/Frontend/FrontendActions.cpp
@@ -230,7 +230,7 @@
llvm::SMDiagnostic err;
llvmModule = llvm::parseIRFile(getCurrentInput().getFile(), err, *llvmCtx);
if (!llvmModule || llvm::verifyModule(*llvmModule, &llvm::errs())) {
- err.print("flang-new", llvm::errs());
+ err.print("flang", llvm::errs());
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
@@ -154,8 +154,7 @@
// Honor -help.
if (flang->getFrontendOpts().showHelp) {
clang::driver::getDriverOptTable().printHelp(
- llvm::outs(), "flang-new -fc1 [options] file...",
- "LLVM 'Flang' Compiler",
+ llvm::outs(), "flang -fc1 [options] file...", "LLVM 'Flang' Compiler",
/*ShowHidden=*/false, /*ShowAllAliases=*/false,
llvm::opt::Visibility(clang::driver::options::FC1Option));
return true;
--- flang/runtime/CMakeLists.txt
+++ flang/runtime/CMakeLists.txt
@@ -308,7 +308,7 @@
#
# TODO: This is a workaround and should be updated when runtime build procedure
# is changed to a regular runtime build. See discussion in PR #95388.
-if (TARGET flang-new AND TARGET module_files)
- add_dependencies(FortranRuntime flang-new module_files)
+if (TARGET flang AND TARGET module_files)
+ add_dependencies(FortranRuntime flang module_files)
endif()
--- flang/tools/f18/CMakeLists.txt
+++ flang/tools/f18/CMakeLists.txt
@@ -36,7 +36,7 @@
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)
@@ -92,9 +92,9 @@
# 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 @@
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}
${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/flang-driver/CMakeLists.txt
===================================================================
--- flang/tools/flang-driver/CMakeLists.txt
+++ flang/tools/flang-driver/CMakeLists.txt
@@ -11,18 +11,18 @@
TargetParser
)
-add_flang_tool(flang-new
+add_flang_tool(flang
driver.cpp
fc1_main.cpp
)
-target_link_libraries(flang-new
+target_link_libraries(flang
PRIVATE
flangFrontend
flangFrontendTool
)
-clang_target_link_libraries(flang-new
+clang_target_link_libraries(flang
PRIVATE
clangDriver
clangBasic
@@ -30,9 +30,9 @@
option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON)
-# Enable support for plugins, which need access to symbols from flang-new
+# Enable support for plugins, which need access to symbols from flang
if(FLANG_PLUGIN_SUPPORT)
- export_executable_symbols_for_plugins(flang-new)
+ export_executable_symbols_for_plugins(flang)
endif()
-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 @@
llvm::InitLLVM x(argc, argv);
llvm::SmallVector<const char *, 256> args(argv, argv + argc);
- clang::driver::ParsedClangName targetandMode("flang", "--driver-mode=flang");
+ clang::driver::ParsedClangName targetandMode =
+ clang::driver::ToolChain::getTargetAndModeFromProgramName(argv[0]);
std::string driverPath = getExecutablePath(args[0]);
llvm::BumpPtrAllocator a;
llvm::StringSaver saver(a);
ExpandResponseFiles(saver, args);
- // Check if flang-new is in the frontend mode
+ // Check if flang is in the frontend mode
auto firstArg = std::find_if(args.begin() + 1, args.end(),
[](const char *a) { return a != nullptr; });
if (firstArg != args.end()) {
@@ -104,7 +104,7 @@
<< "Valid tools include '-fc1'.\n";
return 1;
}
- // Call flang-new frontend
+ // Call flang frontend
if (llvm::StringRef(args[1]).starts_with("-fc1")) {
return executeFC1Tool(args);
}

View File

@@ -5,11 +5,9 @@ _compiler=clang
_realname=flang
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
_version=19.1.7
_rc=""
_tag=llvmorg-${_version}${_rc}
pkgver=${_version}${_rc/-/}
pkgrel=2
_pkgver=20.1.0
pkgver=${_pkgver/-/}
pkgrel=1
pkgdesc="Fortran frontend for LLVM (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64')
@@ -35,28 +33,26 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra"
"${MINGW_PACKAGE_PREFIX}-gcc")
)
optdepends=("${MINGW_PACKAGE_PREFIX}-llvm-openmp")
_pkgfn=${_realname}-${pkgver}.src
_url=https://github.com/llvm/llvm-project/releases/download/${_tag}
_pkgfn=${_realname}-${_pkgver}.src
_url=https://github.com/llvm/llvm-project/releases/download/llvmorg-${_pkgver}
source=("${_url}/${_pkgfn}.tar.xz"{,.sig}
"${_url}/cmake-${pkgver}.src.tar.xz"{,.sig}
"${_url}/cmake-${_pkgver}.src.tar.xz"{,.sig}
"0001-fold-double-bessel-functions-on-windows.patch"
"0002-cmake-22162.patch"
"0003-flang-Inherit-target-specific-code-for-BIND-C-types.patch"
"0004-do-not-define-pid_t-on-mingw.patch"
"0005-Fix-c_long_double-value-on-mingw-aarch64.patch"
"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=('632d598e990500c021a47b4f981efd39518d363b03d99da5ba4c1b14d838c40b'
sha256sums=('08b1e0665bed7d91741e3eea06b9802c78e73a7dc581efb8b4b2f12e16d658e1'
'SKIP'
'11c5a28f90053b0c43d0dec3d0ad579347fc277199c005206b963c19aae514e3'
'9fcd319c6bb87344673f262ef5a6a01262fc9a0a741f3477b7e47e238441268d'
'SKIP'
'ae666c454909f6695bcd69f067b9c5abf8a6e82ce2930955b8598ab3b58a5204'
'77fb0612217b6af7a122f586a9d0d334cd48bb201509bf72e8f8e6244616e895'
'bb7336e461a09d4af29cde2fd32081c8fcca7f93e9f9b6779eb074b3780fd002'
'90bec8f2a9a8d62b57959722f3b15a54dfdaf24e0a5ea884bf6b1288d0853be8'
'a1811227e2a26c2786b0c8577528580e679111f6c0889afea57d08333e2d5e4f'
'f1b7a186e4890a67adc8e56800c7a91e72f04f14df3db20d7bcf7eaa149aa567'
'45f8da68b2cb48c85db7099e174e7eebeabe90207a23ff19c7fe1e7f1f8541d8'
'be1265d4922f45cc4e7ec6a80247baba8b1e648e1e514718ebd1004958bae967')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D' # Hans Wennborg, Google.
@@ -73,8 +69,8 @@ apply_patch_with_msg() {
prepare() {
[[ -d ./cmake ]] && rm -rf ./cmake
mv cmake-$pkgver.src cmake
cd "${srcdir}/flang-${pkgver}.src"
mv cmake-${_pkgver}.src cmake
cd "${srcdir}/flang-${_pkgver}.src"
apply_patch_with_msg \
"0001-fold-double-bessel-functions-on-windows.patch" \
@@ -84,9 +80,6 @@ prepare() {
"0005-Fix-c_long_double-value-on-mingw-aarch64.patch" \
"0007-add-municode-flag-on-mingw.patch" \
"0008-do-not-use-clock_gettime-on-mingw.patch"
# https://github.com/llvm/llvm-project/commit/06eb10da
apply_patch_with_msg \
"0006-Rename-flang-new-flang-experimental-exec-to-flang.patch"
}
build() {