SHA256
1
0
forked from pool/llvm

Accepting request 144061 from home:Guillaume_G:branches:openSUSE:Factory:ARM

Fix ARM build

OBS-URL: https://build.opensuse.org/request/show/144061
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=187
This commit is contained in:
Ismail Dönmez 2012-12-04 14:41:04 +00:00 committed by Git OBS Bridge
parent 5599a1d629
commit cfb7a00363
4 changed files with 80 additions and 7 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 +1,8 @@
-------------------------------------------------------------------
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

View File

@ -38,6 +38,10 @@ 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
@ -129,6 +133,12 @@ This package contains vim plugins for LLVM like syntax highlighting.
%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
@ -161,15 +171,32 @@ mkdir Release
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
@ -197,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 \