Accepting request 144074 from devel:tools:compiler

Fix ARM build (forwarded request 144061 from Guillaume_G)

OBS-URL: https://build.opensuse.org/request/show/144074
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/llvm?expand=0&rev=36
This commit is contained in:
Ismail Dönmez 2012-12-05 12:59:15 +00:00 committed by Git OBS Bridge
commit 6d3d919d1f
7 changed files with 142 additions and 14 deletions

15
arm_suse_support.diff Normal file
View File

@ -0,0 +1,15 @@
--- llvm/tools/clang/lib/Driver/ToolChains.cpp.orig 2012-11-22 10:26:49.202107824 +0100
+++ llvm/tools/clang/lib/Driver/ToolChains.cpp 2012-11-22 12:20:33.662825882 +0100
@@ -1056,10 +1056,12 @@ Generic_GCC::GCCInstallationDetector::GC
static const char *const ARMLibDirs[] = { "/lib" };
static const char *const ARMTriples[] = {
"arm-linux-gnueabi",
+ "armv5tel-suse-linux-gnueabi",
"arm-linux-androideabi"
};
static const char *const ARMHFTriples[] = {
"arm-linux-gnueabihf",
+ "armv7hl-suse-linux-gnueabi"
};
static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };

View File

@ -0,0 +1,14 @@
--- ./tools/clang/lib/Driver/Tools.cpp.orig 2012-11-22 10:37:49.686675877 +0100
+++ ./tools/clang/lib/Driver/Tools.cpp 2012-11-27 10:55:58.984167280 +0100
@@ -5763,8 +5763,9 @@ void linuxtools::Assemble::ConstructJob(
CmdArgs.push_back("-many");
} else if (getToolChain().getArch() == llvm::Triple::arm) {
StringRef MArch = getToolChain().getArchName();
- if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a")
- CmdArgs.push_back("-mfpu=neon");
+ // Do not use neon in openSUSE
+// if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a")
+// CmdArgs.push_back("-mfpu=neon");
StringRef ARMFloatABI = getARMFloatABI(getToolChain().getDriver(), Args,
getToolChain().getTriple());

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:434e1ec81ec76c1ad916f21ca5722207fb9a688cf0375fdbc324e6ce863f9d69
size 17650563

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0a507e04223bd59729776b4a09814f39131a2fb548d75d6af53aeeaa31dfc94
size 17660268

31
llvm-config-lib64.patch Normal file
View File

@ -0,0 +1,31 @@
diff -ur llvm.orig/tools/llvm-config/llvm-config.cpp llvm/tools/llvm-config/llvm-config.cpp
--- llvm.orig/tools/llvm-config/llvm-config.cpp 2012-11-12 11:25:40.547628293 +0100
+++ llvm/tools/llvm-config/llvm-config.cpp 2012-12-02 15:09:31.981279773 +0100
@@ -231,15 +231,15 @@
switch (DevelopmentTreeLayout) {
case MakefileStyle:
ActiveBinDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/bin";
- ActiveLibDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/lib";
+ ActiveLibDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/lib64";
break;
case CMakeStyle:
ActiveBinDir = ActiveObjRoot + "/bin";
- ActiveLibDir = ActiveObjRoot + "/lib";
+ ActiveLibDir = ActiveObjRoot + "/lib64";
break;
case CMakeBuildModeStyle:
ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE;
- ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE;
+ ActiveLibDir = ActiveObjRoot + "/lib64/" + LLVM_BUILDMODE;
break;
}
@@ -250,7 +250,7 @@
ActivePrefix = CurrentExecPrefix;
ActiveIncludeDir = ActivePrefix + "/include";
ActiveBinDir = ActivePrefix + "/bin";
- ActiveLibDir = ActivePrefix + "/lib";
+ ActiveLibDir = ActivePrefix + "/lib64";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Tue Dec 4 13:15:12 UTC 2012 - guillaume@opensuse.org
- Fix ARM build
-------------------------------------------------------------------
Mon Dec 3 13:32:14 UTC 2012 - schuetzm@gmx.net
- Fix llvm-config --libdir to return /usr/lib64 where appropriate.
The old method of using sed on the executable does no longer
work, because llvm-config is now a binary.
-------------------------------------------------------------------
Fri Nov 30 07:27:46 UTC 2012 - idonmez@suse.com
- Update to r168987 from release_32 branch
* Crash fixes
* Miscompilation fixes
-------------------------------------------------------------------
Tue Nov 20 08:59:09 UTC 2012 - idonmez@suse.com

View File

@ -16,12 +16,12 @@
#
%define _revision 168357
%define _revision 168987
%define _release_version 3.2
%define _supported_archs "arm,x86"
Name: llvm
Version: 3.1.99.r168357
Version: 3.1.99.r%{_revision}
Release: 0
Summary: Low Level Virtual Machine
License: NCSA
@ -37,6 +37,11 @@ Patch2: assume-opensuse.patch
Patch3: clang-disable-ada-extension.patch
# PATCH-FIX-OPENSUSE default-to-i586.patch -- Use i586 as default target for 32bit
Patch4: default-to-i586.patch
Patch5: llvm-config-lib64.patch
# PATCH-FIX-OPENSUSE arm_suse_support.diff --Enable ARM suse toolchain support
Patch6: arm_suse_support.diff
# PATCH-FIX-OPENSUSE disable_neon_in_armv7.diff -- Disable use of neon in armv7 openSUSE
Patch7: disable_neon_in_armv7.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
@ -125,6 +130,15 @@ This package contains vim plugins for LLVM like syntax highlighting.
%endif
%patch3 -p1
%patch4 -p1
%if "%{_lib}" == "lib64"
%patch5 -p1
%endif
%ifarch %arm
%patch6 -p1
%endif
%ifarch armv7l armv7hl
%patch7 -p0
%endif
# We hardcode i586
rm tools/clang/test/Driver/x86_features.c
@ -151,16 +165,38 @@ TOPLEVEL=$PWD
export SUSE_ASNEEDED=0
mkdir stage1 stage2
pushd stage1
mkdir Release
%if "%{_lib}" == "lib64"
ln -s lib Release/lib64
%endif
%ifarch armv7l armv7hl
# This fixes the armv7 build. (Allow to run stage2 without problem)
export CFLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16"
export CXXFLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16"
%endif
../configure \
--enable-optimized \
--disable-assertions \
--with-optimize-option="-O0" \
%ifarch %arm
%ifarch armv5el armv5tel
--disable-sjlj-exceptions \
--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb \
--with-arch=armv5te --with-float=soft --with-mode=arm \
--disable-werror --enable-checking=release \
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf \
--build=armv5tel-suse-linux-gnueabi --host=armv5tel-suse-linux-gnueabi --target=armv5tel-suse-linux-gnueabi \
%endif
%ifarch armv7l armv7hl
--disable-sjlj-exceptions \
--with-arch=armv7-a --with-tune=cortex-a9 --with-float=hard --with-fpu=vfpv3-d16 --with-fpmath=vfp3 \
--disable-werror --enable-checking=release \
--build=armv7hl-suse-linux-gnueabi --host=armv7hl-suse-linux-gnueabi --target=armv7hl-suse-linux-gnueabi \
%if 0%{?suse_version} >= 1220
--with-mode=thumb \
%else
--with-mode=arm \
%endif
%endif
--enable-targets=host
@ -169,9 +205,11 @@ make %{?_smp_mflags} clang-only
popd
pushd stage2
# autotools ignore --libdir
mkdir Release+Debug
# autotools ignore --libdir
%if "%{_lib}" == "lib64"
ln -s lib Release+Debug/lib64
%endif
export CC=$TOPLEVEL/stage1/Release/bin/clang
export CXX=$TOPLEVEL/stage1/Release/bin/clang++
@ -186,12 +224,24 @@ export CXX=$TOPLEVEL/stage1/Release/bin/clang++
%if 0%{?suse_version} >= 1220
--with-binutils-include=/usr/include \
%endif
%ifarch %arm
--with-optimize-option="-U_GLIBCXX_ATOMIC_BUILTINS" \
%ifarch armv5el armv5tel
--with-optimize-option="-U_GLIBCXX_ATOMIC_BUILTINS" \
--disable-sjlj-exceptions \
--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb \
--with-arch=armv5te --with-float=soft --with-mode=arm \
--disable-werror --enable-checking=release \
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf \
--build=armv5tel-suse-linux-gnueabi --host=armv5tel-suse-linux-gnueabi --target=armv5tel-suse-linux-gnueabi \
%endif
%ifarch armv7l armv7hl
--with-optimize-option="-U_GLIBCXX_ATOMIC_BUILTINS" \
--disable-sjlj-exceptions \
--with-arch=armv7-a --with-tune=cortex-a9 --with-float=hard --with-fpu=vfpv3-d16 --with-fpmath=vfp3 \
%if 0%{?suse_version} >= 1220
--with-mode=thumb \
%else
--with-mode=arm \
%endif
--disable-werror --enable-checking=release \
--build=armv7hl-suse-linux-gnueabi --host=armv7hl-suse-linux-gnueabi --target=armv7hl-suse-linux-gnueabi \
%endif
--with-clang-resource-dir="../%{_lib}/clang/%{_release_version}" \
--enable-debug-symbols \
@ -215,7 +265,6 @@ 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