Compare commits
11 Commits
20a05e493e
...
64734e931e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64734e931e | ||
|
|
1c4f73c658 | ||
|
|
2b5571321d | ||
|
|
efe7e88ec2 | ||
|
|
b2befe59ae | ||
|
|
62bacd7ede | ||
|
|
628bb181e8 | ||
|
|
92729030a5 | ||
|
|
f14d6a939a | ||
|
|
34e54d87b8 | ||
|
|
4f8c673db0 |
@ -0,0 +1,37 @@
|
||||
From 58f4b115f97435efa1df1baa3247791a13444c00 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Tue, 26 Sep 2023 16:51:40 +0200
|
||||
Subject: [PATCH 1/3] [Bitcode] Add some missing GetTypeByID failure checks
|
||||
|
||||
Print an error instead of crashing.
|
||||
|
||||
Fixes https://github.com/llvm/llvm-project/issues/67388.
|
||||
---
|
||||
llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
|
||||
index 0a9a80688a41..2f024899b451 100644
|
||||
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
|
||||
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
|
||||
@@ -1315,7 +1315,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
|
||||
}
|
||||
|
||||
Type *Ty = getTypeByID(Record[0]);
|
||||
- if (Ty->isMetadataTy() || Ty->isVoidTy()) {
|
||||
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy()) {
|
||||
dropRecord();
|
||||
break;
|
||||
}
|
||||
@@ -1366,7 +1366,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
|
||||
return error("Invalid record");
|
||||
|
||||
Type *Ty = getTypeByID(Record[0]);
|
||||
- if (Ty->isMetadataTy() || Ty->isVoidTy())
|
||||
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy())
|
||||
return error("Invalid record");
|
||||
|
||||
MetadataList.assignValue(
|
||||
--
|
||||
2.33.0
|
||||
|
||||
41
llvm.spec
41
llvm.spec
@ -1,15 +1,16 @@
|
||||
Name: llvm
|
||||
Version: 10.0.1
|
||||
Release: 1
|
||||
Release: 4
|
||||
Summary: The Low Level Virtual Machine
|
||||
License: NCSA
|
||||
URL: http://llvm.org
|
||||
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
|
||||
|
||||
Patch1: 0001-Backport-Bitcode-Add-some-missing-GetTypeByID-failure-checks.patch
|
||||
|
||||
BuildRequires: gcc gcc-c++ cmake ninja-build zlib-devel libffi-devel ncurses-devel libstdc++-static
|
||||
BuildRequires: python3-sphinx binutils-devel valgrind-devel libedit-devel python3-devel
|
||||
BuildRequires: python3-recommonmark
|
||||
BuildRequires: llvm-libs
|
||||
|
||||
%description
|
||||
LLVM is a compiler infrastructure designed for compile-time, link-time,
|
||||
@ -54,7 +55,8 @@ Obsoletes: %{name}-doc < %{version}-%{release}
|
||||
The %{name}-help package contains doc files for %{name}.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}.src -p1
|
||||
%setup -T -q -b 0 -n %{name}-%{version}.src
|
||||
%autopatch -p2
|
||||
pathfix.py -i %{__python3} -pn test/BugPoint/compile-custom.ll.py tools/opt-viewer/*.py
|
||||
|
||||
%build
|
||||
@ -67,7 +69,7 @@ cd _build
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF \
|
||||
-DLLVM_PARALLEL_LINK_JOBS=1 \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_RPATH=";" \
|
||||
-DCMAKE_SKIP_RPATH:BOOL=ON \
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
|
||||
%if 0%{?__isa_bits} == 64
|
||||
@ -154,10 +156,6 @@ mkdir -p %{buildroot}%{_libdir}/%{name}
|
||||
cp -R _build/unittests %{buildroot}%{_libdir}/%{name}/
|
||||
find %{buildroot}%{_libdir}/%{name} -ignore_readdir_race -iname 'cmake*' -exec rm -Rf '{}' ';' || true
|
||||
|
||||
#TODO: clang rust mesa packages will be unresolvable without this work-around
|
||||
cp -p %{_libdir}/libLLVM-7*.so %{buildroot}%{_libdir}
|
||||
cp -p %{_libdir}/libLTO.so.7 %{buildroot}%{_libdir}
|
||||
|
||||
%check
|
||||
cd _build
|
||||
ninja check-all || :
|
||||
@ -201,6 +199,33 @@ fi
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Tue Apr 09 2024 liyunfei <liyunfei33@huawei.com> - 10.0.1-4
|
||||
- Type: CVE
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- Backport patch to fix CVE-2023-46049
|
||||
|
||||
* Fri Nov 24 2023 cf-zhao <zhaochuanfeng@huawei.com> - 10.0.1-3
|
||||
- Remove the rpath
|
||||
|
||||
* Tue Feb 2 2021 Liquor <lirui130@huawei.com> - 10.0.1-2
|
||||
- Type: enhancement
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: Delete the so file of old version
|
||||
|
||||
* Sat Oct 10 2020 Liquor <lirui130@huawei.com> - 10.0.1-1
|
||||
- Type: update
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: update to 10.0.1
|
||||
|
||||
* Wed Sep 23 2020 Liquor <lirui130@huawei.com> - 7.0.0-11
|
||||
- Type: downgrade
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC:revert "update to 10.0.1"
|
||||
|
||||
* Mon Aug 24 2020 Liquor <lirui130@huawei.com> - 10.0.1-1
|
||||
- Type: update
|
||||
- ID: NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user