diff --git a/cmake-host-triple.patch b/cmake-host-triple.patch new file mode 100644 index 0000000..85ed998 --- /dev/null +++ b/cmake-host-triple.patch @@ -0,0 +1,33 @@ +Index: llvm-3.3/cmake/modules/GetHostTriple.cmake +=================================================================== +--- llvm-3.3.orig/cmake/modules/GetHostTriple.cmake ++++ llvm-3.3/cmake/modules/GetHostTriple.cmake +@@ -15,15 +15,19 @@ function( get_host_triple var ) + set( value "i686-pc-mingw32" ) + endif() + else( MSVC ) +- set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess) +- execute_process(COMMAND sh ${config_guess} +- RESULT_VARIABLE TT_RV +- OUTPUT_VARIABLE TT_OUT +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- if( NOT TT_RV EQUAL 0 ) +- message(FATAL_ERROR "Failed to execute ${config_guess}") +- endif( NOT TT_RV EQUAL 0 ) +- set( value ${TT_OUT} ) ++ if( NOT LLVM_HOST_TRIPLE ) ++ set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess) ++ execute_process(COMMAND sh ${config_guess} ++ RESULT_VARIABLE TT_RV ++ OUTPUT_VARIABLE TT_OUT ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ if( NOT TT_RV EQUAL 0 ) ++ message(FATAL_ERROR "Failed to execute ${config_guess}") ++ endif( NOT TT_RV EQUAL 0 ) ++ set( value ${TT_OUT} ) ++ else( LLVM_HOST_TRIPLE ) ++ set( value ${LLVM_HOST_TRIPLE} ) ++ endif( NOT LLVM_HOST_TRIPLE ) + endif( MSVC ) + set( ${var} ${value} PARENT_SCOPE ) + message(STATUS "Target triple: ${value}") diff --git a/disable_neon_in_armv7.diff b/disable_neon_in_armv7.diff deleted file mode 100644 index a58bcc0..0000000 --- a/disable_neon_in_armv7.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- ./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()); diff --git a/llvm.changes b/llvm.changes index 35eb83f..8bd89d0 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 4 11:55:43 UTC 2013 - idonmez@suse.com + +- Drop disable_neon_in_armv7.diff, neon seems to be working fine +- Add cmake-host-triple.patch to pass a host triple argument + ------------------------------------------------------------------- Wed Jul 3 13:13:25 UTC 2013 - idonmez@suse.com diff --git a/llvm.spec b/llvm.spec index c9fa125..fb64a1a 100644 --- a/llvm.spec +++ b/llvm.spec @@ -41,11 +41,9 @@ 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 # PATCH-FIX-OPENSUSE unreachable-code.patch -- Unreachable code warning triggered on SLE -Patch8: unreachable-code.patch -Patch9: arm-config.guess.patch +Patch7: unreachable-code.patch +Patch8: cmake-host-triple.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -151,13 +149,8 @@ This package contains vim plugins for LLVM like syntax highlighting. %if "%{_lib}" == "lib64" %patch5 -p1 %endif -%ifarch %arm %patch6 -p1 -%patch9 -p1 -%endif -%ifarch armv7l armv7hl -%patch7 -p0 -%endif +%patch7 -p1 %patch8 -p1 # We hardcode i586 @@ -188,6 +181,20 @@ TOPLEVEL=$PWD mkdir stage1 stage2 pushd stage1 +# Define host-triple +%ifarch %{ix86} +%define host_triple i586-suse-linux +%endif +%ifarch x86_64 +%define host_triple x86_64-suse-linux +%endif +%ifarch armv6hl +%define host_triple armv6hl-suse-linux-gnueabi +%endif +%ifarch armv7hl +%define host_triple armv7hl-suse-linux-gnueabi +%endif + cmake -G "Unix Makefiles" \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_BUILD_TYPE=Release \ @@ -200,6 +207,7 @@ cmake -G "Unix Makefiles" \ -DCMAKE_C_FLAGS="-O0" \ -DCMAKE_CXX_FLAGS="-O0" \ -DLLVM_TARGET_ARCH=host \ + -DLLVM_HOST_TRIPLE=%{host_triple} \ .. make %{?_smp_mflags} clang @@ -216,9 +224,10 @@ cmake -G "Unix Makefiles" \ -DCMAKE_BUILD_TYPE=Release \ %else -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_HOST_TRIPLE=%{host_triple} \ %endif -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -%ifarch armv7l armv7hl +%ifarch armv7hl -DCMAKE_C_FLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" \ -DCMAKE_CXX_FLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" \ %endif