On Thu, 14 Feb 2019 at 11:13, Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote: > > Hi Iain, > > > On Tue, 29 Jan 2019 at 13:24, Rainer Orth <r...@cebitec.uni-bielefeld.de> > > wrote: > >> > >> Solaris ld only gained support for section bracketing in Solaris 11.4. > >> Fortunately, in gdc it is only used for the minfo section, so it's easy > >> to provide a workaround by adding two additional startup files > >> drt{begin,end}.o which define __start_minfo and __stop_minfo. > >> > >> This patch does just that. > >> > >> I've raised a couple of questions in the PR already: > >> > >> * I've introduced a new -dstartfiles option which triggers the use of > >> libgphobos.spec even with -nophoboslib. Since it's effectively > >> internal to the build system, I'm not currently documenting it. > >> > >> * I'm reading the spec file addition from a file: keeping it in a make > >> variable would be extremely messy due to the necessary quoting. > >> > >> * I've chosen to use -Wc instead of -Xcompiler throughout: it's way > >> shorter when more options need to be passed and it can take several > >> comma-separated options at once. > >> > >> * libdruntime/gcc/drtstuff.c needs a copyright notice unless one wants > >> to keep it in the public domain (also plausible). Effectively > >> something for Iain to decide. > >> > >> Bootstrapped without regressions on i386-pc-solaris2.11 (Solaris 11.3), > >> no regressions compared to Solaris 11.4 test results. > >> > >> Rainer > >> > >> -- > >> ----------------------------------------------------------------------------- > >> Rainer Orth, Center for Biotechnology, Bielefeld University > >> > >> > >> 2018-11-20 Rainer Orth <r...@cebitec.uni-bielefeld.de> > >> > >> libphobos: > >> PR d/87864 > >> * configure.ac [!DCFG_MINFO_BRACKETING] (DRTSTUFF_SPEC): New > >> variable. > >> Substitute it. > >> * libdruntime/m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING): > >> New automake conditional. > >> * configure: Regenerate. > >> * libdruntime/gcc/drtstuff.c: New file. > >> * libdruntime/Makefile.am [!DRUNTIME_OS_MINFO_BRACKETING] > >> (DRTSTUFF, toolexeclib_DATA): New variables. > >> (gcc/drtbegin.lo, gcc/drtend.lo): New rules. > >> (libgdruntime_la_LDFLAGS): Add -dstartfiles -Bgcc -B../src. > >> (libgdruntime_la_DEPENDENCIES): New variable. > >> * src/Makefile.am (libgphobos_la_LDFLAGS): Add -dstartfiles > >> -B../libdruntime/gcc. > >> * libdruntime/Makefile.in, src/Makefile.in: Regenerate. > >> * Makefile.in, testsuite/Makefile.in: Regenerate. > >> * libdruntime/rt/sections_elf_shared.d (Minfo_Bracketing): Don't > >> assert. > >> * src/drtstuff.spec: New file. > >> * src/libgphobos.spec.in (DRTSTUFF_SPEC): Substitute. > >> (*lib): Only pass SPEC_PHOBOS_DEPS without -debuglib, -defaultlib, > >> -nophoboslib. > >> * testsuite/testsuite_flags.in <--gdcldflags> (GDCLDFLAGS): Add > >> -B${BUILD_DIR}/libdruntime/gcc. > >> > >> * libdruntime/Makefile.am (unittest_static_LDFLAGS): Use -Wc > >> instead of -Xcompiler. > >> (libgdruntime_t_la_LDFLAGS): Likewise. > >> (unittest_LDFLAGS): Likewise. > >> * src/Makefile.am (unittest_static_LDFLAGS): Likewise. > >> (libgphobos_t_la_LDFLAGS): Likewise. > >> (unittest_LDFLAGS): Likewise. > >> > >> gcc/d: > >> PR d/87864 > >> * lang.opt (dstartfiles): New option. > >> * d-spec.cc (need_spec): New variable. > >> (lang_specific_driver) <OPT_dstartfiles>: Enable need_spec. > >> (lang_specific_pre_link): Also load libgphobos.spec if need_spec. > >> > >> gcc/testsuite: > >> PR d/87864 > >> * lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if > >> present. > >> > > > > I'd say go for it. I see that there's a tab that found its way into > > lib/gdc.exp, and there's a copyright notice that needs fixing up. > > that tab is both due the gcc convention (GCS actually) of using tabs > instead of 8 spaces, unlike D, and Emacs' tcl mode that follows it. > I've now fixed it up to be consistent with the rest of gdc.exp. >
I didn't know that applied to dejagnu test scripts. Feel free to re-tab the file so it's consistent, I only noticed because of the mixed 8 spaces/tabs. > For the drtstuff.c copyright notice, I've taken GPLv3+runtime exception, > just like the libgcc/crtstuff.c one where this snippet effectively comes > from. Since this file is gdc-only, I guess that's ok? > That's fine. There is no rationale for gdc-specific parts of the D runtime library to be under any other non-GPL license. > I'm running an i686-pc-linux-gnu bootstrap right now where this patch > should be a no-op, just to make sure again that it doesn't break > anything. Unless you see some error or there's a problem with the > choice of license, I'm going to check it in afterwards. > OK, thanks. -- Iain