diff --git c/lang/ldc/Makefile w/lang/ldc/Makefile index 9cdcb9b599a6..9e73394b9497 100644 --- c/lang/ldc/Makefile +++ w/lang/ldc/Makefile @@ -1,64 +1,94 @@ # $FreeBSD$ -PORTNAME= ldc -PORTVERSION= 1.14.0 +PORTNAME= ldc +PORTVERSION= 1.16.0 DISTVERSIONPREFIX= v -CATEGORIES= lang +CATEGORIES= lang -MAINTAINER= acm@FreeBSD.org -COMMENT= The LLVM-based D compiler +# fixes for LTO, gc-sections, backtrace +PATCH_SITES= https://github.com/myfreeweb/ldc/commit/ +PATCHFILES= 3616870e9acbe565ff5b59db97482eda010dc00d.patch:-p1 \ + 120ed38cef179ec3774253bb424c159f7a566aa7.patch:-p1 \ + 573cb1456b1074bb4ab604a838658f30beb6a797.patch:-p1 -LICENSE= BSD3CLAUSE +MAINTAINER= acm@FreeBSD.org +COMMENT= The LLVM-based D compiler +LICENSE= BSD3CLAUSE +USES= ninja cmake:insource compiler:c++14-lang -BUILD_DEPENDS= llvm70>0:devel/llvm70 -RUN_DEPENDS= llvm70>0:devel/llvm70 -LIB_DEPENDS= libconfig.so:devel/libconfig +OPTIONS_GROUP= BOOTSTRAP +BOOTSTRAP_DESC= Force using ltsmaster to bootstrap +OPTIONS_GROUP_BOOTSTRAP=LTSMASTER + +LLVM_VERSION= 80 +BUILD_DEPENDS= llvm${LLVM_VERSION}>0:devel/llvm${LLVM_VERSION} +RUN_DEPENDS= llvm${LLVM_VERSION}>0:devel/llvm${LLVM_VERSION} + +CC= ${LOCALBASE}/bin/clang${LLVM_VERSION} +CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION} +LLVM_CONFIG= ${LOCALBASE}/bin/llvm-config${LLVM_VERSION} +LDCVER= ${PORTVERSION} + +PLIST_SUB= LOCALBASE=${LOCALBASE} -BROKEN_aarch64= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? BROKEN_armv6= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? BROKEN_armv7= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? BROKEN_i386= function core.bitop.bsf (uint v) is not callable using argument types (ulong) BROKEN_powerpc64= fails to compile: cc1plus: error: unrecognized command line option "-std=c++11" -USES= cmake:insource -USE_GITHUB= yes -GH_ACCOUNT= ldc-developers -GH_PROJECT= ldc -GH_TUPLE= ldc-developers:ldc:911589c:tree/ltsmaster \ - ldc-developers:druntime:694089c:druntimelts/ltsmaster/runtime/druntime \ - ldc-developers:phobos:1d758b2:phoboslts/ltsmaster/runtime/phobos \ - ldc-developers:druntime:54cb25c:druntime/runtime/druntime \ - ldc-developers:phobos:71cf74f:phobos/runtime/phobos - -CMAKE_ARGS+= -DD_COMPILER:STRING="${WRKSRC}/ltsmaster/bin/ldmd2" \ - -DBUILD_SHARED_LIBS:STRING="BOTH" - -CC= clang70 -CXX= clang++70 - -BOOTVER= 0.17.6 -LLVM_CONFIG= llvm-config70 -LDCVER= ${PORTVERSION} +USE_GITHUB= yes +GH_ACCOUNT= ldc-developers +GH_PROJECT= ldc +GH_TUPLE= ldc-developers:druntime:6b36091:druntime/runtime/druntime \ + ldc-developers:phobos:4f42e2c:phobos/runtime/phobos .include -.if ${ARCH} == "amd64" -CFLAGS+= -fPIC +.if ${ARCH} == "amd64" || ${ARCH} == "aarch64" +CFLAGS+= -fPIC .endif -.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1200029 -EXTRA_PATCHES= ${PATCHDIR}/fbsd12-* +# Search for a usable bootstrap compiler or fall back to building ltsmaster +DRUNTIME_MINVER= 20680 + +DCOMPILERS= ldmd2 gdmd dmd + +.if empty(PORT_OPTIONS:MLTSMASTER) +.for DC_TRY in ${DCOMPILERS} +.if !defined(DC_HOST) +VERSION!= `which ${DC_TRY}` --version | ${SED} -n 's!^.*DMD.*v\([0-9]\).\([0-9][0-9][0-9]\).\([0-9]\).*!\1\2\3!p' +.if ${VERSION} > ${DRUNTIME_MINVER} +DC_HOST!= which ${DC_TRY} +BUILD_BOOTSTRAP= no +.endif +.endif +.endfor .endif -post-patch: - ${REINPLACE_CMD} -e 's|$${llvm_config_names}|${LLVM_CONFIG}|g' \ - ${WRKSRC}/ltsmaster/cmake/Modules/FindLLVM.cmake \ - ${WRKSRC}/cmake/Modules/FindLLVM.cmake +# falling back to creating bootstrap d-compiler +.if !defined (DC_HOST) +BUILD_BOOTSTRAP= yes +BOOTSTRAP_DIR= ${WRKDIRPREFIX}${.CURDIR}/work-bootstrap +DC_HOST= ${BOOTSTRAP_DIR}/ltsmaster/bin/ldmd2 +BUILD_BOOTSTRAP= yes +.endif +CMAKE_ARGS+= -DLDC_INSTALL_PREFIX="${PREFIX}" \ + -DD_COMPILER:STRING="${DC_HOST}" \ + -DCMAKE_C_COMPILER:STRING="${CC}" \ + -DCMAKE_CXX_COMPILER:STRING="${CXX}" \ + -DLLVM_CONFIG:PATH=${LLVM_CONFIG} \ + -DBUILD_SHARED_LIBS:STRING="BOTH" + +pre-build: + @echo "DEBUG: bootstrap:${BUILD_BOOTSTRAP} dmd:${DC_HOST} ver:${VERSION} options:${PORT_OPTIONS}" + +.if ${BUILD_BOOTSTRAP} == "yes" pre-configure: - @cd ${WRKSRC}/ltsmaster && \ - ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} . - @cd ${WRKSRC}/ltsmaster && \ - ${SETENV} ${MAKE_ENV} ${MAKE} + @echo "Building Bootstrap d-compiler..." + ${MAKE} -f Makefile.bootstrap FLAVOR=bootstrap +.else + @echo "Reusing pre-existing d-compiler..." +.endif .include diff --git c/lang/ldc/Makefile.bootstrap w/lang/ldc/Makefile.bootstrap new file mode 100644 index 000000000000..4a4319bb062b --- /dev/null +++ w/lang/ldc/Makefile.bootstrap @@ -0,0 +1,56 @@ +# $FreeBSD$ + +PORTNAME= ldc +DISTVERSION= 0.17.6-6 +DISTVERSIONPREFIX= v +DISTVERSIONSUFFIX= -g20ef705c +CATEGORIES= lang + +PATCHDIR= ${MASTERDIR}/files.bootstrap +DISTINFO_FILE= ${MASTERDIR}/distinfo.bootstrap + +MAINTAINER= acm@FreeBSD.org +COMMENT= The LLVM-based D compiler +LICENSE= BSD3CLAUSE +USES= ninja cmake:insource compiler + +BUILD_DEPENDS= llvm${LLVM_VERSION}>0:devel/llvm${LLVM_VERSION} +LIB_DEPENDS= libconfig.so:devel/libconfig +LLVM_VERSION= 70 + +# fake flavor support in bootstrap (as it is being passed down) +FLAVORS= bootstrap +FLAVOR?= ${FLAVORS[0]} + +BROKEN_armv6= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? +BROKEN_armv7= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? +BROKEN_i386= function core.bitop.bsf (uint v) is not callable using argument types (ulong) +BROKEN_powerpc64= fails to compile: cc1plus: error: unrecognized command line option "-std=c++11" + +USE_GITHUB= yes +GH_ACCOUNT= ldc-developers +GH_PROJECT= ldc +GH_TUPLE= ldc-developers:druntime:13b1ccf:druntimelts/runtime/druntime \ + ldc-developers:phobos:1d758b2:phoboslts/runtime/phobos + +CC= ${LOCALBASE}/bin/clang${LLVM_VERSION} +CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION} +LLVM_CONFIG= ${LOCALBASE}/bin/llvm-config${LLVM_VERSION} +LDCVER= ${PORTVERSION} + +.include + +.if ${ARCH} == "amd64" || ${ARCH} == "aarch64" +CFLAGS+= -fPIC +.endif + +CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \ + -DCMAKE_CXX_COMPILER:STRING="${CXX}" \ + -DLLVM_CONFIG:PATH=${LLVM_CONFIG} + +post-patch: + ${LN} -sf ${WRKSRC} ${WRKDIR}/ltsmaster + ${REINPLACE_CMD} -e 's|$${llvm_config_names}|${LLVM_CONFIG}|g' \ + ${WRKSRC}/cmake/Modules/FindLLVM.cmake + +.include diff --git c/lang/ldc/distinfo w/lang/ldc/distinfo index 88aab07c8ab5..5698ce51395a 100644 --- c/lang/ldc/distinfo +++ w/lang/ldc/distinfo @@ -1,13 +1,13 @@ -TIMESTAMP = 1551800863 -SHA256 (ldc-developers-ldc-v1.14.0_GH0.tar.gz) = daa7876ce846861cd9feb92f35dc0ca537a845492ca8a3eebecc9d166bc324b3 -SIZE (ldc-developers-ldc-v1.14.0_GH0.tar.gz) = 1664660 -SHA256 (ldc-developers-ldc-911589c_GH0.tar.gz) = c10ee47d857358ea97eccd14b49b4152c7b2621c0129eee1e8f98988f1d13f5e -SIZE (ldc-developers-ldc-911589c_GH0.tar.gz) = 1231073 -SHA256 (ldc-developers-druntime-694089c_GH0.tar.gz) = 29b1a27f767ac9c8a0c30926991d9abcda119aaf923b05caa686a6c396ac0a83 -SIZE (ldc-developers-druntime-694089c_GH0.tar.gz) = 953726 -SHA256 (ldc-developers-phobos-1d758b2_GH0.tar.gz) = af70f2d4b09e0062ba986e215677f484c1cec2977a74ca1a73d3534a120992e9 -SIZE (ldc-developers-phobos-1d758b2_GH0.tar.gz) = 1923043 -SHA256 (ldc-developers-druntime-54cb25c_GH0.tar.gz) = 47a71942f9f6d4c36d867eb2526a72aece36fb959cf99619e525cacb4951e864 -SIZE (ldc-developers-druntime-54cb25c_GH0.tar.gz) = 1665530 -SHA256 (ldc-developers-phobos-71cf74f_GH0.tar.gz) = fe01cb3decccde3c5aa0defcba715c283a1f11bf2bed6aedd0e33e43030c9c72 -SIZE (ldc-developers-phobos-71cf74f_GH0.tar.gz) = 2355367 +TIMESTAMP = 1562693906 +SHA256 (ldc-developers-ldc-v1.16.0_GH0.tar.gz) = fe006f4b9447ba929e84e32fe4a3254329ab9aa058ae09adcd8605f7e2f989ac +SIZE (ldc-developers-ldc-v1.16.0_GH0.tar.gz) = 1721861 +SHA256 (ldc-developers-druntime-6b36091_GH0.tar.gz) = b1cfc20004e1e9f220244102be80d494d02f6a19130bef00e9decbe00d475f03 +SIZE (ldc-developers-druntime-6b36091_GH0.tar.gz) = 1706573 +SHA256 (ldc-developers-phobos-4f42e2c_GH0.tar.gz) = b0b23bb28d49eac1b8332deadd4d3c03c330646a6d997466552b4ff6709a56be +SIZE (ldc-developers-phobos-4f42e2c_GH0.tar.gz) = 2360390 +SHA256 (3616870e9acbe565ff5b59db97482eda010dc00d.patch) = 0707adde9ca2bafd25e8c347e2fcc7d716a60eb30cfe3d8eec91c9c5f6a90dfc +SIZE (3616870e9acbe565ff5b59db97482eda010dc00d.patch) = 2515 +SHA256 (120ed38cef179ec3774253bb424c159f7a566aa7.patch) = 545768390fe97dcb9a489c59af0db5a86ebea14b848a73630320d35895b2bd90 +SIZE (120ed38cef179ec3774253bb424c159f7a566aa7.patch) = 2415 +SHA256 (573cb1456b1074bb4ab604a838658f30beb6a797.patch) = 299cc893462af827623977be0517554311eff86933792ae7cd7d38e959e95c03 +SIZE (573cb1456b1074bb4ab604a838658f30beb6a797.patch) = 1282 diff --git c/lang/ldc/distinfo.bootstrap w/lang/ldc/distinfo.bootstrap new file mode 100644 index 000000000000..1d80c04e158a --- /dev/null +++ w/lang/ldc/distinfo.bootstrap @@ -0,0 +1,7 @@ +TIMESTAMP = 1562693900 +SHA256 (ldc-developers-ldc-v0.17.6-6-g20ef705c_GH0.tar.gz) = 569dea918c5e164cceab4a8c73dcd7fcf3c913bd99d4f65a5e57ff343a234d6e +SIZE (ldc-developers-ldc-v0.17.6-6-g20ef705c_GH0.tar.gz) = 1231783 +SHA256 (ldc-developers-druntime-13b1ccf_GH0.tar.gz) = 0be26cb90b540e972eae3660e1b865f97d5b1cb6c7ffe76e2ec4eae89ed63f4a +SIZE (ldc-developers-druntime-13b1ccf_GH0.tar.gz) = 953762 +SHA256 (ldc-developers-phobos-1d758b2_GH0.tar.gz) = af70f2d4b09e0062ba986e215677f484c1cec2977a74ca1a73d3534a120992e9 +SIZE (ldc-developers-phobos-1d758b2_GH0.tar.gz) = 1923043 diff --git c/lang/ldc/files.bootstrap/patch-aarch64 w/lang/ldc/files.bootstrap/patch-aarch64 new file mode 100644 index 000000000000..2b3925c90b5d --- /dev/null +++ w/lang/ldc/files.bootstrap/patch-aarch64 @@ -0,0 +1,82 @@ +- Upstreamed aarch64 support patch (but not merged into ldc's fork): + https://github.com/dlang/druntime/pull/2269 +- Remove failing (on aarch64) static assert in bootstrap compiler's math function + +--- runtime/druntime/src/core/sys/posix/setjmp.d.orig 2018-12-15 16:48:11 UTC ++++ 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; +@@ -249,6 +255,11 @@ else version( FreeBSD ) + enum _JB_SIGMASK = 3; + 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); +--- runtime/druntime/src/core/sys/posix/ucontext.d.orig 2018-12-15 16:48:11 UTC ++++ 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; ++ } ++ } + + // + enum UCF_SWAPPED = 0x00000001; +--- runtime/phobos/std/internal/math/gammafunction.d.orig 2019-04-20 23:21:36 UTC ++++ runtime/phobos/std/internal/math/gammafunction.d +@@ -1654,7 +1654,6 @@ real logmdigammaInverse(real y) + { + import std.numeric: findRoot; + enum maxY = logmdigamma(real.min_normal); +- static assert(maxY > 0 && maxY <= real.max); + + if (y >= maxY) + { diff --git c/lang/ldc/files.bootstrap/patch-fbsd12 w/lang/ldc/files.bootstrap/patch-fbsd12 new file mode 100644 index 000000000000..9049945dc89e --- /dev/null +++ w/lang/ldc/files.bootstrap/patch-fbsd12 @@ -0,0 +1,81 @@ +--- runtime/druntime/src/core/sys/freebsd/sys/event.d.orig 2018-12-15 16:48:11 UTC ++++ runtime/druntime/src/core/sys/freebsd/sys/event.d +@@ -125,6 +125,7 @@ enum + } + + int kqueue(); ++pragma(mangle, "kevent@FBSD_1.0") + int kevent(int kq, const kevent_t *changelist, int nchanges, + kevent_t *eventlist, int nevents, + const timespec *timeout); +--- runtime/druntime/src/core/sys/posix/dirent.d.orig 2018-12-15 16:48:11 UTC ++++ runtime/druntime/src/core/sys/posix/dirent.d +@@ -140,7 +140,7 @@ else version( FreeBSD ) + + alias void* DIR; + +- dirent* readdir(DIR*); ++ pragma(mangle, "readdir@FBSD_1.0") dirent* readdir(DIR*); + } + else version( DragonFlyBSD ) + { +@@ -273,7 +273,7 @@ else version( OSX ) + } + else version( FreeBSD ) + { +- int readdir_r(DIR*, dirent*, dirent**); ++ pragma(mangle, "readdir_r@FBSD_1.0") int readdir_r(DIR*, dirent*, dirent**); + } + else version( DragonFlyBSD ) + { +@@ -315,12 +315,12 @@ version( CRuntime_Glibc ) + } + else version( FreeBSD ) + { +- void seekdir(DIR*, c_long); +- c_long telldir(DIR*); ++ pragma(mangle, "seekdir@@FBSD_1.0") void seekdir(DIR*, c_long); ++ pragma(mangle, "telldir@@FBSD_1.0") c_long telldir(DIR*); + } + else version( DragonFlyBSD ) + { +- void seekdir(DIR*, c_long); ++ void seekdir(DIR*, c_long); + c_long telldir(DIR*); + } + else version (OSX) +--- runtime/druntime/src/core/sys/posix/sys/stat.d.orig 2018-12-15 16:48:11 UTC ++++ runtime/druntime/src/core/sys/posix/sys/stat.d +@@ -1190,9 +1190,9 @@ else version( OSX ) + } + else version( FreeBSD ) + { +- int fstat(int, stat_t*); +- int lstat(in char*, stat_t*); +- int stat(in char*, stat_t*); ++ pragma(mangle, "fstat@FBSD_1.0") int fstat(int, stat_t*); ++ pragma(mangle, "lstat@FBSD_1.0") int lstat(in char*, stat_t*); ++ pragma(mangle, "stat@FBSD_1.0") int stat(in char*, stat_t*); + } + else version( DragonFlyBSD ) + { +@@ -1267,7 +1267,7 @@ else version( FreeBSD ) + enum S_IFLNK = 0xA000; // octal 0120000 + enum S_IFSOCK = 0xC000; // octal 0140000 + +- int mknod(in char*, mode_t, dev_t); ++ pragma(mangle, "mknod@FBSD_1.0") int mknod(in char*, mode_t, dev_t); + } + else version( DragonFlyBSD ) + { +--- runtime/druntime/src/core/sys/posix/sys/statvfs.d.orig 2018-12-15 16:48:11 UTC ++++ runtime/druntime/src/core/sys/posix/sys/statvfs.d +@@ -107,6 +107,6 @@ else + ST_NOSUID = 2 + } + +- int statvfs (const char * file, statvfs_t* buf); +- int fstatvfs (int fildes, statvfs_t *buf) @trusted; ++ pragma(mangle, "fstatvfs@FBSD_1.0") int statvfs (const char * file, statvfs_t* buf); ++ pragma(mangle, "statvfs@FBSD_1.0") int fstatvfs (int fildes, statvfs_t *buf) @trusted; + } diff --git c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-freebsd-sys_event.d w/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-freebsd-sys_event.d deleted file mode 100644 index 761a66631ae9..000000000000 --- c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-freebsd-sys_event.d +++ /dev/null @@ -1,14 +0,0 @@ ---- ltsmaster/runtime/druntime/src/core/sys/freebsd/sys/event.d 2018-08-21 18:55:47.000000000 +0000 -+++ ltsmaster/runtime/druntime/src/core/sys/freebsd/sys/event.d 2019-03-06 04:06:16.750660000 +0000 -@@ -46,8 +46,9 @@ - short filter; /* filter for event */ - ushort flags; - uint fflags; -- intptr_t data; -- void *udata; /* opaque user data identifier */ -+ long data; -+ void* udata; /* opaque user data identifier */ -+ ulong[4] ext; - } - - enum diff --git c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_stat.d w/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_stat.d deleted file mode 100644 index 03fb304eabda..000000000000 --- c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_stat.d +++ /dev/null @@ -1,59 +0,0 @@ ---- ltsmaster/runtime/druntime/src/core/sys/posix/sys/stat.d 2018-08-21 18:55:47.000000000 +0000 -+++ ltsmaster/runtime/druntime/src/core/sys/posix/sys/stat.d 2019-03-06 04:13:18.999142000 +0000 -@@ -714,32 +714,42 @@ - { - struct stat_t - { -- dev_t st_dev; -- ino_t st_ino; -- mode_t st_mode; -- nlink_t st_nlink; -- uid_t st_uid; -- gid_t st_gid; -- dev_t st_rdev; -+ dev_t st_dev; -+ ino_t st_ino; -+ nlink_t st_nlink; -+ mode_t st_mode; -+ short st_padding0; -+ uid_t st_uid; -+ gid_t st_gid; -+ int st_padding1; -+ dev_t st_rdev; - -+ version(X86) int st_atim_ext; -+ - time_t st_atime; - c_long __st_atimensec; -+ -+ version(X86) int st_mtim_ext; -+ - time_t st_mtime; - c_long __st_mtimensec; -+ -+ version(X86) int st_ctim_ext; -+ - time_t st_ctime; - c_long __st_ctimensec; - -- off_t st_size; -- blkcnt_t st_blocks; -- blksize_t st_blksize; -- fflags_t st_flags; -- uint st_gen; -- int st_lspare; -+ version(X86) int st_btim_ext; - - time_t st_birthtime; - c_long st_birthtimensec; - -- ubyte[16 - timespec.sizeof] padding; -+ off_t st_size; -+ blkcnt_t st_blocks; -+ blksize_t st_blksize; -+ fflags_t st_flags; -+ ulong st_gen; -+ ulong[10] st_spare; - } - - enum S_IRUSR = 0x100; // octal 0000400 diff --git c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_types.d w/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_types.d deleted file mode 100644 index e4036fc44b5c..000000000000 --- c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix-sys_types.d +++ /dev/null @@ -1,19 +0,0 @@ ---- ltsmaster/runtime/druntime/src/core/sys/posix/sys/types.d 2019-03-06 04:17:35.909692000 +0000 -+++ ltsmaster/runtime/druntime/src/core/sys/posix/sys/types.d 2019-03-06 04:18:41.162430000 +0000 -@@ -124,12 +124,12 @@ - else version( FreeBSD ) - { - alias long blkcnt_t; -- alias uint blksize_t; -- alias uint dev_t; -+ alias ulong blksize_t; -+ alias ulong dev_t; - alias uint gid_t; -- alias uint ino_t; -+ alias ulong ino_t; - alias ushort mode_t; -- alias ushort nlink_t; -+ alias ulong nlink_t; - alias long off_t; - alias int pid_t; - //size_t (defined in core.stdc.stddef) diff --git c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix_dirent.d w/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix_dirent.d deleted file mode 100644 index 8387f06a18d2..000000000000 --- c/lang/ldc/files/fbsd12-ltsmaster-runtime-druntime-src-core-sys-posix_dirent.d +++ /dev/null @@ -1,17 +0,0 @@ ---- ltsmaster/runtime/druntime/src/core/sys/posix/dirent.d 2019-03-06 04:07:06.836421000 +0000 -+++ ltsmaster/runtime/druntime/src/core/sys/posix/dirent.d 2019-03-06 04:08:34.306001000 +0000 -@@ -131,10 +131,12 @@ - align(4) - struct dirent - { -- uint d_fileno; -+ ino_t d_fileno; -+ off_t d_off; - ushort d_reclen; - ubyte d_type; -- ubyte d_namlen; -+ ushort d_namlen; -+ ushort d_pad1; - char[256] d_name; - } - diff --git c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_event.d w/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_event.d deleted file mode 100644 index 197f34a33a73..000000000000 --- c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_event.d +++ /dev/null @@ -1,14 +0,0 @@ ---- runtime/druntime/src/core/sys/freebsd/sys/event.d 2019-02-15 17:20:40.000000000 +0000 -+++ runtime/druntime/src/core/sys/freebsd/sys/event.d 2019-03-05 17:57:03.552667000 +0000 -@@ -49,8 +49,9 @@ - short filter; /* filter for event */ - ushort flags; - uint fflags; -- intptr_t data; -- void *udata; /* opaque user data identifier */ -+ long data; -+ void* udata; /* opaque user data identifier */ -+ ulong[4] ext; - } - - enum diff --git c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_mount.d w/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_mount.d deleted file mode 100644 index 03eda2f66164..000000000000 --- c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-freebsd-sys_mount.d +++ /dev/null @@ -1,13 +0,0 @@ ---- runtime/druntime/src/core/sys/freebsd/sys/mount.d 2019-03-05 17:38:00.882617000 +0000 -+++ runtime/druntime/src/core/sys/freebsd/sys/mount.d 2019-03-05 17:38:53.720464000 +0000 -@@ -32,8 +32,8 @@ - } - - enum MFSNAMELEN = 16; --enum MNAMELEN = 88; --enum STATFS_VERSION = 0x20030518; -+enum MNAMELEN = 1024; -+enum STATFS_VERSION = 0x20140518; - - struct statfs_t - { diff --git c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_stat.d w/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_stat.d deleted file mode 100644 index 20cf05dba54d..000000000000 --- c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_stat.d +++ /dev/null @@ -1,58 +0,0 @@ ---- runtime/druntime/src/core/sys/posix/sys/stat.d 2019-02-15 17:20:40.000000000 +0000 -+++ runtime/druntime/src/core/sys/posix/sys/stat.d 2019-03-05 17:49:41.528876000 +0000 -@@ -930,32 +930,41 @@ - - struct stat_t - { -- dev_t st_dev; -- ino_t st_ino; -- mode_t st_mode; -- nlink_t st_nlink; -- uid_t st_uid; -- gid_t st_gid; -- dev_t st_rdev; -+ dev_t st_dev; -+ ino_t st_ino; -+ nlink_t st_nlink; -+ mode_t st_mode; -+ short st_padding0; -+ uid_t st_uid; -+ gid_t st_gid; -+ int st_padding1; -+ dev_t st_rdev; - -+ version(X86) int st_atim_ext; - time_t st_atime; - c_long __st_atimensec; -+ -+ version(X86) int st_mtim_ext; -+ - time_t st_mtime; - c_long __st_mtimensec; -+ -+ version(X86) int st_ctim_ext; -+ - time_t st_ctime; - c_long __st_ctimensec; - -- off_t st_size; -- blkcnt_t st_blocks; -- blksize_t st_blksize; -- fflags_t st_flags; -- uint st_gen; -- int st_lspare; -+ version(X86) int st_btim_ext; - - time_t st_birthtime; - c_long st_birthtimensec; - -- ubyte[16 - timespec.sizeof] padding; -+ off_t st_size; -+ blkcnt_t st_blocks; -+ blksize_t st_blksize; -+ fflags_t st_flags; -+ ulong st_gen; -+ ulong[10] st_spare; - } - - enum S_IRUSR = 0x100; // octal 0000400 diff --git c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_types.d w/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_types.d deleted file mode 100644 index 266e930fdea6..000000000000 --- c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix-sys_types.d +++ /dev/null @@ -1,21 +0,0 @@ ---- runtime/druntime/src/core/sys/posix/sys/types.d 2019-02-15 17:20:40.000000000 +0000 -+++ runtime/druntime/src/core/sys/posix/sys/types.d 2019-03-05 17:51:58.972306000 +0000 -@@ -145,14 +145,13 @@ - } - else version (FreeBSD) - { -- // https://github.com/freebsd/freebsd/blob/master/sys/sys/_types.h - alias long blkcnt_t; -- alias uint blksize_t; -- alias uint dev_t; -+ alias ulong blksize_t; -+ alias ulong dev_t; - alias uint gid_t; -- alias uint ino_t; -+ alias ulong ino_t; - alias ushort mode_t; -- alias ushort nlink_t; -+ alias ulong nlink_t; - alias long off_t; - alias int pid_t; - //size_t (defined in core.stdc.stddef) diff --git c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix_dirent.d w/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix_dirent.d deleted file mode 100644 index b6fbf9947824..000000000000 --- c/lang/ldc/files/fbsd12-runtime-druntime-src-core-sys-posix_dirent.d +++ /dev/null @@ -1,21 +0,0 @@ ---- runtime/druntime/src/core/sys/posix/dirent.d 2019-03-05 17:39:54.822687000 +0000 -+++ runtime/druntime/src/core/sys/posix/dirent.d 2019-03-05 17:41:19.267583000 +0000 -@@ -152,11 +152,13 @@ - align(4) - struct dirent - { -- uint d_fileno; -- ushort d_reclen; -- ubyte d_type; -- ubyte d_namlen; -- char[256] d_name; -+ ino_t d_fileno; -+ off_t d_off; -+ ushort d_reclen; -+ ubyte d_type; -+ ushort d_namlen; -+ ushort d_pad1; -+ char[256] d_name; - } - - alias void* DIR; diff --git c/lang/ldc/files/patch-backtrace w/lang/ldc/files/patch-backtrace new file mode 100644 index 000000000000..98e69348f90f --- /dev/null +++ w/lang/ldc/files/patch-backtrace @@ -0,0 +1,38 @@ +https://github.com/ldc-developers/ldc/issues/3108 +https://github.com/myfreeweb/druntime/commit/4cc671669d45f14cc8fd270857d5cbeae6b38be8 + +--- runtime/druntime/src/core/sys/freebsd/execinfo.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/freebsd/execinfo.d +@@ -15,6 +15,9 @@ nothrow: + version (GNU) + version = BacktraceExternal; + ++version (LDC) ++ version = BacktraceExternal; ++ + version (BacktraceExternal) + { + size_t backtrace(void**, size_t); +@@ -38,11 +41,6 @@ else + asm nothrow @trusted { mov p[EBP], EBP; } + else version (D_InlineAsm_X86_64) + asm nothrow @trusted { mov p[RBP], RBP; } +- else version (AArch64) // LDC +- { +- import ldc.llvmasm; +- __asm("str x29, $0", "=*m", &p); +- } + else + static assert(false, "Architecture not supported."); + +--- runtime/druntime/src/core/runtime.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/runtime.d +@@ -778,7 +778,7 @@ Throwable.TraceInfo defaultTraceHandler( void* ptr = n + { + version (LDC) + { +- numframes = backtrace( callstack.ptr, MAXFRAMES ); ++ numframes = cast(int) backtrace( callstack.ptr, MAXFRAMES ); + } + else + { diff --git c/lang/ldc/files/patch-fbsd12 w/lang/ldc/files/patch-fbsd12 new file mode 100644 index 000000000000..2d69ef457eb9 --- /dev/null +++ w/lang/ldc/files/patch-fbsd12 @@ -0,0 +1,111 @@ +https://github.com/dlang/druntime/pull/2668 + +--- runtime/druntime/src/core/sys/freebsd/sys/event.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/freebsd/sys/event.d +@@ -144,6 +144,7 @@ enum + } + + int kqueue(); ++pragma(mangle, "kevent@FBSD_1.0") + int kevent(int kq, const kevent_t *changelist, int nchanges, + kevent_t *eventlist, int nevents, + const timespec *timeout); +--- runtime/druntime/src/core/sys/freebsd/sys/mount.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/freebsd/sys/mount.d +@@ -288,17 +288,17 @@ enum uint VQ_FLAG2000 = 0x2000; + enum uint VQ_FLAG4000 = 0x4000; + enum uint VQ_FLAG8000 = 0x8000; + +-int fhopen(const fhandle_t*, int); +-int fhstat(const fhandle_t*, stat_t*); +-int fhstatfs(const fhandle_t*, statfs_t*); +-int fstatfs(int, statfs_t*); +-int getfh(const char*, fhandle_t*); +-int getfsstat(statfs_t*, c_long, int); +-int getmntinfo(statfs_t**, int); +-int lgetfh(const char*, fhandle_t*); +-int mount(const char*, const char*, int, void*); ++pragma(mangle, "fhopen@@FBSD_1.0") int fhopen(const fhandle_t*, int); ++pragma(mangle, "fhstat@FBSD_1.0") int fhstat(const fhandle_t*, stat_t*); ++pragma(mangle, "fhstatfs@FBSD_1.0") int fhstatfs(const fhandle_t*, statfs_t*); ++pragma(mangle, "fstatfs@FBSD_1.0") int fstatfs(int, statfs_t*); ++pragma(mangle, "getfh@@FBSD_1.0") int getfh(const char*, fhandle_t*); ++pragma(mangle, "getfsstat@FBSD_1.0") int getfsstat(statfs_t*, c_long, int); ++pragma(mangle, "getmntinfo@FBSD_1.0") int getmntinfo(statfs_t**, int); ++pragma(mangle, "lgetfh@@FBSD_1.0") int lgetfh(const char*, fhandle_t*); ++pragma(mangle, "mount@@FBSD_1.0") int mount(const char*, const char*, int, void*); + //int nmount(iovec*, uint, int); +-int statfs(const char*, statfs_t*); +-int unmount(const char*, int); ++pragma(mangle, "statfs@FBSD_1.0") int statfs(const char*, statfs_t*); ++pragma(mangle, "unmount@@FBSD_1.0") int unmount(const char*, int); + + //int getvfsbyname(const char*, xvfsconf*); +--- runtime/druntime/src/core/sys/posix/dirent.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/posix/dirent.d +@@ -161,7 +161,7 @@ else version (FreeBSD) + + alias void* DIR; + +- dirent* readdir(DIR*); ++ pragma(mangle, "readdir@FBSD_1.0") dirent* readdir(DIR*); + } + else version (NetBSD) + { +@@ -473,7 +473,7 @@ else version (Darwin) + } + else version (FreeBSD) + { +- int readdir_r(DIR*, dirent*, dirent**); ++ pragma(mangle, "readdir_r@FBSD_1.0") int readdir_r(DIR*, dirent*, dirent**); + } + else version (DragonFlyBSD) + { +@@ -540,8 +540,8 @@ version (CRuntime_Glibc) + } + else version (FreeBSD) + { +- void seekdir(DIR*, c_long); +- c_long telldir(DIR*); ++ pragma(mangle, "seekdir@@FBSD_1.0") void seekdir(DIR*, c_long); ++ pragma(mangle, "telldir@@FBSD_1.0") c_long telldir(DIR*); + } + else version (NetBSD) + { +--- runtime/druntime/src/core/sys/posix/sys/stat.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/posix/sys/stat.d +@@ -1859,9 +1859,9 @@ else version (Darwin) + } + else version (FreeBSD) + { +- int fstat(int, stat_t*); +- int lstat(in char*, stat_t*); +- int stat(in char*, stat_t*); ++ pragma(mangle, "fstat@FBSD_1.0") int fstat(int, stat_t*); ++ pragma(mangle, "lstat@FBSD_1.0") int lstat(in char*, stat_t*); ++ pragma(mangle, "stat@FBSD_1.0") int stat(in char*, stat_t*); + } + else version (NetBSD) + { +@@ -1975,7 +1975,7 @@ else version (FreeBSD) + enum S_IFLNK = 0xA000; // octal 0120000 + enum S_IFSOCK = 0xC000; // octal 0140000 + +- int mknod(in char*, mode_t, dev_t); ++ pragma(mangle, "mknod@FBSD_1.0") int mknod(in char*, mode_t, dev_t); + } + else version (NetBSD) + { +--- runtime/druntime/src/core/sys/posix/sys/statvfs.d.orig 2019-05-27 19:11:41 UTC ++++ runtime/druntime/src/core/sys/posix/sys/statvfs.d +@@ -254,8 +254,8 @@ else version (FreeBSD) + enum uint ST_RDONLY = 0x1; + enum uint ST_NOSUID = 0x2; + +- int fstatvfs(int, statvfs_t*); +- int statvfs(const char*, statvfs_t*); ++ pragma(mangle, "fstatvfs@FBSD_1.0") int fstatvfs(int, statvfs_t*); ++ pragma(mangle, "statvfs@FBSD_1.0") int statvfs(const char*, statvfs_t*); + } + else + { diff --git c/lang/ldc/pkg-plist w/lang/ldc/pkg-plist index b3cc42ec5630..ed4e1e9d5e32 100644 --- c/lang/ldc/pkg-plist +++ w/lang/ldc/pkg-plist @@ -11,15 +11,21 @@ include/d/core/checkedint.d include/d/core/cpuid.d include/d/core/demangle.d include/d/core/exception.d +include/d/core/gc/config.d +include/d/core/gc/gcinterface.d +include/d/core/gc/registry.d include/d/core/internal/abort.d include/d/core/internal/arrayop.d include/d/core/internal/convert.d +include/d/core/internal/dassert.d include/d/core/internal/hash.d +include/d/core/internal/lifetime.d include/d/core/internal/parseoptions.d include/d/core/internal/spinlock.d include/d/core/internal/string.d include/d/core/internal/traits.d include/d/core/internal/utf.d +include/d/core/lifetime.d include/d/core/math.d include/d/core/memory.d include/d/core/runtime.d @@ -46,14 +52,18 @@ include/d/core/stdc/tgmath.d include/d/core/stdc/time.d include/d/core/stdc/wchar_.d include/d/core/stdc/wctype.d +include/d/core/stdcpp/allocator.d include/d/core/stdcpp/array.d include/d/core/stdcpp/exception.d +include/d/core/stdcpp/new_.d include/d/core/stdcpp/string_view.d +include/d/core/stdcpp/type_traits.d include/d/core/stdcpp/typeinfo.d include/d/core/stdcpp/xutility.d include/d/core/sync/barrier.d include/d/core/sync/condition.d include/d/core/sync/config.d +include/d/core/sync/event.d include/d/core/sync/exception.d include/d/core/sync/mutex.d include/d/core/sync/rwmutex.d @@ -517,6 +527,7 @@ include/d/std/net/curl.d include/d/std/net/isemail.d include/d/std/numeric.d include/d/std/outbuffer.d +include/d/std/package.d include/d/std/parallelism.d include/d/std/path.d include/d/std/process.d @@ -554,23 +565,29 @@ include/d/std/xml.d include/d/std/zip.d include/d/std/zlib.d lib/libdruntime-ldc-debug-shared.so -lib/libdruntime-ldc-debug-shared.so.2.0.84 -lib/libdruntime-ldc-debug-shared.so.84 +lib/libdruntime-ldc-debug-shared.so.2.0.86 +lib/libdruntime-ldc-debug-shared.so.86 lib/libdruntime-ldc-debug.a lib/libdruntime-ldc-shared.so -lib/libdruntime-ldc-shared.so.2.0.84 -lib/libdruntime-ldc-shared.so.84 +lib/libdruntime-ldc-shared.so.2.0.86 +lib/libdruntime-ldc-shared.so.86 lib/libdruntime-ldc.a lib/libldc-jit-rt.a lib/libldc-jit.so -lib/libldc-jit.so.2.0.84 -lib/libldc-jit.so.84 +lib/libldc-jit.so.2.0.86 +lib/libldc-jit.so.86 lib/libphobos2-ldc-debug-shared.so -lib/libphobos2-ldc-debug-shared.so.2.0.84 -lib/libphobos2-ldc-debug-shared.so.84 +lib/libphobos2-ldc-debug-shared.so.2.0.86 +lib/libphobos2-ldc-debug-shared.so.86 lib/libphobos2-ldc-debug.a lib/libphobos2-ldc-shared.so -lib/libphobos2-ldc-shared.so.2.0.84 -lib/libphobos2-ldc-shared.so.84 +lib/libphobos2-ldc-shared.so.2.0.86 +lib/libphobos2-ldc-shared.so.86 lib/libphobos2-ldc.a @dir include/d/etc/c/zlib +@postexec if [ ! -f %%LOCALBASE%%/bin/ldc2 ]; then ln -s %%PREFIX%%/bin/ldc2 %%LOCALBASE%%/bin/ldc2 && touch %%PREFIX%%/.ldc2-alt-linked ;fi +@postexec if [ ! -f %%LOCALBASE%%/bin/ldmd2 ]; then ln -s %%PREFIX%%/bin/ldmd2 %%LOCALBASE%%/bin/ldmd2 && touch %%PREFIX%%/.ldmd2-alt-linked ;fi +@postexec if [ ! -f %%LOCALBASE%%/etc/ldc2.conf ]; then ln -s %%PREFIX%%/etc/ldc2.conf %%LOCALBASE%%/etc/ldc2.conf && touch %%PREFIX%%/.ldc2.conf-alt-linked ;fi +@postunexec if [ -f %%PREFIX%%/.ldc2-alt-linked ]; then rm %%LOCALBASE%%/bin/ldc2 ;fi +@postunexec if [ -f %%PREFIX%%/.ldmd2-alt-linked ]; then rm %%LOCALBASE%%/bin/ldmd2 ;fi +@postunexec if [ -f %%PREFIX%%/.ldc2.conf-alt-linked ]; then rm %%LOCALBASE%%/etc/ldc2.conf ;fi