From: Brian Callahan Subject: UPDATE: lang/dmd 2.106.0 => 2.106.1 + i386 package To: OpenBSD Ports ML Date: Thu, 4 Jan 2024 23:59:06 +0000 Hi ports -- Attached is an update for dmd. It also enables a dmd package for i386. Tests good on my i386 netbook. The new bootstrap should hopefully be more resilient against libc and other library bumps. Additionally, dmd should no longer need any hacks for nobtcfi. But as my laptop doesn't support it, I can't test directly. Reports welcome. OK? ~Brian Index: Makefile =================================================================== RCS file: /cvs/ports/lang/dmd/Makefile,v retrieving revision 1.16 diff -u -p -r1.16 Makefile --- Makefile 19 Dec 2023 22:34:04 -0000 1.16 +++ Makefile 4 Jan 2024 23:19:47 -0000 @@ -1,10 +1,6 @@ -# i386 forthcoming -ONLY_FOR_ARCHS = amd64 +ONLY_FOR_ARCHS = amd64 i386 -# No BT CFI yet. -USE_NOBTCFI = Yes - -V = 2.106.0 +V = 2.106.1 COMMENT = reference compiler for the D programming language DISTFILES = dmd-${V}{v${V}}.tar.gz DISTFILES.boot= dmd-${V}-bootstrap.tar.gz @@ -26,8 +22,7 @@ SITES.phobos = https://github.com/dlang/ USE_GMAKE = Yes MAKE_ENV = HOST_CXX="${CXX}" \ - HOST_DMD="${WRKDIR}/dmd-bootstrap/openbsd/bin${MODEL}/dmd" \ - LD_LIBRARY_PATH="${WRKSRC}/dmd-bootstrap/openbsd/bin${MODEL}" + HOST_DMD="${WRKDIR}/dmd-bootstrap/openbsd/bin${MODEL}/dmd" MAKE_FILE = posix.mak NO_TEST = Yes @@ -43,8 +38,6 @@ MODEL = 32 post-extract: mv ${WRKSRC}/dmd-${V} ${WRKSRC}/dmd mv ${WRKSRC}/phobos-${V} ${WRKSRC}/phobos - chmod 644 ${WRKDIR}/dmd-bootstrap/openbsd/bin64/lib*.so* # XXX - cp /usr/lib/libc.so.98.* ${WRKDIR}/dmd-bootstrap/openbsd/bin64/ # XXX # We need to do this manually. # Yes, this is all really correct. Index: distinfo =================================================================== RCS file: /cvs/ports/lang/dmd/distinfo,v retrieving revision 1.11 diff -u -p -r1.11 distinfo --- distinfo 18 Dec 2023 22:20:58 -0000 1.11 +++ distinfo 4 Jan 2024 23:19:47 -0000 @@ -1,6 +1,6 @@ -SHA256 (dmd-2.106.0-bootstrap.tar.gz) = lSsGN+CaT80zcTbEuUQHbFV0wL5DXikDGWFepL7/nbY= -SHA256 (dmd-2.106.0.tar.gz) = EHlknEGpuODT6BxXPILYTNaHOzr8lbN9b1IGhCztx8k= -SHA256 (phobos-2.106.0.tar.gz) = P5Ju4mkFwvb+RX560v5P6sjK2DxXGnCt6jC2zUpDZrY= -SIZE (dmd-2.106.0-bootstrap.tar.gz) = 10233808 -SIZE (dmd-2.106.0.tar.gz) = 5936389 -SIZE (phobos-2.106.0.tar.gz) = 2761012 +SHA256 (dmd-2.106.1-bootstrap.tar.gz) = kTaydzarj0/h54XfnTYRJ8G11ukH/DCilVEPc6EYcJw= +SHA256 (dmd-2.106.1.tar.gz) = KY4pM6TPh5M/c+jO1Sw09L6X6ISky2+V4xdU5iuhD8s= +SHA256 (phobos-2.106.1.tar.gz) = rPKie7N/GK/zALXziHXCrx27cgPe3cp/hws9aaeR8zM= +SIZE (dmd-2.106.1-bootstrap.tar.gz) = 19821871 +SIZE (dmd-2.106.1.tar.gz) = 5932908 +SIZE (phobos-2.106.1.tar.gz) = 2760300 Index: patches/patch-dmd-bootstrap_openbsd_bin32_dmd_conf =================================================================== RCS file: patches/patch-dmd-bootstrap_openbsd_bin32_dmd_conf diff -N patches/patch-dmd-bootstrap_openbsd_bin32_dmd_conf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-dmd-bootstrap_openbsd_bin32_dmd_conf 4 Jan 2024 23:19:47 -0000 @@ -0,0 +1,12 @@ +Use the bootstrap libphobos2.a when linking the initially built dmd. + +Index: dmd-bootstrap/openbsd/bin32/dmd.conf +--- dmd-bootstrap/openbsd/bin32/dmd.conf.orig ++++ dmd-bootstrap/openbsd/bin32/dmd.conf +@@ -1,5 +1,5 @@ + [Environment32] +-DFLAGS=-I${TRUEPREFIX}/include/dmd/phobos -I${TRUEPREFIX}/include/dmd/druntime/import -L-L/usr/lib -L-L${TRUEPREFIX}/lib -L--export-dynamic -fPIC ++DFLAGS=-I%@P%/../../../dmd/druntime/src -I%@P%/../../../phobos -L-L%@P%/../../../phobos/generated/openbsd/release/32 -L--export-dynamic -fPIC -L-L%@P%/../../../dmd-bootstrap/openbsd/lib32 + + [Environment64] + DFLAGS=-I${TRUEPREFIX}/include/dmd/phobos -I${TRUEPREFIX}/include/dmd/druntime/import -L-L/usr/lib -L-L${TRUEPREFIX}/lib -L--export-dynamic -fPIC Index: patches/patch-dmd_compiler_src_dmd_libmach_d =================================================================== RCS file: patches/patch-dmd_compiler_src_dmd_libmach_d diff -N patches/patch-dmd_compiler_src_dmd_libmach_d --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-dmd_compiler_src_dmd_libmach_d 4 Jan 2024 23:19:47 -0000 @@ -0,0 +1,20 @@ +This is always 64-bit. + +Index: dmd/compiler/src/dmd/libmach.d +--- dmd/compiler/src/dmd/libmach.d.orig ++++ dmd/compiler/src/dmd/libmach.d +@@ -484,7 +484,14 @@ struct MachObjModule + uint length; // in bytes + uint offset; // offset from start of library + const(char)[] name; // module name (file name) with terminating 0 ++version (OpenBSD) ++{ ++ long file_time; // file time ++} ++else ++{ + c_long file_time; // file time ++} + uint user_id; + uint group_id; + uint file_mode; Index: patches/patch-dmd_compiler_src_dmd_link_d =================================================================== RCS file: patches/patch-dmd_compiler_src_dmd_link_d diff -N patches/patch-dmd_compiler_src_dmd_link_d --- patches/patch-dmd_compiler_src_dmd_link_d 18 Dec 2023 22:20:58 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -Index: dmd/compiler/src/dmd/link.d ---- dmd/compiler/src/dmd/link.d.orig -+++ dmd/compiler/src/dmd/link.d -@@ -519,6 +519,12 @@ public int runLINK() - if (driverParams.dll) - argv.push("-shared"); - } -+ // No BT CFI -+ version (OpenBSD) -+ { -+ argv.push("-Wl,--no-execute-only"); -+ argv.push("-Wl,-z,nobtcfi"); -+ } - // None of that a.out stuff. Use explicit exe file name, or - // generate one from name of first source file. - argv.push("-o");