public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gdcproject.org>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Provide __start_minfo/__stop_minfo for linkers that don't (PR d/87864)
Date: Thu, 14 Feb 2019 18:12:00 -0000	[thread overview]
Message-ID: <CABOHX+dXcOpAeKR6DUqAoMWnEZ2eLyqqAxPSAN7eRQ=LsdmfCA@mail.gmail.com> (raw)
In-Reply-To: <yddpnruoeys.fsf@CeBiTec.Uni-Bielefeld.DE>

On Thu, 14 Feb 2019 at 11:13, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Iain,
>
> > On Tue, 29 Jan 2019 at 13:24, Rainer Orth <ro@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  <ro@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

  reply	other threads:[~2019-02-14 18:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 12:35 Rainer Orth
2019-01-31 18:17 ` Johannes Pfau
2019-02-01 13:40   ` Rainer Orth
2019-02-13 20:17 ` Iain Buclaw
2019-02-14 10:13   ` Rainer Orth
2019-02-14 18:12     ` Iain Buclaw [this message]
2019-02-18 13:55       ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABOHX+dXcOpAeKR6DUqAoMWnEZ2eLyqqAxPSAN7eRQ=LsdmfCA@mail.gmail.com' \
    --to=ibuclaw@gdcproject.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).