The package rpms/flang.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/flang.git/commit/?id=f1b2055e2b7efe6....
Change: +ExcludeArch: i686 s390x
Thanks.
Full change: ============
commit 98b06960c7b59b5ed059914f020b26bb6934a479 Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Mon Apr 3 15:47:08 2023 -0300
Fix mlir header path
A recent modification in mlir package modified where this header is expected to be.
diff --git a/flang.spec b/flang.spec index 24ccf75..fb732c0 100644 --- a/flang.spec +++ b/flang.spec @@ -12,7 +12,7 @@
Name: flang Version: %{flang_version}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: a Fortran language front-end designed for integration with LLVM
License: Apache-2.0 WITH LLVM-exception @@ -109,8 +109,8 @@ Documentation for Flang mkdir -p ../clang/include/clang/Driver cp %{SOURCE3} ../clang/include/clang/Driver
-mkdir -p ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ -cp %{SOURCE4} ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ +mkdir -p include/mlir/test/lib/Analysis/ +cp %{SOURCE4} include/mlir/test/lib/Analysis/
%build %cmake -GNinja \ @@ -241,6 +241,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %doc %{_pkgdocdir}/html/
%changelog +* Mon Apr 03 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0-2 +- Fix mlir header path + * Tue Mar 21 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0-1 - Update to LLVM 16.0.0
commit dff62cc1948b3d7af38877920f90860ad60b31aa Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Thu Mar 23 14:56:37 2023 -0300
Update to LLVM 16.0.0 and a couple of improvements
1. Replace 0001-Changes-the-path-to-gtest.patch with the usage of LLVM_COMMON_CMAKE_UTILS. 2. Replace the entire cmake source code with 0001-Flang-Fix-CMakePolicy.cmake.patch. 3. Added a patch that fixes a test for the trile ppc64le-redhat-linux.
diff --git a/0001-Changes-the-path-to-gtest.patch b/0001-Changes-the-path-to-gtest.patch deleted file mode 100644 index 52aee71..0000000 --- a/0001-Changes-the-path-to-gtest.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5d33b53c9330c3687ac11cc749e81fc0dae4ca7f Mon Sep 17 00:00:00 2001 -From: Tulio Magno Quites Machado Filho tuliom@redhat.com -Date: Mon, 20 Feb 2023 14:57:29 -0300 -Subject: [PATCH] Changes the path to gtest - ---- - flang/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt -index b048ea220e20..03bbfd9b8ec0 100644 ---- a/flang/CMakeLists.txt -+++ b/flang/CMakeLists.txt -@@ -171,7 +171,7 @@ if (FLANG_STANDALONE_BUILD) - #Handle unittests when out-of-tree - set(FLANG_GTEST_AVAIL 0) - if (FLANG_INCLUDE_TESTS) -- set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest) -+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) - if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h) - if (NOT TARGET llvm_gtest) - add_subdirectory(${UNITTEST_DIR} third-party/unittest) --- -2.39.1 - diff --git a/0001-Flang-Fix-CMakePolicy.cmake.patch b/0001-Flang-Fix-CMakePolicy.cmake.patch new file mode 100644 index 0000000..a229aec --- /dev/null +++ b/0001-Flang-Fix-CMakePolicy.cmake.patch @@ -0,0 +1,30 @@ +From defdc076b6030e724ac4c8b52142b97950fa1648 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho tuliom@redhat.com +Date: Thu, 23 Mar 2023 09:18:23 -0300 +Subject: [PATCH] [Flang] Fix CMakePolicy.cmake + +Let LLVM_COMMON_CMAKE_UTILS store the directory where cmake modules are +available and stop assuming its directory structure. +--- + flang/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt +index 03bbfd9b8ec0..62f69f52b2e5 100644 +--- a/flang/CMakeLists.txt ++++ b/flang/CMakeLists.txt +@@ -1,9 +1,9 @@ + cmake_minimum_required(VERSION 3.13.4) + + if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS) +- set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) ++ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules) + endif() +-include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake ++include(${LLVM_COMMON_CMAKE_UTILS}/CMakePolicy.cmake + NO_POLICY_SCOPE) + + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) +-- +2.39.2 + diff --git a/0001-PowerPC-Flang-Fix-triple.patch b/0001-PowerPC-Flang-Fix-triple.patch new file mode 100644 index 0000000..93b4d1a --- /dev/null +++ b/0001-PowerPC-Flang-Fix-triple.patch @@ -0,0 +1,26 @@ +From a17ee723f05887f291937750c81ea86422f7e4fd Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho tuliom@redhat.com +Date: Thu, 23 Mar 2023 08:25:14 -0300 +Subject: [PATCH] [PowerPC][Flang] Fix triple + +Some Linux distributions use ppc64le instead of powerpc. +--- + flang/test/Driver/fast_math.f90 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/test/Driver/fast_math.f90 b/flang/test/Driver/fast_math.f90 +index aadd7231b52b..8a63832e2259 100644 +--- a/flang/test/Driver/fast_math.f90 ++++ b/flang/test/Driver/fast_math.f90 +@@ -58,7 +58,7 @@ + + ! Check that -ffast-math causes us to link to crtfastmath.o + ! UNSUPPORTED: system-windows +-! UNSUPPORTED: target=powerpc{{.*}} ++! UNSUPPORTED: target={{(ppc|powerpc).*}} + ! RUN: %flang -ffast-math -### %s -o %t 2>&1 \ + ! RUN: | FileCheck --check-prefix=CHECK-CRT %s + ! CHECK-CRT: {{crtbegin.?.o}} +-- +2.39.2 + diff --git a/flang.spec b/flang.spec index 6b8d59e..24ccf75 100644 --- a/flang.spec +++ b/flang.spec @@ -1,7 +1,7 @@ %global maj_ver 16 %global min_ver 0 %global patch_ver 0 -%global rc_ver 4 +#global rc_ver 4 %global flang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global flang_srcdir flang-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src %global cmake_srcdir cmake-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src @@ -24,15 +24,12 @@ Source2: release-keys.asc # flang depends on one internal clang tablegen file for documentation generation. Source3: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%%7Bflang_versio...
-Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%%7Bflang_ver... -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%%7Bflang_ver... - -Source6: TestAliasAnalysis.h +Source4: TestAliasAnalysis.h
# Needed for documentation generation Patch1: 0001-PATCH-flang-Disable-use-of-sphinx_markdown_tables.patch
-Patch2: 0001-Changes-the-path-to-gtest.patch +Patch2: 0001-Flang-Fix-CMakePolicy.cmake.patch
# The Bye plugin is not distributed on Fedora. Patch3: 0001-flang-Remove-the-dependency-on-Bye.patch @@ -43,6 +40,9 @@ Patch4: remove-clangBasic-dependency.diff # Fedora uses CLANG_DEFAULT_PIE_ON_LINUX=OFF. Patch5: 0001-Match-Fedora-s-value-for-CLANG_DEFAULT_PIE_ON_LINUX.patch
+# Fedora and RHEL use a different triple for ppc64le +Patch6: 0001-PowerPC-Flang-Fix-triple.patch + # Backports from LLVM 17: Patch20: 0001-flang-Fixed-restrictions-checking-for-OpenACC-loop-a.patch Patch21: 0001-flang-Fixed-uninitialized-std-unique_ptr-dereference.patch @@ -74,6 +74,7 @@ BuildRequires: ninja-build BuildRequires: python3-lit >= 12.0.0 BuildRequires: python3-sphinx BuildRequires: python3-recommonmark +BuildRequires: doxygen
# The new flang drive requires clang-devel BuildRequires: clang-devel = %{version} @@ -103,19 +104,13 @@ Documentation for Flang
%prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE5}' --data='%{SOURCE4}' -%setup -T -q -b 4 -n %{cmake_srcdir} -# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, -# but this is not a CACHED variable, so we can't actually set it externally :( -cd .. -mv %{cmake_srcdir} cmake %autosetup -n %{flang_srcdir} -p2 # Copy Options.td for docs generation mkdir -p ../clang/include/clang/Driver cp %{SOURCE3} ../clang/include/clang/Driver
mkdir -p ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ -cp %{SOURCE6} ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ +cp %{SOURCE4} ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/
%build %cmake -GNinja \ @@ -127,10 +122,10 @@ cp %{SOURCE6} ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/te -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ - -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ - -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ + -DLLVM_THIRD_PARTY_DIR=%{_datadir}/llvm/src/utils \ -DCMAKE_PREFIX_PATH=%{_libdir}/cmake/llvm/ \ + -DLLVM_COMMON_CMAKE_UTILS=%{_libdir}/cmake/llvm/ \ \ -DFLANG_INCLUDE_DOCS:BOOL=ON \ -DLLVM_ENABLE_SPHINX:BOOL=ON \ @@ -246,6 +241,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %doc %{_pkgdocdir}/html/
%changelog +* Tue Mar 21 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0-1 +- Update to LLVM 16.0.0 + * Thu Mar 16 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc4-1 - Update to LLVM 16.0.0 RC4
diff --git a/sources b/sources index c2505ce..fcc2853 100644 --- a/sources +++ b/sources @@ -1,5 +1,3 @@ -SHA512 (cmake-16.0.0rc4.src.tar.xz) = 888cd3cf6a8eeca1306ab8a45fbcf0fdc91f10e34dc29a0bf7aef5b1efc9af0ab54866584857fbfb725147c8e4bc1a11e8a1b247fe439ebf93fe6a73fb004101 -SHA512 (cmake-16.0.0rc4.src.tar.xz.sig) = c2e4d7b79c5d2524449b8444eb4a9e1e625c50fc27dabcdd7410f44cc5b67cdd7931a5f31bc4b7652a034687d10d551aa9d89e3c01771d1b3e42b2b3a901745f -SHA512 (flang-16.0.0rc4.src.tar.xz) = c030c113b9c0c23e4020769b91adff042503ea69f29c887709afc846979c9efdddc13f594fc45d68cf41e78fe1f614d82308fd90781059c6ea9ab9de49c7fcad -SHA512 (flang-16.0.0rc4.src.tar.xz.sig) = 0d713288c48f0014d8bd709eadd8f40c090a623643d4f4e172b95f635c0ff88a11f81517b3b64d466009f140e76ba4089bd5a57200147cb331a1b4fbbc33f68e +SHA512 (flang-16.0.0.src.tar.xz) = 3d7ebe4eb80336a28fe8d4ab5b9e006b93184f77a6865391e2d5d21e882814b789aeaca719b0c347e49c886cba0b7cee2a5d478a7325c4921c2b6aa9ee18b99d +SHA512 (flang-16.0.0.src.tar.xz.sig) = 06e677484890b668764d8824cfb235ae686fd378139741d75e5b96bcb890c887cad70bce90c6fc8ac4c4c57774c45836883a8a1833975b7d9b111b54d2d2e7d2 SHA512 (Options.td) = aac6bae599ff35c9e94f83f97f6d118ee55d385398195d59ac16b9787989015e7fe108d77153c1f410206dc060f695790dee2113e41ac353d73c4740c0ed518f
commit 37cac20d19b0aba3c38b5737d67fd59dcf7f5a8f Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Fri Mar 17 11:21:17 2023 -0300
Update to LLVM 16.0.0 RC4
diff --git a/flang.spec b/flang.spec index fe96836..6b8d59e 100644 --- a/flang.spec +++ b/flang.spec @@ -1,7 +1,7 @@ %global maj_ver 16 %global min_ver 0 %global patch_ver 0 -%global rc_ver 3 +%global rc_ver 4 %global flang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global flang_srcdir flang-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src %global cmake_srcdir cmake-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src @@ -12,7 +12,7 @@
Name: flang Version: %{flang_version}%{?rc_ver:~rc%{rc_ver}} -Release: 2%{?dist} +Release: 1%{?dist} Summary: a Fortran language front-end designed for integration with LLVM
License: Apache-2.0 WITH LLVM-exception @@ -246,6 +246,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %doc %{_pkgdocdir}/html/
%changelog +* Thu Mar 16 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc4-1 +- Update to LLVM 16.0.0 RC4 + * Tue Mar 14 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc3-2 - Stop building on s390x
diff --git a/sources b/sources index 60e90fc..c2505ce 100644 --- a/sources +++ b/sources @@ -1,3 +1,5 @@ -SHA512 (flang-15.0.7.src.tar.xz) = ce585877b6e8b3fb0b1c5830bd2d719f7f07b67ec21581394b8a152583c833dab8c25931129368c6a9a86e7863d30662c4fdc1f4c673532ea77635015c70ed6e -SHA512 (flang-15.0.7.src.tar.xz.sig) = 0fb8cd22ac74d756d47912599b4901a4ccce89e723b399875d0e4cb4ba6d1e76cf9a2e548bf4391ef779df1dfd5f1adf9feeba763dd569a97c89bfaf4b816e7e +SHA512 (cmake-16.0.0rc4.src.tar.xz) = 888cd3cf6a8eeca1306ab8a45fbcf0fdc91f10e34dc29a0bf7aef5b1efc9af0ab54866584857fbfb725147c8e4bc1a11e8a1b247fe439ebf93fe6a73fb004101 +SHA512 (cmake-16.0.0rc4.src.tar.xz.sig) = c2e4d7b79c5d2524449b8444eb4a9e1e625c50fc27dabcdd7410f44cc5b67cdd7931a5f31bc4b7652a034687d10d551aa9d89e3c01771d1b3e42b2b3a901745f +SHA512 (flang-16.0.0rc4.src.tar.xz) = c030c113b9c0c23e4020769b91adff042503ea69f29c887709afc846979c9efdddc13f594fc45d68cf41e78fe1f614d82308fd90781059c6ea9ab9de49c7fcad +SHA512 (flang-16.0.0rc4.src.tar.xz.sig) = 0d713288c48f0014d8bd709eadd8f40c090a623643d4f4e172b95f635c0ff88a11f81517b3b64d466009f140e76ba4089bd5a57200147cb331a1b4fbbc33f68e SHA512 (Options.td) = aac6bae599ff35c9e94f83f97f6d118ee55d385398195d59ac16b9787989015e7fe108d77153c1f410206dc060f695790dee2113e41ac353d73c4740c0ed518f
commit f1b2055e2b7efe63eb517e2404a0f6e37ba5b461 Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Tue Mar 14 16:39:59 2023 -0300
Stop building on s390x
diff --git a/flang.spec b/flang.spec index 7d81a93..fe96836 100644 --- a/flang.spec +++ b/flang.spec @@ -12,7 +12,7 @@
Name: flang Version: %{flang_version}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: a Fortran language front-end designed for integration with LLVM
License: Apache-2.0 WITH LLVM-exception @@ -58,8 +58,9 @@ Patch22: 0001-flang-Fix-dereference-of-std-optional-with-no-value.patch %global debug_package %{nil} %endif
-# Link error on that target -ExcludeArch: i686 +# Link error on i686. +# s390x is not supported upstream yet. +ExcludeArch: i686 s390x
BuildRequires: gcc BuildRequires: gcc-c++ @@ -245,6 +246,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %doc %{_pkgdocdir}/html/
%changelog +* Tue Mar 14 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc3-2 +- Stop building on s390x + * Mon Feb 27 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc3-1 - Update to LLVM 16.0.0 RC3
commit 17ed8191326da0b98803745006852360979357bf Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Fri Mar 3 11:29:39 2023 -0300
Replace many entries in .gitignore with a few globs
diff --git a/.gitignore b/.gitignore index 8857616..fb7cfd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,61 +1,4 @@ -/flang-11.0.0rc2.src.tar.xz -/flang-11.0.0rc2.src.tar.xz.sig -/flang-11.0.0rc3.src.tar.xz -/flang-11.0.0rc3.src.tar.xz.sig -/flang-11.0.0rc5.src.tar.xz -/flang-11.0.0rc5.src.tar.xz.sig -/flang-11.0.0rc6.src.tar.xz -/flang-11.0.0rc6.src.tar.xz.sig -/flang-11.0.0.src.tar.xz -/flang-11.0.0.src.tar.xz.sig -/flang-11.0.1rc1.src.tar.xz -/flang-11.0.1rc1.src.tar.xz.sig -/flang-11.0.1rc2.src.tar.xz -/flang-11.0.1rc2.src.tar.xz.sig -/flang-11.0.1.src.tar.xz -/flang-11.0.1.src.tar.xz.sig -/flang-11.1.0rc1.src.tar.xz -/flang-11.1.0rc1.src.tar.xz.sig -/flang-12.0.0rc1.src.tar.xz -/flang-12.0.0rc1.src.tar.xz.sig -/flang-12.0.0rc2.src.tar.xz -/flang-12.0.0rc2.src.tar.xz.sig -/flang-12.0.0rc3.src.tar.xz -/flang-12.0.0rc3.src.tar.xz.sig -/flang-12.0.0rc4.src.tar.xz -/flang-12.0.0rc4.src.tar.xz.sig -/flang-12.0.0rc5.src.tar.xz -/flang-12.0.0rc5.src.tar.xz.sig -/flang-12.0.0.src.tar.xz -/flang-12.0.0.src.tar.xz.sig -/flang-12.0.1rc1.src.tar.xz -/flang-12.0.1rc1.src.tar.xz.sig -/flang-12.0.1rc3.src.tar.xz -/flang-12.0.1rc3.src.tar.xz.sig -/flang-12.0.1.src.tar.xz -/flang-12.0.1.src.tar.xz.sig -/flang-13.0.0rc1.src.tar.xz -/flang-13.0.0rc1.src.tar.xz.sig -/flang-13.0.0rc3.src.tar.xz -/flang-13.0.0rc3.src.tar.xz.sig -/flang-13.0.0.src.tar.xz -/flang-13.0.0.src.tar.xz.sig -/flang-13.0.1rc1.src.tar.xz -/flang-13.0.1rc1.src.tar.xz.sig -/flang-13.0.1rc2.src.tar.xz -/flang-13.0.1rc2.src.tar.xz.sig -/flang-13.0.1.src.tar.xz -/flang-13.0.1.src.tar.xz.sig -/flang-14.0.0.src.tar.xz -/flang-14.0.0.src.tar.xz.sig -/flang-14.0.5.src.tar.xz -/flang-14.0.5.src.tar.xz.sig -/flang-15.0.0.src.tar.xz -/flang-15.0.0.src.tar.xz.sig +/*.src.rpm +/*.tar.xz +/*.tar.xz.sig /Options.td -/flang-15.0.4.src.tar.xz -/flang-15.0.4.src.tar.xz.sig -/flang-15.0.6.src.tar.xz -/flang-15.0.6.src.tar.xz.sig -/flang-15.0.7.src.tar.xz -/flang-15.0.7.src.tar.xz.sig
commit ef3d5e950735034170e33ae4273026bb1ec14c22 Author: Tulio Magno Quites Machado Filho tuliom@redhat.com Date: Fri Mar 3 11:29:29 2023 -0300
Update to LLVM 16.0.0 RC3
diff --git a/0001-Changes-the-path-to-gtest.patch b/0001-Changes-the-path-to-gtest.patch new file mode 100644 index 0000000..52aee71 --- /dev/null +++ b/0001-Changes-the-path-to-gtest.patch @@ -0,0 +1,25 @@ +From 5d33b53c9330c3687ac11cc749e81fc0dae4ca7f Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho tuliom@redhat.com +Date: Mon, 20 Feb 2023 14:57:29 -0300 +Subject: [PATCH] Changes the path to gtest + +--- + flang/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt +index b048ea220e20..03bbfd9b8ec0 100644 +--- a/flang/CMakeLists.txt ++++ b/flang/CMakeLists.txt +@@ -171,7 +171,7 @@ if (FLANG_STANDALONE_BUILD) + #Handle unittests when out-of-tree + set(FLANG_GTEST_AVAIL 0) + if (FLANG_INCLUDE_TESTS) +- set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest) ++ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) + if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h) + if (NOT TARGET llvm_gtest) + add_subdirectory(${UNITTEST_DIR} third-party/unittest) +-- +2.39.1 + diff --git a/0001-Flang-Explicitly-include-cstdint-NFC.patch b/0001-Flang-Explicitly-include-cstdint-NFC.patch deleted file mode 100644 index e64f52a..0000000 --- a/0001-Flang-Explicitly-include-cstdint-NFC.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 01f8544e8d7ab70330b551c2433409181adccf20 Mon Sep 17 00:00:00 2001 -From: Nikita Popov npopov@redhat.com -Date: Thu, 19 Jan 2023 14:28:58 +0100 -Subject: [PATCH] [Flang] Explicitly include cstdint (NFC) - -This header uses std::int8_t, but does not include cstdint. - -This fixes the build against libstc++ 13, where some indirect -header includes have been removed. ---- - flang/include/flang/Parser/characters.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/flang/include/flang/Parser/characters.h b/flang/include/flang/Parser/characters.h -index 1a7d395be2bf..239be8d4bf4a 100644 ---- a/flang/include/flang/Parser/characters.h -+++ b/flang/include/flang/Parser/characters.h -@@ -14,6 +14,7 @@ - // also to accomodate Fortran tokenization. - - #include <cstddef> -+#include <cstdint> - #include <optional> - #include <string> - --- -2.39.0 - diff --git a/0001-Match-Fedora-s-value-for-CLANG_DEFAULT_PIE_ON_LINUX.patch b/0001-Match-Fedora-s-value-for-CLANG_DEFAULT_PIE_ON_LINUX.patch new file mode 100644 index 0000000..0409865 --- /dev/null +++ b/0001-Match-Fedora-s-value-for-CLANG_DEFAULT_PIE_ON_LINUX.patch @@ -0,0 +1,26 @@ +From fc7353c8ad082fd50d914eeedd1b328433a49d3e Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho tuliom@redhat.com +Date: Wed, 1 Mar 2023 12:13:01 -0300 +Subject: [PATCH] Match Fedora's value for CLANG_DEFAULT_PIE_ON_LINUX + +Fedora uses CLANG_DEFAULT_PIE_ON_LINUX=OFF. +--- + flang/test/Driver/pic-flags.f90 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/test/Driver/pic-flags.f90 b/flang/test/Driver/pic-flags.f90 +index fb6ab701c382..9edba769aefa 100644 +--- a/flang/test/Driver/pic-flags.f90 ++++ b/flang/test/Driver/pic-flags.f90 +@@ -1,7 +1,7 @@ + ! REQUIRES: aarch64-registered-target && x86-registered-target && arm-registered-target + ! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fno-pie 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-STATIC,CHECK-STATIC-IR + +-! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR ++! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-STATIC,CHECK-STATIC-IR + ! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fpie 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL1,CHECK-PIE-LEVEL1-IR + ! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fPIE 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR + +-- +2.39.2 + diff --git a/0001-Use-find_program-for-clang-tblgen.patch b/0001-Use-find_program-for-clang-tblgen.patch deleted file mode 100644 index 267078e..0000000 --- a/0001-Use-find_program-for-clang-tblgen.patch +++ /dev/null @@ -1,25 +0,0 @@ -From de2d9020fd508494262c49ffe66dccdec741e917 Mon Sep 17 00:00:00 2001 -From: Nikita Popov npopov@redhat.com -Date: Mon, 8 Aug 2022 12:40:49 +0200 -Subject: [PATCH] Use find_program for clang-tblgen - ---- - flang/docs/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt -index 770343cd29b8..3414b8e3acc4 100644 ---- a/flang/docs/CMakeLists.txt -+++ b/flang/docs/CMakeLists.txt -@@ -126,7 +126,7 @@ if (LLVM_ENABLE_SPHINX) - ARGS ${CMAKE_CURRENT_BINARY_DIR}/Source/FIR/CreateFIRLangRef.py) - - # CLANG_TABLEGEN_EXE variable needs to be set for clang_tablegen to run without error -- set(CLANG_TABLEGEN_EXE clang-tblgen) -+ find_program(CLANG_TABLEGEN_EXE "clang-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) - gen_rst_file_from_td(FlangCommandLineReference.rst -gen-opt-docs FlangOptionsDocs.td docs-flang-html) - endif() - if (${SPHINX_OUTPUT_MAN}) --- -2.37.1 - diff --git a/0001-flang-Fix-dereference-of-std-optional-with-no-value.patch b/0001-flang-Fix-dereference-of-std-optional-with-no-value.patch new file mode 100644 index 0000000..86e2a52 --- /dev/null +++ b/0001-flang-Fix-dereference-of-std-optional-with-no-value.patch @@ -0,0 +1,26 @@ +From 6772966dcdf5175c517832c1b2352b4fcd1d6b16 Mon Sep 17 00:00:00 2001 +From: Jay Foad jay.foad@amd.com +Date: Thu, 26 Jan 2023 17:27:56 +0000 +Subject: [PATCH] [flang] Fix dereference of std::optional with no value + +Differential Revision: https://reviews.llvm.org/D142648 +--- + flang/lib/Optimizer/Builder/Character.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/lib/Optimizer/Builder/Character.cpp b/flang/lib/Optimizer/Builder/Character.cpp +index de4a5579620d..aa455e768a08 100644 +--- a/flang/lib/Optimizer/Builder/Character.cpp ++++ b/flang/lib/Optimizer/Builder/Character.cpp +@@ -422,7 +422,7 @@ void fir::factory::CharacterExprHelper::createAssign( + (lhsCstLen && rhsCstLen && *lhsCstLen == *rhsCstLen) || + (rhs.getLen() == lhs.getLen()); + +- if (compileTimeSameLength && *lhsCstLen == 1) { ++ if (compileTimeSameLength && lhsCstLen && *lhsCstLen == 1) { + createLengthOneAssign(lhs, rhs); + return; + } +-- +2.39.2 + diff --git a/0001-flang-Fixed-restrictions-checking-for-OpenACC-loop-a.patch b/0001-flang-Fixed-restrictions-checking-for-OpenACC-loop-a.patch new file mode 100644 index 0000000..ff645f4 --- /dev/null +++ b/0001-flang-Fixed-restrictions-checking-for-OpenACC-loop-a.patch @@ -0,0 +1,95 @@ +From 02445263e2f533573a935c1bd502d848bbe6bb27 Mon Sep 17 00:00:00 2001 +From: Slava Zakharin szakharin@nvidia.com +Date: Thu, 26 Jan 2023 14:20:47 -0800 +Subject: [PATCH] [flang] Fixed restrictions checking for OpenACC + loop-associated constructs. + +CheckDoConcurrentClauseRestriction and CheckTileClauseRestriction expect +that the construct has associated DoConstruct, while it is not set +when the do-loop has no loop control. The change is to skip the clauses +checks, when the do-loop does not have the loop control. + +An alternative fix would be to associate the DoConstruct even when +the do-loop has no loop control and let Check*ClauseRestriction run their +checks, but I am not sure if associating invalid DoConstruct is a good idea. + +This fixes failure in Semantics/OpenACC/acc-canonicalization-validity.f90 +reported in D142279. + +Reviewed By: clementval + +Differential Revision: https://reviews.llvm.org/D142652 +--- + flang/lib/Semantics/canonicalize-acc.cpp | 41 ++++++++++++------------ + 1 file changed, 20 insertions(+), 21 deletions(-) + +diff --git a/flang/lib/Semantics/canonicalize-acc.cpp b/flang/lib/Semantics/canonicalize-acc.cpp +index 855f62f53ff8..5afae172cfaa 100644 +--- a/flang/lib/Semantics/canonicalize-acc.cpp ++++ b/flang/lib/Semantics/canonicalize-acc.cpp +@@ -127,17 +127,17 @@ private: + nextIt = it; + if (++nextIt != block.end()) { + if (auto *doCons{parser::Unwrapparser::DoConstruct(*nextIt)}) { +- if (doCons->GetLoopControl()) { +- // move DoConstruct +- std::get<std::optionalparser::DoConstruct>(x.t) = +- std::move(*doCons); +- nextIt = block.erase(nextIt); +- } else { ++ if (!doCons->GetLoopControl()) { + messages_.Say(dir.source, + "DO loop after the %s directive must have loop control"_err_en_US, + parser::ToUpperCaseLetters(dir.source.ToString())); ++ return; + } + ++ // move DoConstruct ++ std::get<std::optionalparser::DoConstruct>(x.t) = std::move(*doCons); ++ nextIt = block.erase(nextIt); ++ + CheckDoConcurrentClauseRestriction<parser::OpenACCLoopConstruct, + parser::AccBeginLoopDirective>(x); + CheckTileClauseRestriction<parser::OpenACCLoopConstruct, +@@ -173,24 +173,23 @@ private: + nextIt = it; + if (++nextIt != block.end()) { + if (auto *doCons{parser::Unwrapparser::DoConstruct(*nextIt)}) { +- if (doCons->GetLoopControl()) { +- // move DoConstruct +- std::get<std::optionalparser::DoConstruct>(x.t) = +- std::move(*doCons); +- nextIt = block.erase(nextIt); +- // try to match AccEndCombinedDirective +- if (nextIt != block.end()) { +- if (auto *endDir{ +- parser::Unwrapparser::AccEndCombinedDirective(*nextIt)}) { +- std::get<std::optionalparser::AccEndCombinedDirective>(x.t) = +- std::move(*endDir); +- block.erase(nextIt); +- } +- } +- } else { ++ if (!doCons->GetLoopControl()) { + messages_.Say(dir.source, + "DO loop after the %s directive must have loop control"_err_en_US, + parser::ToUpperCaseLetters(dir.source.ToString())); ++ return; ++ } ++ // move DoConstruct ++ std::get<std::optionalparser::DoConstruct>(x.t) = std::move(*doCons); ++ nextIt = block.erase(nextIt); ++ // try to match AccEndCombinedDirective ++ if (nextIt != block.end()) { ++ if (auto *endDir{ ++ parser::Unwrapparser::AccEndCombinedDirective(*nextIt)}) { ++ std::get<std::optionalparser::AccEndCombinedDirective>(x.t) = ++ std::move(*endDir); ++ block.erase(nextIt); ++ } + } + + CheckDoConcurrentClauseRestriction<parser::OpenACCCombinedConstruct, +-- +2.39.2 + diff --git a/0001-flang-Fixed-uninitialized-std-unique_ptr-dereference.patch b/0001-flang-Fixed-uninitialized-std-unique_ptr-dereference.patch new file mode 100644 index 0000000..b61226b --- /dev/null +++ b/0001-flang-Fixed-uninitialized-std-unique_ptr-dereference.patch @@ -0,0 +1,28 @@ +From e054e0da9fd7055142188036ee713e8c0697324b Mon Sep 17 00:00:00 2001 +From: Slava Zakharin szakharin@nvidia.com +Date: Thu, 26 Jan 2023 14:17:13 -0800 +Subject: [PATCH] [flang] Fixed uninitialized std::unique_ptr dereference. + +This fixes unittest failures reported in D142279: + flang-Unit :: Frontend/./FlangFrontendTests/5/7 + flang-Unit :: Frontend/./FlangFrontendTests/6/7 +--- + flang/lib/Frontend/FrontendActions.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp +index 927591cc8e93..7e41565a602c 100644 +--- a/flang/lib/Frontend/FrontendActions.cpp ++++ b/flang/lib/Frontend/FrontendActions.cpp +@@ -781,7 +781,7 @@ void CodeGenAction::executeAction() { + llvmModule->setDataLayout(tm->createDataLayout()); + + // Run LLVM's middle-end (i.e. the optimizer). +- runOptimizationPipeline(*os); ++ runOptimizationPipeline(ci.isOutputStreamNull() ? *os : ci.getOutputStream()); + + if (action == BackendActionTy::Backend_EmitLL) { + llvmModule->print(ci.isOutputStreamNull() ? *os : ci.getOutputStream(), +-- +2.39.2 + diff --git a/0001-flang-Remove-the-dependency-on-Bye.patch b/0001-flang-Remove-the-dependency-on-Bye.patch new file mode 100644 index 0000000..101b988 --- /dev/null +++ b/0001-flang-Remove-the-dependency-on-Bye.patch @@ -0,0 +1,47 @@ +From 11af57106d4b6a2db178d932f58bd3285d1eefc1 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho tuliom@redhat.com +Date: Wed, 22 Feb 2023 18:46:40 -0300 +Subject: [PATCH] [flang] Remove the dependency on Bye + +This plugin is not distributed on Fedora. +--- + flang/test/CMakeLists.txt | 4 ---- + flang/test/Driver/frontend-forwarding.f90 | 2 -- + 2 files changed, 6 deletions(-) + +diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt +index 3252ff37bd21..e059a970591c 100644 +--- a/flang/test/CMakeLists.txt ++++ b/flang/test/CMakeLists.txt +@@ -64,10 +64,6 @@ set(FLANG_TEST_DEPENDS + Fortran_main + FortranDecimal + ) +-if (LLVM_ENABLE_PLUGINS AND NOT WIN32) +- list(APPEND FLANG_TEST_DEPENDS Bye) +-endif() +- + if (FLANG_INCLUDE_TESTS) + if (FLANG_GTEST_AVAIL) + list(APPEND FLANG_TEST_DEPENDS FlangUnitTests) +diff --git a/flang/test/Driver/frontend-forwarding.f90 b/flang/test/Driver/frontend-forwarding.f90 +index beb2a85e76f5..819e45dabd91 100644 +--- a/flang/test/Driver/frontend-forwarding.f90 ++++ b/flang/test/Driver/frontend-forwarding.f90 +@@ -14,7 +14,6 @@ + ! RUN: -fno-signed-zeros \ + ! RUN: -fassociative-math \ + ! RUN: -freciprocal-math \ +-! RUN: -fpass-plugin=Bye%pluginext \ + ! RUN: -mllvm -print-before-all\ + ! RUN: -P \ + ! RUN: | FileCheck %s +@@ -32,5 +31,4 @@ + ! CHECK: "-mreassociate" + ! CHECK: "-freciprocal-math" + ! CHECK: "-fconvert=little-endian" +-! CHECK: "-fpass-plugin=Bye + ! CHECK: "-mllvm" "-print-before-all" +-- +2.39.1 + diff --git a/0001-flang-docs-nfc-Refine-FlangOptionsDocs.td.patch b/0001-flang-docs-nfc-Refine-FlangOptionsDocs.td.patch deleted file mode 100644 index cbb2fd1..0000000 --- a/0001-flang-docs-nfc-Refine-FlangOptionsDocs.td.patch +++ /dev/null @@ -1,78 +0,0 @@ -From b13448c56cf4d918d54ce6af063bcaa5f23f2118 Mon Sep 17 00:00:00 2001 -From: Andrzej Warzynski andrzej.warzynski@arm.com -Date: Tue, 26 Jul 2022 09:49:29 +0000 -Subject: [PATCH] [flang][docs][nfc] Refine FlangOptionsDocs.td - -Currently, FlangOptionsDocs.td doesn't specify `ExcludedFlags` which -means that in the generated documentation file we expose flags that: - * we don't necessarily won't to advertise to our users (e.g. hidden flags), or - * are not supported altogether (e.g. CL options). -This patch defines `ExcludeFlags` to fix that. The definition of -`ExcludeFlags` was copied from Clang so that LLVM frontends have -consistent documentation. - -It might be a bit counter-intuitive that IncludeFlags alone is not -sufficient here. However, the current logic in ClangOptionDocEmitter.cpp -will parse IncludeFlags and print all options that contains one of the -included flags, as well as their aliases. So, for example, for -fopenmp -(which is a supported Flang option), one would also get /fopenmp (i.e. -CL mode equivalent for -fopenmp). By adding ExcludeFlags, we make sure -that such aliases are excluded. - -I've also taken the liberty and moved FlangOptionsDocs.td. Originally it -was located in Flang's "flang/include" directory, but there shouldn't be -any implementation/documentation files there. Instead, I'm moving it to -the "flang/docs" directory. - -Differential Revision: https://reviews.llvm.org/D130558 ---- - flang/docs/CMakeLists.txt | 3 ++- - flang/{include/flang => docs}/FlangOptionsDocs.td | 5 +++-- - 2 files changed, 5 insertions(+), 3 deletions(-) - rename flang/{include/flang => docs}/FlangOptionsDocs.td (85%) - -diff --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt -index b742be5e12f4..770343cd29b8 100644 ---- a/flang/docs/CMakeLists.txt -+++ b/flang/docs/CMakeLists.txt -@@ -97,6 +97,7 @@ function (gen_rst_file_from_td output_file td_option source docs_target) - endif() - get_filename_component(TABLEGEN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${source}" DIRECTORY) - list(APPEND LLVM_TABLEGEN_FLAGS "-I${TABLEGEN_INCLUDE_DIR}") -+ list(APPEND LLVM_TABLEGEN_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../../clang/include/clang/Driver/") - clang_tablegen(Source/${output_file} ${td_option} SOURCE ${source} TARGET "gen-${output_file}") - add_dependencies(${docs_target} "gen-${output_file}") - endfunction() -@@ -126,7 +127,7 @@ if (LLVM_ENABLE_SPHINX) - - # CLANG_TABLEGEN_EXE variable needs to be set for clang_tablegen to run without error - set(CLANG_TABLEGEN_EXE clang-tblgen) -- gen_rst_file_from_td(FlangCommandLineReference.rst -gen-opt-docs ../include/flang/FlangOptionsDocs.td docs-flang-html) -+ gen_rst_file_from_td(FlangCommandLineReference.rst -gen-opt-docs FlangOptionsDocs.td docs-flang-html) - endif() - if (${SPHINX_OUTPUT_MAN}) - add_sphinx_target(man flang) -diff --git a/flang/include/flang/FlangOptionsDocs.td b/flang/docs/FlangOptionsDocs.td -similarity index 85% -rename from flang/include/flang/FlangOptionsDocs.td -rename to flang/docs/FlangOptionsDocs.td -index 32054428ad3f..b251849e167f 100644 ---- a/flang/include/flang/FlangOptionsDocs.td -+++ b/flang/docs/FlangOptionsDocs.td -@@ -26,10 +26,11 @@ Introduction - - string Program = "flang"; - -- list<string> ExcludedFlags = []; -+ list<string> ExcludedFlags = ["HelpHidden", "NoDriverOption", -+ "CLOption", "Unsupported", "Ignored"]; - list<string> IncludedFlags = ["FlangOption"]; - - } - - --include "../../../clang/include/clang/Driver/Options.td" -+include "Options.td" --- -2.37.1 - diff --git a/TestAliasAnalysis.h b/TestAliasAnalysis.h new file mode 100644 index 0000000..f84b2fa --- /dev/null +++ b/TestAliasAnalysis.h @@ -0,0 +1,37 @@ +//===- TestAliasAnalysis.h - MLIR Test Utility ------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file provides a common facility that can be reused for the +// testing of various aliasing analyses +// +//===----------------------------------------------------------------------===// + +#ifndef MLIR_TEST_LIB_ANALYSIS_ALIASANALYSIS_H +#define MLIR_TEST_LIB_ANALYSIS_ALIASANALYSIS_H + +#include "mlir/Analysis/AliasAnalysis.h" + +namespace mlir { +namespace test { + +/// Print the result of an alias query. +void printAliasResult(AliasResult result, Value lhs, Value rhs); +void printModRefResult(ModRefResult result, Operation *op, Value location); + +struct TestAliasAnalysisBase { + void runAliasAnalysisOnOperation(Operation *op, AliasAnalysis &aliasAnalysis); +}; + +struct TestAliasAnalysisModRefBase { + void runAliasAnalysisOnOperation(Operation *op, AliasAnalysis &aliasAnalysis); +}; + +} // namespace test +} // namespace mlir + +#endif // MLIR_TEST_LIB_ANALYSIS_ALIASANALYSIS_H diff --git a/flang.spec b/flang.spec index 3571641..7d81a93 100644 --- a/flang.spec +++ b/flang.spec @@ -1,9 +1,10 @@ -%global maj_ver 15 +%global maj_ver 16 %global min_ver 0 -%global patch_ver 7 -#global rc_ver 3 +%global patch_ver 0 +%global rc_ver 3 %global flang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global flang_srcdir flang-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src +%global cmake_srcdir cmake-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src
# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer # https://bugzilla.redhat.com/show_bug.cgi?id=2158587 @@ -11,7 +12,7 @@
Name: flang Version: %{flang_version}%{?rc_ver:~rc%{rc_ver}} -Release: 3%{?dist} +Release: 1%{?dist} Summary: a Fortran language front-end designed for integration with LLVM
License: Apache-2.0 WITH LLVM-exception @@ -23,15 +24,29 @@ Source2: release-keys.asc # flang depends on one internal clang tablegen file for documentation generation. Source3: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%%7Bflang_versio...
+Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%%7Bflang_ver... +Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%%7Bflang_ver... + +Source6: TestAliasAnalysis.h + # Needed for documentation generation Patch1: 0001-PATCH-flang-Disable-use-of-sphinx_markdown_tables.patch -Patch2: link-against-libclang-cpp.patch
-# TODO: Can be dropped for LLVM 16. The first one is a plain backport, and the second -# one has been upstreamed as https://reviews.llvm.org/D131475. -Patch3: 0001-flang-docs-nfc-Refine-FlangOptionsDocs.td.patch -Patch4: 0001-Use-find_program-for-clang-tblgen.patch -Patch5: 0001-Flang-Explicitly-include-cstdint-NFC.patch +Patch2: 0001-Changes-the-path-to-gtest.patch + +# The Bye plugin is not distributed on Fedora. +Patch3: 0001-flang-Remove-the-dependency-on-Bye.patch + +# Fedora does not distribute libclangBasic.a. +Patch4: remove-clangBasic-dependency.diff + +# Fedora uses CLANG_DEFAULT_PIE_ON_LINUX=OFF. +Patch5: 0001-Match-Fedora-s-value-for-CLANG_DEFAULT_PIE_ON_LINUX.patch + +# Backports from LLVM 17: +Patch20: 0001-flang-Fixed-restrictions-checking-for-OpenACC-loop-a.patch +Patch21: 0001-flang-Fixed-uninitialized-std-unique_ptr-dereference.patch +Patch22: 0001-flang-Fix-dereference-of-std-optional-with-no-value.patch
# Avoid gcc reaching 4GB of memory on 32-bit targets and also running out of # memory on builders with many CPUs. @@ -87,21 +102,33 @@ Documentation for Flang
%prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE5}' --data='%{SOURCE4}' +%setup -T -q -b 4 -n %{cmake_srcdir} +# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, +# but this is not a CACHED variable, so we can't actually set it externally :( +cd .. +mv %{cmake_srcdir} cmake %autosetup -n %{flang_srcdir} -p2 # Copy Options.td for docs generation mkdir -p ../clang/include/clang/Driver cp %{SOURCE3} ../clang/include/clang/Driver
+mkdir -p ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ +cp %{SOURCE6} ../llvm-project-%{flang_version}%{?rc_ver:rc%{rc_ver}}.src/mlir/test/lib/Analysis/ + %build %cmake -GNinja \ -DMLIR_TABLEGEN_EXE=%{_bindir}/mlir-tblgen \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_RPATH=";" \ -DCLANG_DIR=%{_libdir}/cmake/clang \ + -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ + -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -DCMAKE_PREFIX_PATH=%{_libdir}/cmake/llvm/ \ \ -DFLANG_INCLUDE_DOCS:BOOL=ON \ @@ -140,10 +167,6 @@ cp -r %{_vpath_builddir}/docs/html/* %{buildroot}%{_pkgdocdir}/html/
%check
-# Assertion failure: lib/Semantics/canonicalize-acc.cpp:93 -# /usr/include/c++/11/optional:447: constexpr const _Tp& std::_Optional_base_impl<_Tp, _Dp>::_M_get() const [with _Tp = Fortran::parser::DoConstruct; _Dp = std::_Optional_base<Fortran::parser::DoConstruct, false, false>]: Assertion 'this->_M_is_engaged()' failed. -rm test/Semantics/OpenACC/acc-canonicalization-validity.f90 - %ifarch s390x rm test/Evaluate/folding07.f90 rm test/Evaluate/fold-nearest.f90 @@ -184,12 +207,15 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %{_libdir}/libFortranParser.so.%{maj_ver}* %{_libdir}/libflangFrontend.so.%{maj_ver}* %{_libdir}/libflangFrontendTool.so.%{maj_ver}* +%{_libdir}/libFIRAnalysis.so.%{maj_ver} %{_libdir}/libFIRBuilder.so.%{maj_ver} %{_libdir}/libFIRCodeGen.so.%{maj_ver} %{_libdir}/libFIRDialect.so.%{maj_ver} %{_libdir}/libFIRSupport.so.%{maj_ver} +%{_libdir}/libFIRTestAnalysis.so.%{maj_ver} %{_libdir}/libFIRTransforms.so.%{maj_ver} - +%{_libdir}/libHLFIRDialect.so.%{maj_ver} +%{_libdir}/libHLFIRTransforms.so.%{maj_ver}
%files devel %{_libdir}/libFortranLower.so @@ -197,16 +223,20 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %{_libdir}/libFortranCommon.so %{_libdir}/libFortranSemantics.so %{_libdir}/libFortran_main.a +%{_libdir}/libFIRAnalysis.so %{_libdir}/libFIRBuilder.so %{_libdir}/libFIRCodeGen.so %{_libdir}/libFIRDialect.so %{_libdir}/libFIRSupport.so +%{_libdir}/libFIRTestAnalysis.so %{_libdir}/libFIRTransforms.so %{_libdir}/libFortranDecimal.so %{_libdir}/libFortranRuntime.so %{_libdir}/libFortranEvaluate.so %{_libdir}/libflangFrontend.so %{_libdir}/libflangFrontendTool.so +%{_libdir}/libHLFIRDialect.so +%{_libdir}/libHLFIRTransforms.so %{_includedir}/flang %{_libdir}/cmake/
@@ -215,6 +245,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{flang_srcdir}/%{_build}/lib %doc %{_pkgdocdir}/html/
%changelog +* Mon Feb 27 2023 Tulio Magno Quites Machado Filho tuliom@redhat.com - 16.0.0~rc3-1 +- Update to LLVM 16.0.0 RC3 + * Thu Jan 19 2023 Nikita Popov npopov@redhat.com - 15.0.7-3 - Fix build with GCC 13
diff --git a/remove-clangBasic-dependency.diff b/remove-clangBasic-dependency.diff new file mode 100644 index 0000000..15540b6 --- /dev/null +++ b/remove-clangBasic-dependency.diff @@ -0,0 +1,13 @@ +diff --git a/flang/unittests/Frontend/CMakeLists.txt b/flang/unittests/Frontend/CMakeLists.txt +index 79a394f161ed..8e535c88e153 100644 +--- a/flang/unittests/Frontend/CMakeLists.txt ++++ b/flang/unittests/Frontend/CMakeLists.txt +@@ -10,7 +10,7 @@ add_flang_unittest(FlangFrontendTests + + target_link_libraries(FlangFrontendTests + PRIVATE +- clangBasic ++ clang-cpp + flangFrontend + flangFrontendTool + FortranLower
arch-excludes@lists.fedoraproject.org