From 0e655ee86971f9c31317ec8805ba2213993d505e Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Tue, 21 Mar 2017 13:35:49 +0900 Subject: [PATCH] Enable x86 build by using -64bit dependencies Change-Id: If74f0db1f09e20694dcd066bed5c7d04b5cb118b Signed-off-by: Jiyoung Yun --- packaging/Add-Tizen-RuntimeID-case.patch | 24 ++++++++++++++----- packaging/coreclr.spec | 41 ++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/packaging/Add-Tizen-RuntimeID-case.patch b/packaging/Add-Tizen-RuntimeID-case.patch index ea8c2f5..852adb4 100644 --- a/packaging/Add-Tizen-RuntimeID-case.patch +++ b/packaging/Add-Tizen-RuntimeID-case.patch @@ -1,4 +1,4 @@ -From 318f341edd8d38ef7fef453a8724367bfb3debb6 Mon Sep 17 00:00:00 2001 +From 59b6394308dd795db0409d0aecc6790f0bee4103 Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Tue, 14 Feb 2017 17:57:48 +0900 Subject: [PATCH] Add Tizen RuntimeID case @@ -6,14 +6,14 @@ Subject: [PATCH] Add Tizen RuntimeID case Change-Id: I4d689e31f64143c3d0e2dac74b09aefc9d40de60 Signed-off-by: Jiyoung Yun --- - build.sh | 7 +++++++ - 1 file changed, 7 insertions(+) + build.sh | 13 +++++++++++++ + 1 file changed, 13 insertions(+) diff --git a/build.sh b/build.sh -index 8d03121..94d943e 100755 +index 8d03121..f18a1e8 100755 --- a/build.sh +++ b/build.sh -@@ -338,11 +338,16 @@ isMSBuildOnNETCoreSupported() +@@ -338,11 +338,18 @@ isMSBuildOnNETCoreSupported() "alpine.3.4.3-x64") __isMSBuildOnNETCoreSupported=1 ;; @@ -27,10 +27,22 @@ index 8d03121..94d943e 100755 fi + elif [ "$__HostArch" == "arm" ]; then + __isMSBuildOnNETCoreSupported=1 ++ elif [ "$__HostArch" == "x86" ]; then ++ __isMSBuildOnNETCoreSupported=1 fi } -@@ -406,6 +411,8 @@ build_CoreLib() +@@ -400,12 +407,18 @@ build_CoreLib() + # The cross build generates a crossgen with the target architecture. + if [ $__CrossBuild != 1 ]; then + # The architecture of host pc must be same architecture with target. ++ if [[ ( "$__HostArch" == "x86") ]]; then ++ exit 0 ++ fi ++ + if [[ ( "$__HostArch" == "$__BuildArch" ) ]]; then + build_CoreLib_ni + elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "x86" ) ]]; then build_CoreLib_ni elif [[ ( "$__HostArch" == "arm64" ) && ( "$__BuildArch" == "arm" ) ]]; then build_CoreLib_ni diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec index e4bf347..ae7b038 100644 --- a/packaging/coreclr.spec +++ b/packaging/coreclr.spec @@ -1,15 +1,10 @@ %{!?dotnet_buildtype: %define dotnet_buildtype Release} -%ifarch x86_64 -%define support_test 1 -%define skipnative 0 -%define skipmscorlib 0 -%endif - -%ifarch %{arm} %define support_test 1 %define skipnative 0 %define skipmscorlib 0 +%ifarch %{ix86} +%define dotnet_buildtype Debug %endif %define dotnet_version 1.0.0 @@ -32,7 +27,7 @@ Source1003: dep_libs.tar.gz Patch0: Add-Tizen-RuntimeID-case.patch Patch1: Add-project.lock.json-files.patch -ExclusiveArch: %{arm} x86_64 +ExcludeArch: aarch64 BuildRequires: python BuildRequires: python-xml @@ -55,7 +50,6 @@ Requires: libuuid BuildRequires: cmake BuildRequires: llvm >= 3.8 BuildRequires: llvm-devel >= 3.8 -#BuildRequires: libllvm >= 3.8 BuildRequires: clang >= 3.8 BuildRequires: clang-devel >= 3.8 BuildRequires: lldb >= 3.8 @@ -74,6 +68,16 @@ BuildRequires: pkgconfig(lttng-ust) %ifarch %{arm} BuildRequires: patchelf %endif +%ifarch %{ix86} +BuildRequires: patchelf +BuildRequires: glibc-64bit +BuildRequires: libgcc-64bit +BuildRequires: libstdc++-64bit +BuildRequires: libunwind-64bit +BuildRequires: libuuid-64bit +BuildRequires: zlib-64bit +BuildRequires: libopenssl-64bit +%endif %endif %description @@ -110,13 +114,13 @@ cp %{SOURCE1001} . %patch1 -p1 cp %{SOURCE1000} ./ tar xf %{SOURCE1000} -%ifarch %{arm} +%ifarch %{arm} %{ix86} %setup -T -D -a 1002 %setup -T -D -a 1003 +%ifarch %{arm} # Detect interpreter name from cross-gcc LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc) LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc) - for file in $( find ./Tools -name "dotnet" ) do patchelf --set-interpreter ${LD_INTERPRETER} ${file} @@ -127,6 +131,13 @@ do patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu/ ${file} done %endif +%ifarch %{ix86} +for file in $( find ./Tools ./libicu -iname "*.so" -or -iname "*.so.*" ) +do + patchelf --set-rpath %{_builddir}/%{name}-%{version}/libicu/ ${file} +done +%endif +%endif %endif %build @@ -148,9 +159,9 @@ export CLANG_HEADERS=$(clang++ -print-search-dirs 2>&1 | sed -ne '/libraries: /s %else export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LLVM_LIBDIR}:${GCC_INSTALL_DIR} export LIBRARY_PATH=$LIBRARY_PATH:${LLVM_LIBDIR}:${GCC_INSTALL_DIR} -export CFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations " -export CPPFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations " -export CXXFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations " +export CFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations -D__extern_always_inline=inline" +export CPPFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations -D__extern_always_inline=inline" +export CXXFLAGS=" -B${LLVM_LIBDIR} -B${GCC_INSTALL_DIR} -Wno-deprecated-declarations -D__extern_always_inline=inline" export CPLUS_INCLUDE_PATH="${LLVM_INCLUDEDIR}/llvm/:${LLVM_INCLUDEDIR}/llvm-c/:${CLANG_HEADERS}:${GPP_INCLUDE_PATHS}:${CLANG_INCLUDE_PATHS}" export C_INCLUDE_PATH="${LLVM_INCLUDEDIR}/llvm-c/:%{_includedir}" %endif @@ -165,7 +176,7 @@ export C_INCLUDE_PATH="${LLVM_INCLUDEDIR}/llvm-c/:%{_includedir}" %define _barch arm64 %else -%ifarch i586 +%ifarch %{ix86} %define _barch x86 %else -- 2.7.4