Date: Sun, 15 Nov 2020 15:23:05 +0000 (UTC) From: Mikael Urankar <mikael@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r555229 - head/lang/ldc/files Message-ID: <202011151523.0AFFN5de007683@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mikael Date: Sun Nov 15 15:23:04 2020 New Revision: 555229 URL: https://svnweb.freebsd.org/changeset/ports/555229 Log: lang/ldc: fix build on aarch64 PR: 237427 Submitted by: Greg V Approved by: portmgr (tier-2 blanket) Added: head/lang/ldc/files/patch-ltsmaster_driver_targetmachine.cpp (contents, props changed) head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_setjmp.d (contents, props changed) head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_ucontext.d (contents, props changed) head/lang/ldc/files/patch-ltsmaster_runtime_phobos_std_internal_math_gammafunction.d (contents, props changed) Added: head/lang/ldc/files/patch-ltsmaster_driver_targetmachine.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/ldc/files/patch-ltsmaster_driver_targetmachine.cpp Sun Nov 15 15:23:04 2020 (r555229) @@ -0,0 +1,27 @@ +--- /usr/ports/lang/ldc/work/ldc-1.23.0/ltsmaster/driver/targetmachine.cpp ++++ /usr/ports/lang/ldc.last/work/ldc-1.23.0/ltsmaster/driver/targetmachine.cpp +@@ -587,6 +587,23 @@ + break; + } + ++ // Taken from clang's lib/Driver/ToolChains/Gnu.cpp ++ if (triple.getArch() == llvm::Triple::aarch64 || ++ triple.getArch() == llvm::Triple::aarch64_be || ++ (triple.getOS() == llvm::Triple::FreeBSD && ++ triple.getOSMajorVersion() >= 12) || ++ triple.getOS() == llvm::Triple::NaCl || ++ (triple.getVendor() == llvm::Triple::MipsTechnologies && ++ !triple.hasEnvironment()) || ++ triple.getOS() == llvm::Triple::Solaris ++#if LDC_LLVM_VER >= 400 ++ || triple.getArch() == llvm::Triple::riscv32 ++ || triple.getArch() == llvm::Triple::riscv64 ++#endif ++ ) { ++ targetOptions.UseInitArray = true; ++ } ++ + // Right now, we only support linker-level dead code elimination on Linux + // using the GNU toolchain (based on ld's --gc-sections flag). The Apple ld + // on OS X supports a similar flag (-dead_strip) that doesn't require + Added: head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_setjmp.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_setjmp.d Sun Nov 15 15:23:04 2020 (r555229) @@ -0,0 +1,27 @@ +--- ltsmaster/runtime/druntime/src/core/sys/posix/setjmp.d.orig 2020-11-14 19:34:19 UTC ++++ ltsmaster/runtime/druntime/src/core/sys/posix/setjmp.d +@@ -163,6 +163,12 @@ else version( FreeBSD ) + enum _JBLEN = 5; + struct _jmp_buf { c_long[_JBLEN + 1] _jb; } + } ++ else version( AArch64 ) ++ { ++ enum _JBLEN = 31; ++ // __int128_t ++ struct _jmp_buf { long[2][_JBLEN + 1] _jb; }; ++ } + else + static assert(0); + alias _jmp_buf[1] jmp_buf; +@@ -250,6 +256,11 @@ else version( FreeBSD ) + enum _JB_SIGFLAG = 5; + struct _sigjmp_buf { c_long[_JBLEN + 1] _sjb; } + } ++ else version( AArch64 ) ++ { ++ // __int128_t ++ struct _sigjmp_buf { long[2][_JBLEN + 1] _jb; }; ++ } + else + static assert(0); + alias _sigjmp_buf[1] sigjmp_buf; Added: head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_ucontext.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/ldc/files/patch-ltsmaster_runtime_druntime_src_core_sys_posix_ucontext.d Sun Nov 15 15:23:04 2020 (r555229) @@ -0,0 +1,41 @@ +--- ltsmaster/runtime/druntime/src/core/sys/posix/ucontext.d.orig 2020-11-14 19:35:48 UTC ++++ ltsmaster/runtime/druntime/src/core/sys/posix/ucontext.d +@@ -686,6 +686,38 @@ else version( FreeBSD ) + int[6] mc_spare2; + } + } ++ else version( AArch64 ) ++ { ++ alias __register_t = long; ++ ++ struct gpregs ++ { ++ __register_t[30] gp_x; ++ __register_t gp_lr; ++ __register_t gp_sp; ++ __register_t gp_elr; ++ uint gp_spsr; ++ int gp_pad; ++ } ++ ++ struct fpregs ++ { ++ ulong[2][32] fp_q; // __uint128_t ++ uint fp_sr; ++ uint fp_cr; ++ int fp_flags; ++ int fp_pad; ++ } ++ ++ struct mcontext_t ++ { ++ gpregs mc_gpregs; ++ fpregs mc_fpregs; ++ int mc_flags; ++ int mc_pad; ++ ulong[8] mc_spare; ++ } ++ } + + // <ucontext.h> + enum UCF_SWAPPED = 0x00000001; Added: head/lang/ldc/files/patch-ltsmaster_runtime_phobos_std_internal_math_gammafunction.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/ldc/files/patch-ltsmaster_runtime_phobos_std_internal_math_gammafunction.d Sun Nov 15 15:23:04 2020 (r555229) @@ -0,0 +1,22 @@ +https://github.com/ldc-developers/phobos/commit/65b103fc08c5a58f3b0c2b56ac8650ca8e678109.patch + +From 65b103fc08c5a58f3b0c2b56ac8650ca8e678109 Mon Sep 17 00:00:00 2001 +From: Iain Buclaw <ibuclaw@gdcproject.org> +Date: Sat, 23 May 2015 14:05:03 +0200 +Subject: [PATCH] Relax compile-time assertion in gammafunction to runtime + +--- ltsmaster/runtime/phobos/std/internal/math/gammafunction.d.orig 2020-11-14 19:44:53 UTC ++++ ltsmaster/runtime/phobos/std/internal/math/gammafunction.d +@@ -1653,8 +1653,10 @@ unittest { + real logmdigammaInverse(real y) + { + import std.numeric: findRoot; +- enum maxY = logmdigamma(real.min_normal); +- static assert(maxY > 0 && maxY <= real.max); ++ // FIXME: should be returned back to enum. ++ // Fix requires CTFEable `log` on non-x86 targets (check both LDC and GDC). ++ immutable maxY = logmdigamma(real.min_normal); ++ assert(maxY > 0 && maxY <= real.max); + + if (y >= maxY) + {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011151523.0AFFN5de007683>