Update to LLVM 16.0.0 RC3

This commit is contained in:
Tulio Magno Quites Machado Filho 2023-03-03 11:29:29 -03:00
parent 0b02061757
commit ef3d5e9507
12 changed files with 345 additions and 146 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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::Unwrap<parser::DoConstruct>(*nextIt)}) {
- if (doCons->GetLoopControl()) {
- // move DoConstruct
- std::get<std::optional<parser::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::optional<parser::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::Unwrap<parser::DoConstruct>(*nextIt)}) {
- if (doCons->GetLoopControl()) {
- // move DoConstruct
- std::get<std::optional<parser::DoConstruct>>(x.t) =
- std::move(*doCons);
- nextIt = block.erase(nextIt);
- // try to match AccEndCombinedDirective
- if (nextIt != block.end()) {
- if (auto *endDir{
- parser::Unwrap<parser::AccEndCombinedDirective>(*nextIt)}) {
- std::get<std::optional<parser::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::optional<parser::DoConstruct>>(x.t) = std::move(*doCons);
+ nextIt = block.erase(nextIt);
+ // try to match AccEndCombinedDirective
+ if (nextIt != block.end()) {
+ if (auto *endDir{
+ parser::Unwrap<parser::AccEndCombinedDirective>(*nextIt)}) {
+ std::get<std::optional<parser::AccEndCombinedDirective>>(x.t) =
+ std::move(*endDir);
+ block.erase(nextIt);
+ }
}
CheckDoConcurrentClauseRestriction<parser::OpenACCCombinedConstruct,
--
2.39.2

View File

@ -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

View File

@ -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

View File

@ -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

37
TestAliasAnalysis.h Normal file
View File

@ -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

View File

@ -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-%{flang_version}%{?rc_ver:-rc%{rc_ver}}/clang/include/clang/Driver/Options.td
Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{flang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{flang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig
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

View File

@ -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