diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-05-02 03:46:18 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-05-02 03:47:55 +0200 |
commit | e58ccc5cd9f7e48394b17b829278846162cbaa3a (patch) | |
tree | 76cc98bde2715722e87d7c353bfbc6a1925509ba /testing | |
parent | d4c1b9ad854296a4cf75ef68fbe7f8be0916a024 (diff) | |
download | aports-e58ccc5cd9f7e48394b17b829278846162cbaa3a.tar.bz2 aports-e58ccc5cd9f7e48394b17b829278846162cbaa3a.tar.xz |
testing/ponyc: enable for aarch64 and armhf
I've tested it on Scaleway's armv7 machine. I currently don't have
access to any aarch64 machine, but it should work too.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/ponyc/APKBUILD | 12 | ||||
-rw-r--r-- | testing/ponyc/disable-avx512f-for-x86-only.patch | 122 | ||||
-rw-r--r-- | testing/ponyc/makefile-remove-march-mtune.patch | 2 |
3 files changed, 131 insertions, 5 deletions
diff --git a/testing/ponyc/APKBUILD b/testing/ponyc/APKBUILD index 5c0722060c..701274e301 100644 --- a/testing/ponyc/APKBUILD +++ b/testing/ponyc/APKBUILD @@ -5,7 +5,7 @@ pkgver=0.21.3 pkgrel=1 pkgdesc="An open-source, actor-model, capabilities-secure, high performance programming language" url="https://www.ponylang.org" -arch="x86_64" # TODO: enable aarch64, armhf +arch="x86_64 aarch64 armhf" license="BSD-2-Clause" _llvmver=3.9 depends="binutils-gold gcc" @@ -13,14 +13,17 @@ checkdepends="libressl-dev pcre2-dev" makedepends="libexecinfo-dev llvm$_llvmver-dev ncurses-dev paxmark zlib-dev" subpackages="$pkgname-dev $pkgname-doc" source="$pkgname-$pkgver.tar.gz::https://github.com/ponylang/$pkgname/archive/$pkgver.tar.gz + disable-avx512f-for-x86-only.patch makefile-remove-march-mtune.patch fix-tests.patch" builddir="$srcdir/$pkgname-$pkgver" +# arch per gcc, used only to define PONY_ARCH. _arch="$CARCH" case "$CARCH" in x86_64) _arch=x86-64;; - arm*) _arch=armv7;; + armhf) _arch=armv6zk;; + aarch64) _arch=armv8-a;; esac _make_opts="arch=$_arch @@ -34,7 +37,7 @@ _make_opts="arch=$_arch build() { cd "$builddir" - make $_make_opts + make $_make_opts CFLAGS="-Wno-error" paxmark m build/release/ponyc \ build/release/libponyc.tests @@ -79,5 +82,6 @@ dev() { } sha512sums="f89389142d77e93038c77d3fbe9e64c13ce76b9737430969fcdf2916023d0b7195f4d551895eab999798594352b40848be8dcc63af6927e8cc62b7c7000be65d ponyc-0.21.3.tar.gz -2e54e98250d16700c833f746afb63fee49349b9245bec22e33e4ad3c81a94063c80e3bf6ce16bd3c97299a36d0f48236d9afd65767eff10825f46acd6b8f224a makefile-remove-march-mtune.patch +0f1d7e45639db17343db675a740922b2c1ef1317fd1a7678a0d30040407c91c930b7439dc12282541384336da1af5f0bc143ea0f5725eb8aa2ab3646b1cf00f7 disable-avx512f-for-x86-only.patch +0dac51826c0fcd47e6d4e7fe9928a5221c66da2f24d7931d7c53e591d325375b88e98cc0b3b6d538f9ec9bcbba906de7c00fff5434e427c94cea4bd2fb0477f6 makefile-remove-march-mtune.patch 46c0125b60cd1db89d7ae958602b087acb2ae1fd8298cd9141828999693a9e39b60d2dac338853406081fc1c138e506243357618197ffd118fe4ac9737bd1565 fix-tests.patch" diff --git a/testing/ponyc/disable-avx512f-for-x86-only.patch b/testing/ponyc/disable-avx512f-for-x86-only.patch new file mode 100644 index 0000000000..e14ff87478 --- /dev/null +++ b/testing/ponyc/disable-avx512f-for-x86-only.patch @@ -0,0 +1,122 @@ +Patch-Source: https://github.com/ponylang/ponyc/pull/2665 + +--- a/Makefile ++++ b/Makefile +@@ -41,6 +41,7 @@ + config ?= release + arch ?= native + tune ?= generic ++cpu ?= $(arch) + bits ?= $(shell getconf LONG_BIT) + + ifndef verbose +@@ -102,7 +103,7 @@ + -DPONY_VERSION_STR=\"$(version_str)\" \ + -D_FILE_OFFSET_BITS=64 + ALL_CXXFLAGS = -std=gnu++11 -fno-rtti +-LL_FLAGS = -mcpu=$(arch) ++LL_FLAGS = -mcpu=$(cpu) + + # Determine pointer size in bits. + BITS := $(bits) +--- a/src/libponyc/codegen/codegen.c ++++ b/src/libponyc/codegen/codegen.c +@@ -976,48 +976,53 @@ + + bool codegen_pass_init(pass_opt_t* opt) + { ++ char *triple; ++ ++ // Default triple, cpu and features. ++ if(opt->triple != NULL) ++ { ++ triple = LLVMCreateMessage(opt->triple); ++ } else { ++#ifdef PLATFORM_IS_MACOSX ++ // This is to prevent XCode 7+ from claiming OSX 14.5 is required. ++ triple = LLVMCreateMessage("x86_64-apple-macosx"); ++#else ++ triple = LLVMGetDefaultTargetTriple(); ++#endif ++ } ++ + if(opt->features != NULL) + { + #if PONY_LLVM < 500 +- // Disable -avx512f on LLVM < 5.0.0 to avoid bug https://bugs.llvm.org/show_bug.cgi?id=30542 +- size_t temp_len = strlen(opt->features) + 9; +- char* temp_str = (char*)ponyint_pool_alloc_size(temp_len); +- snprintf(temp_str, temp_len, "%s,-avx512f", opt->features); ++ if(target_is_x86(triple)) ++ { ++ // Disable -avx512f on LLVM < 5.0.0 to avoid bug https://bugs.llvm.org/show_bug.cgi?id=30542 ++ size_t temp_len = strlen(opt->features) + 10; ++ char* temp_str = (char*)ponyint_pool_alloc_size(temp_len); ++ snprintf(temp_str, temp_len, "%s,-avx512f", opt->features); + +- opt->features = temp_str; +-#endif ++ opt->features = LLVMCreateMessage(temp_str); + ++ ponyint_pool_free_size(temp_len, temp_str); ++ } else { ++ opt->features = LLVMCreateMessage(opt->features); ++ } ++#else + opt->features = LLVMCreateMessage(opt->features); +- +- +-#if PONY_LLVM < 500 +- // free memory for temp_str +- ponyint_pool_free_size(temp_len, temp_str); + #endif + } else { + if((opt->cpu == NULL) && (opt->triple == NULL)) + opt->features = LLVMGetHostCPUFeatures(); + else + #if PONY_LLVM < 500 +- opt->features = LLVMCreateMessage("-avx512f"); ++ opt->features = LLVMCreateMessage(target_is_x86(triple) ? "-avx512f" : ""); + #else + opt->features = LLVMCreateMessage(""); + #endif + } + +- // Default triple, cpu and features. +- if(opt->triple != NULL) +- { +- opt->triple = LLVMCreateMessage(opt->triple); +- } else { +-#ifdef PLATFORM_IS_MACOSX +- // This is to prevent XCode 7+ from claiming OSX 14.5 is required. +- opt->triple = LLVMCreateMessage("x86_64-apple-macosx"); +-#else +- opt->triple = LLVMGetDefaultTargetTriple(); +-#endif +- } +- ++ opt->triple = triple; ++ + if(opt->cpu != NULL) + opt->cpu = LLVMCreateMessage(opt->cpu); + else +--- a/src/libponyc/codegen/host.cc ++++ b/src/libponyc/codegen/host.cc +@@ -46,7 +46,7 @@ + for(auto it = features.begin(); it != features.end(); it++) + buf_size += (*it).getKey().str().length() + 2; // plus +/- char and ,/null + +-#if PONY_LLVM < 500 ++#if PONY_LLVM < 500 and defined(PLATFORM_IS_X86) + // Add extra buffer space for llvm bug workaround + buf_size += 9; + #endif +@@ -69,7 +69,7 @@ + strcat(buf, ","); + } + +-#if PONY_LLVM < 500 ++#if PONY_LLVM < 500 and defined(PLATFORM_IS_X86) + // Disable -avx512f on LLVM < 5.0.0 to avoid bug https://bugs.llvm.org/show_bug.cgi?id=30542 + strcat(buf, ",-avx512f"); + #endif diff --git a/testing/ponyc/makefile-remove-march-mtune.patch b/testing/ponyc/makefile-remove-march-mtune.patch index dfdbfa2959..b8b45eb385 100644 --- a/testing/ponyc/makefile-remove-march-mtune.patch +++ b/testing/ponyc/makefile-remove-march-mtune.patch @@ -18,7 +18,7 @@ Don't hassle with -march and -mtune, use gcc defaults. -DPONY_VERSION_STR=\"$(version_str)\" \ -D_FILE_OFFSET_BITS=64 ALL_CXXFLAGS = -std=gnu++11 -fno-rtti --LL_FLAGS = -mcpu=$(arch) +-LL_FLAGS = -mcpu=$(cpu) +LL_FLAGS = # Determine pointer size in bits. |