From dc584aef949858c75c4656601f57eb9815277fcf Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sep 13 2017 02:20:57 +0000 Subject: Package libFuzzer The libFuzzer source code is included in the llvm sources for llvm 4.0 and 5.0, but is moved into compiler-rt for LLVM 6.0, so we are packaging it as a part of compiler-rt-4.0.* to keep it consistent with future versions of LLVM. --- diff --git a/.gitignore b/.gitignore index 5710d5c..5d0e442 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /compiler-rt-3.9.1.src.tar.xz /compiler-rt-4.0.0.src.tar.xz /compiler-rt-4.0.1.src.tar.xz +/Fuzzer.tar.xz diff --git a/compiler-rt.spec b/compiler-rt.spec index 5e65a38..8a46da5 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -5,18 +5,30 @@ Name: compiler-rt Version: 4.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: LLVM "compiler-rt" runtime libraries License: NCSA or MIT URL: http://llvm.org Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz +# Extract libFuzzer sources from the llvm tarball. We are packaging it as part +# of compiler-rt, because upstream moved the code into the compiler-rt project +# for LLVM 6.0.0, and we also don't want to add clang as a build dependency for +# llvm. +# wget http://llvm.org/releases/4.0.1/llvm-4.0.1.src.tar.xz +# tar -xJf llvm-4.0.1.src.tar.xz +# cd llvm-4.0.1.src/lib/Fuzzer/ +# tar -cJf Fuzzer.tar.xz Fuzzer/ +Source1: Fuzzer.tar.xz BuildRequires: cmake BuildRequires: python BuildRequires: llvm-devel = %{version} BuildRequires: llvm-static = %{version} +# libFuzzer must be built by clang. +BuildRequires: clang + %description The compiler-rt project is a part of the LLVM project. It provides implementation of the low-level target-specific hooks required by @@ -24,7 +36,9 @@ code generation, sanitizer runtimes and profiling library for code instrumentation, and Blocks C language extension. %prep -%setup -q -n %{name}-%{version}.src +%setup -T -q -b 1 -n Fuzzer + +%autosetup -n %{name}-%{version}.src -p1 %build mkdir -p _build @@ -42,18 +56,26 @@ cd _build make %{?_smp_mflags} +pushd ../../Fuzzer +./build.sh +popd + %install cd _build make install DESTDIR=%{buildroot} +mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib + +pushd ../../Fuzzer +install -m0644 libFuzzer.a %{buildroot}%{_libdir}/clang/%{version}/lib +popd + # move sanitizer lists to better place -mkdir -p %{buildroot}%{_libdir}/clang/%{version} for file in asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt; do mv -v %{buildroot}%{_prefix}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || : done # move sanitizer libs to better place -mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib mv -v %{buildroot}%{_prefix}/lib/linux/libclang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/ pushd %{buildroot}%{_libdir}/clang/%{version}/lib @@ -70,6 +92,9 @@ cd _build %{_libdir}/clang/%{version} %changelog +* Tue Sep 12 2017 Tom Stellard - 4.0.1-2 +- Package libFuzzer + * Fri Jun 23 2017 Tom Stellard - 4.0.1-1 - 4.0.1 Release diff --git a/sources b/sources index eb00615..d9395c8 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (compiler-rt-4.0.0.src.tar.xz) = ed52436a2399ca82c1af46a523e89e88c23367f74cd110f0267af49a72aa4912ae8f48c6093e6b01c9ea68c48354a12201d26baf721d254fb017ddb98af2e3dd SHA512 (compiler-rt-4.0.1.src.tar.xz) = cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649 +SHA512 (Fuzzer.tar.xz) = 74a3df67ac71a1049a97a03f1465162bdee536504b193829842c54c27d879b01a4496f0c276e9626b5d06c1b42190e275de02c8fa05f36d9c2650602b3aa13dd