Accepting request 110700 from devel:tools:compiler
- Target i586-linux for 32bit builds bnc#728737 OBS-URL: https://build.opensuse.org/request/show/110700 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/llvm?expand=0&rev=23
This commit is contained in:
commit
f6b56659f6
@ -1,11 +0,0 @@
|
||||
--- tools/clang/tools/libclang/CMakeLists.txt (revision 132071)
|
||||
+++ tools/clang/tools/libclang/CMakeLists.txt (working copy)
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
set_target_properties(libclang
|
||||
PROPERTIES
|
||||
- OUTPUT_NAME "libclang"
|
||||
+ OUTPUT_NAME "clang"
|
||||
VERSION ${LIBCLANG_LIBRARY_VERSION}
|
||||
DEFINE_SYMBOL _CINDEX_LIB_)
|
||||
|
13
default-to-i586.patch
Normal file
13
default-to-i586.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: llvm/tools/clang/lib/Driver/Tools.cpp
|
||||
===================================================================
|
||||
--- llvm.orig/tools/clang/lib/Driver/Tools.cpp
|
||||
+++ llvm/tools/clang/lib/Driver/Tools.cpp
|
||||
@@ -897,7 +897,7 @@ void Clang::AddX86TargetArgs(const ArgLi
|
||||
if (getToolChain().getArch() == llvm::Triple::x86_64)
|
||||
CPUName = "x86-64";
|
||||
else if (getToolChain().getArch() == llvm::Triple::x86)
|
||||
- CPUName = "pentium4";
|
||||
+ CPUName = "i586";
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 20 12:40:27 UTC 2012 - idonmez@suse.com
|
||||
|
||||
- Target i586-linux for 32bit builds
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 27 21:33:48 UTC 2011 - idonmez@suse.com
|
||||
|
||||
|
99
llvm.spec
99
llvm.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package llvm
|
||||
#
|
||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -15,9 +15,10 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%define _revision 145598
|
||||
%define _release_version 3.0
|
||||
%define _supported_archs "ARM;X86"
|
||||
%define _supported_archs "arm,x86"
|
||||
|
||||
Name: llvm
|
||||
Version: 3.0
|
||||
@ -30,8 +31,6 @@ Source0: %{name}-%{version}.tar.bz2
|
||||
Source100: %{name}-rpmlintrc
|
||||
# PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Allow us to set revision
|
||||
Patch1: set-revision.patch
|
||||
# PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Use correct lib prefix
|
||||
Patch2: clang-cmake-lib.patch
|
||||
# PATCH-FIX-OPENSUSE assume-opensuse.patch idoenmez@suse.de -- Always enable openSUSE/SUSE features
|
||||
Patch3: assume-opensuse.patch
|
||||
# PATCH-FIX-UPSTREAM clang-glibc2.14.patch idoenmez@suse.de -- Support glibc 2.14 headers
|
||||
@ -40,6 +39,8 @@ Patch4: clang-glibc2.14.patch
|
||||
Patch5: clang-disable-ada-extension.patch
|
||||
# PATCH-FIX-UPSTREAM http://llvm.org/viewvc/llvm-project?view=rev&revision=147295
|
||||
Patch6: clang-pr11642.patch
|
||||
# PATCH-FIX-OPENSUSE default-to-i586.patch -- Use i586 as default target for 32bit
|
||||
Patch7: default-to-i586.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
@ -48,7 +49,6 @@ BuildRequires: binutils-devel >= 2.21.90
|
||||
%endif
|
||||
BuildRequires: bison
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: cmake
|
||||
BuildRequires: dejagnu
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: flex
|
||||
@ -112,8 +112,8 @@ This package contains the clang (C language) frontend for LLVM.
|
||||
|
||||
Summary: CLANG frontend for LLVM (devel package)
|
||||
Group: Development/Languages/Other
|
||||
Requires: llvm-devel = %{version}
|
||||
Requires: clang = %{version}
|
||||
Requires: llvm-devel = %{version}
|
||||
%{py_requires}
|
||||
|
||||
%description clang-devel
|
||||
@ -132,13 +132,16 @@ This package contains vim plugins for LLVM like syntax highlighting.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
cd tools/clang
|
||||
%patch4
|
||||
%patch6
|
||||
cd ../..
|
||||
%patch5 -p1
|
||||
%patch7 -p1
|
||||
|
||||
# We hardcode i586
|
||||
rm tools/clang/test/Driver/x86_features.c
|
||||
|
||||
sed -i s,SVN_REVISION,\"%{_revision}\",g tools/clang/lib/Basic/Version.cpp
|
||||
|
||||
@ -150,13 +153,11 @@ TOPLEVEL=$PWD
|
||||
mkdir stage1 stage2 stage3
|
||||
pushd stage1
|
||||
|
||||
# Idiot cmake doesn't let me select my own optimization level here
|
||||
# hence we use configure, this needed to workaround a gcc 4.5 bug
|
||||
../configure \
|
||||
--enable-optimized \
|
||||
--disable-assertions \
|
||||
--with-optimize-option="-O0" \
|
||||
--enable-targets=host
|
||||
--enable-optimized \
|
||||
--disable-assertions \
|
||||
--with-optimize-option="-O0" \
|
||||
--enable-targets=host
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
@ -166,41 +167,42 @@ pushd stage2
|
||||
export CC=$TOPLEVEL/stage1/Release/bin/clang
|
||||
export CXX=$TOPLEVEL/stage1/Release/bin/clang++
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_TARGETS_TO_BUILD=%{_supported_archs} \
|
||||
..
|
||||
../configure \
|
||||
--enable-optimized \
|
||||
--disable-assertions \
|
||||
--enable-targets=host
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
popd
|
||||
pushd stage3
|
||||
# Needed to make clang resource dir working inside build tree
|
||||
ln -s lib lib64
|
||||
|
||||
export CC=$TOPLEVEL/stage2/bin/clang
|
||||
export CXX=$TOPLEVEL/stage2/bin/clang++
|
||||
# autotools ignore --libdir
|
||||
mkdir Release
|
||||
ln -s lib Release/lib64
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_ENABLE_ASSERTIONS=FALSE \
|
||||
-DLLVM_ENABLE_PIC=TRUE \
|
||||
-DLLVM_ENABLE_TIMESTAMPS=FALSE \
|
||||
-DLLVM_TARGETS_TO_BUILD=%{_supported_archs} \
|
||||
-DCLANG_VENDOR="SUSE Linux" \
|
||||
%if "%{_lib}" == "lib64"
|
||||
-DLLVM_LIBDIR_SUFFIX=64 \
|
||||
%endif
|
||||
export CC=$TOPLEVEL/stage2/Release/bin/clang
|
||||
export CXX=$TOPLEVEL/stage2/Release/bin/clang++
|
||||
|
||||
../configure \
|
||||
--prefix=%{_prefix} \
|
||||
--enable-optimized \
|
||||
--disable-assertions \
|
||||
--enable-pic \
|
||||
--disable-timestamps \
|
||||
--enable-targets=%{_supported_archs} \
|
||||
%if 0%{?suse_version} >= 1220
|
||||
-DLLVM_BINUTILS_INCDIR=/usr/include \
|
||||
--with-binutils-include=/usr/include \
|
||||
%endif
|
||||
-DCLANG_RESOURCE_DIR="../%{_lib}/clang/%{_release_version}" \
|
||||
..
|
||||
make %{?_smp_mflags}
|
||||
--with-clang-resource-dir="../%{_lib}/clang/%{_release_version}"
|
||||
|
||||
make %{?_smp_mflags} REQUIRES_RTTI=1
|
||||
|
||||
%check
|
||||
cd stage3
|
||||
make check
|
||||
make clang-test
|
||||
cd tools/clang
|
||||
make test
|
||||
|
||||
%install
|
||||
cd stage3
|
||||
@ -210,13 +212,19 @@ cd ..
|
||||
# Fixup libdir
|
||||
%if "%{_lib}" == "lib64"
|
||||
sed -i s,ABS_RUN_DIR/lib,ABS_RUN_DIR/lib64, %{buildroot}/%{_bindir}/llvm-config
|
||||
mv %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/lib64
|
||||
%endif
|
||||
|
||||
# Docs
|
||||
mkdir -p %{buildroot}/usr/share/doc/packages/llvm-doc/
|
||||
mv %{buildroot}/usr/docs/llvm/html %{buildroot}/usr/share/doc/packages/llvm-doc/
|
||||
rm -rf %{buildroot}/usr/docs/
|
||||
|
||||
# cleanup
|
||||
file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
|
||||
file %{buildroot}/%{_libdir}/%{name}/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
|
||||
|
||||
find %{buildroot}%{_includedir}/clang -name '*.tmp' -exec rm {} +
|
||||
chmod -x %{buildroot}/%{_libdir}/*.a
|
||||
|
||||
for file in `find examples -type f`; do
|
||||
install -d %{buildroot}%{_docdir}/%{name}-doc/`dirname $file`
|
||||
@ -272,15 +280,6 @@ install -m 755 -d %{buildroot}%{_datadir}/vim/site/syntax/
|
||||
install -m 644 utils/vim/*.vim %{buildroot}%{_datadir}/vim/site/syntax/
|
||||
mv utils/vim/README utils/vim/README.vim
|
||||
|
||||
# Create man pages because cmake buildsystem doesn't do for us
|
||||
install -m 755 -d %{buildroot}%{_mandir}/man1
|
||||
# tblgen is not installed anymore.
|
||||
rm docs/CommandGuide/tblgen.pod
|
||||
for i in docs/CommandGuide/*.pod tools/clang/docs/tools/*.pod; do
|
||||
page=`echo $i|awk -F"/" '{print $(NF)}'|sed s,.pod,,` &&
|
||||
pod2man -s1 $i %{buildroot}%{_mandir}/man1/$page.1;
|
||||
done
|
||||
|
||||
# Remove gtest library
|
||||
rm -f %{buildroot}%{_libdir}/*gtest*
|
||||
|
||||
@ -308,7 +307,6 @@ rm -f %{buildroot}%{_libdir}/libEnhancedDisassembly.*
|
||||
%defattr(-,root,root)
|
||||
%doc *.TXT *.txt
|
||||
%{_bindir}/bugpoint
|
||||
%{_bindir}/diagtool
|
||||
%{_bindir}/llc
|
||||
%{_bindir}/lli
|
||||
%{_bindir}/macho-dump
|
||||
@ -317,12 +315,12 @@ rm -f %{buildroot}%{_libdir}/libEnhancedDisassembly.*
|
||||
%{_bindir}/opt
|
||||
%{_mandir}/man1/bugpoint.1%{ext_man}
|
||||
%exclude %{_mandir}/man1/lit.1%{ext_man}
|
||||
%{_mandir}/man1/tblgen.1%{ext_man}
|
||||
%{_mandir}/man1/llc.1%{ext_man}
|
||||
%{_mandir}/man1/lli.1%{ext_man}
|
||||
%exclude %{_mandir}/man1/%{name}-config.1%{ext_man}
|
||||
%{_mandir}/man1/llvm*.1%{ext_man}
|
||||
%{_mandir}/man1/opt.1%{ext_man}
|
||||
%{_mandir}/man1/FileCheck.1%{ext_man}
|
||||
|
||||
%files clang
|
||||
%defattr(-,root,root)
|
||||
@ -340,7 +338,7 @@ rm -f %{buildroot}%{_libdir}/libEnhancedDisassembly.*
|
||||
%{py_sitedir}/Resources
|
||||
%{_datadir}/clang
|
||||
%{_mandir}/man1/clang.1.gz
|
||||
%{_libdir}/libclang.so.*
|
||||
%{_libdir}/libclang.so
|
||||
%{_libdir}/libLTO.so
|
||||
%{_libdir}/*profile*.a
|
||||
%if 0%{?suse_version} >= 1220
|
||||
@ -380,15 +378,12 @@ rm -f %{buildroot}%{_libdir}/libEnhancedDisassembly.*
|
||||
%{_includedir}/clang
|
||||
%{_includedir}/clang-c
|
||||
%{_libdir}/libLTO.a
|
||||
%{_libdir}/libclang.so
|
||||
%{_libdir}/libclang*.a
|
||||
%{_libdir}/*profile*.so
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/%{name}-config
|
||||
%dir %{_datadir}/llvm/
|
||||
%{_datadir}/llvm/*
|
||||
%doc %{_mandir}/man1/%{name}-config.1%{ext_man}
|
||||
%{_includedir}/%{name}/
|
||||
%{_includedir}/%{name}-c/
|
||||
|
Loading…
x
Reference in New Issue
Block a user