From: joakim-noah Date: Tue, 11 Jul 2017 09:49:12 +0000 (+0530) Subject: ldc: update to final 1.3.0 release (#1123) X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/commitdiff_plain/221ac3bb2fb1071a4bff38723b96e64e6874705f ldc: update to final 1.3.0 release (#1123) --- diff --git a/disabled-packages/ldc/build.sh b/disabled-packages/ldc/build.sh index 329529fd..fe419f71 100644 --- a/disabled-packages/ldc/build.sh +++ b/disabled-packages/ldc/build.sh @@ -1,9 +1,9 @@ TERMUX_PKG_HOMEPAGE=https://github.com/ldc-developers/ldc TERMUX_PKG_DESCRIPTION="D programming language compiler, built with LLVM" _PKG_MAJOR_VERSION=1.3 -TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.0-beta2 +TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.0 TERMUX_PKG_SRCURL=https://github.com/ldc-developers/ldc/releases/download/v${TERMUX_PKG_VERSION}/ldc-${TERMUX_PKG_VERSION}-src.tar.gz -TERMUX_PKG_SHA256=a6a13f356192d40649af7290820cf85127369f40d554c2fdd853dc098dce885f +TERMUX_PKG_SHA256=efe31a639bcb44e1f5b752da21713376d9410a01279fecc8aab8572065a3050b TERMUX_PKG_DEPENDS="clang" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_BLACKLISTED_ARCHES="aarch64,i686,x86_64" @@ -13,7 +13,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DLLVM_ENABLE_PIC=ON -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_UTILS=OFF --DPYTHON_EXECUTABLE=`which python` -DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen" TERMUX_PKG_KEEP_STATIC_LIBRARIES=true TERMUX_PKG_NO_DEVELSPLIT=yes diff --git a/disabled-packages/ldc/ldc-druntime.patch.beforehostbuild b/disabled-packages/ldc/ldc-druntime.patch.beforehostbuild deleted file mode 100644 index cc1d2b37..00000000 --- a/disabled-packages/ldc/ldc-druntime.patch.beforehostbuild +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/src/core/memory.d b/src/core/memory.d -index 0a427055..28408cb7 100644 ---- a/src/core/memory.d -+++ b/runtime/druntime/src/core/memory.d -@@ -38,7 +38,7 @@ - * - * Notes_to_implementors: - * $(UL -- * $(LI On POSIX systems, the signals SIGUSR1 and SIGUSR2 are reserved -+ * $(LI On POSIX systems, the signals `SIGRTMIN` and `SIGRTMIN + 1` are reserved - * by this module for use in the garbage collector implementation. - * Typically, they will be used to stop and resume other threads - * when performing a collection, but an implementation may choose -diff --git a/src/core/thread.d b/src/core/thread.d -index 64e6dc18..2c08e6db 100644 ---- a/src/core/thread.d -+++ b/runtime/druntime/src/core/thread.d -@@ -1922,7 +1922,7 @@ version( CoreDdoc ) - { - /** - * Instruct the thread module, when initialized, to use a different set of -- * signals besides SIGUSR1 and SIGUSR2 for suspension and resumption of threads. -+ * signals besides `SIGRTMIN` and `SIGRTMIN + 1` for suspension and resumption of threads. - * This function should be called at most once, prior to thread_init(). - * This function is Posix-only. - */ -@@ -1980,12 +1980,13 @@ extern (C) void thread_init() - { - if( suspendSignalNumber == 0 ) - { -- suspendSignalNumber = SIGUSR1; -+ suspendSignalNumber = SIGRTMIN; - } - - if( resumeSignalNumber == 0 ) - { -- resumeSignalNumber = SIGUSR2; -+ resumeSignalNumber = SIGRTMIN + 1; -+ assert(resumeSignalNumber <= SIGRTMAX); - } - - int status; -@@ -3975,6 +3976,10 @@ version( LDC ) - version( X86 ) version = CheckFiberMigration; - version( X86_64 ) version = CheckFiberMigration; - } -+ version( Android ) -+ { -+ version( ARM ) version = CheckFiberMigration; -+ } - } - - // Fiber support for SjLj style exceptions -diff --git a/src/rt/sections_android.d b/src/rt/sections_android.d -index 60ca9a9a..a662887d 100644 ---- a/src/rt/sections_android.d -+++ b/runtime/druntime/src/rt/sections_android.d -@@ -62,12 +62,9 @@ private: - void initSections() - { - pthread_key_create(&_tlsKey, null); -+ _sections.moduleGroup = ModuleGroup(getModuleInfos()); - -- auto mbeg = cast(immutable ModuleInfo**)&__start_minfo; -- auto mend = cast(immutable ModuleInfo**)&__stop_minfo; -- _sections.moduleGroup = ModuleGroup(mbeg[0 .. mend - mbeg]); -- -- auto pbeg = cast(void*)&_tls_end; -+ auto pbeg = cast(void*)&_tlsend; - auto pend = cast(void*)&__bss_end__; - _sections._gcRanges[0] = pbeg[0 .. pend - pbeg]; - } -@@ -167,6 +164,38 @@ ref void[] getTLSBlockAlloc() - - __gshared SectionGroup _sections; - -+// This linked list is created by a compiler generated function inserted -+// into the .ctor list by the compiler. -+struct ModuleReference -+{ -+ ModuleReference* next; -+ ModuleInfo* mod; -+} -+ -+extern (C) __gshared immutable(ModuleReference*) _Dmodule_ref; // start of linked list -+ -+immutable(ModuleInfo*)[] getModuleInfos() -+out (result) -+{ -+ foreach(m; result) -+ assert(m !is null); -+} -+body -+{ -+ size_t len; -+ immutable(ModuleReference)* mr; -+ -+ for (mr = _Dmodule_ref; mr; mr = mr.next) -+ len++; -+ auto result = (cast(immutable(ModuleInfo)**).malloc(len * size_t.sizeof))[0 .. len]; -+ len = 0; -+ for (mr = _Dmodule_ref; mr; mr = mr.next) -+ { result[len] = mr.mod; -+ len++; -+ } -+ return cast(immutable)result; -+} -+ - extern(C) - { - /* Symbols created by the compiler/linker and inserted into the -@@ -174,10 +203,8 @@ extern(C) - */ - extern __gshared - { -- void* __start_deh; -- void* __stop_deh; -- void* __start_minfo; -- void* __stop_minfo; -+ void* _deh_beg; -+ void* _deh_end; - - size_t __bss_end__; - diff --git a/disabled-packages/ldc/ldc-phobos.patch.beforehostbuild b/disabled-packages/ldc/ldc-phobos.patch.beforehostbuild index d1e5c067..5e55bd8e 100644 --- a/disabled-packages/ldc/ldc-phobos.patch.beforehostbuild +++ b/disabled-packages/ldc/ldc-phobos.patch.beforehostbuild @@ -1,29 +1,3 @@ -diff --git a/std/file.d b/std/file.d -index 709461bf..4eadf0c7 100644 ---- a/std/file.d -+++ b/runtime/phobos/std/file.d -@@ -4184,6 +4184,8 @@ string tempDir() @trusted - { - // Don't check for a global temporary directory as - // Android doesn't have one. -+ version(apk) -+ cache = "/data/data/com.example.native_activity/files"; - } - else version(Posix) - { -diff --git a/std/random.d b/std/random.d -index 956ac880..78bc74de 100644 ---- a/std/random.d -+++ b/runtime/phobos/std/random.d -@@ -3051,7 +3051,7 @@ auto randomSample(Range, UniformRNG)(Range r, size_t n, auto ref UniformRNG rng) - { - auto sample1 = randomSample(a, 5, rng); - auto sample2 = sample1.save; -- assert(sample1.array() == sample2.array()); -+ //assert(sample1.array() == sample2.array()); - } - - // Bugzilla 8314 diff --git a/std/stdio.d b/std/stdio.d index 0c315026..8b1860d0 100644 --- a/std/stdio.d