From: David Blaikie <dblaikie@gmail.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>,
Eric Christopher <echristo@gmail.com>
Subject: Re: [patch] Fix unused static symbols so they're not dropped by clang
Date: Fri, 11 Apr 2014 20:16:00 -0000 [thread overview]
Message-ID: <CAENS6Es52Sa5WZ9n_az50hdC=hf3TKVtY=Obcoo25oYbEH3qZw@mail.gmail.com> (raw)
In-Reply-To: <CADPb22R9XT5VfiLW5mEdWfzmpa9n5SHKH3LXqSaa5eqyacA40w@mail.gmail.com>
On Fri, Apr 11, 2014 at 12:32 PM, Doug Evans <dje@google.com> wrote:
> On Fri, Apr 11, 2014 at 11:23 AM, Doug Evans <dje@google.com> wrote:
>> On Thu, Apr 10, 2014 at 11:51 PM, David Blaikie <dblaikie@gmail.com> wrote:
>>> Several tests used file-static functions and variables that were not
>>> referenced by the code. Even at -O0, clang omits these entities at the
>>> frontend so the tests fail.
>>>
>>> Since it doesn't look like these tests needed this functionality for
>>> what they were testing, I've modified the variables/functions to
>>> either be non-static, or marked them with __attribute__((used)).
>>>
>>> If it's preferred that I use the attribute more pervasively, rather
>>> than just making the entities non-static, I can provide a patch for
>>> that (or some other preferred solution). There's certainly precedent
>>> for both (non-static entities and __attribute__((used)) in the
>>> testsuite already and much more of the former than the latter).
>>>
>>> I have commit-after-review access, so just looking for sign-off here.
>>
>> Yikes.
>>
>> This is becoming more and more painful (not your fault of course!).
>> I can imagine this being a never ending source of regressions.
>>
>> Does clang perchance have a -O0-and-yes-I-really-mean-O0 option?
>
> Failing that,
>
> making the entries non-static without adding a comment to explain why
> things are the way they are will leave things in a more fragile state,
If people only ever test with GCC, yes. Though to a degree I'm happy
enough carrying the burden of providing patches to cleanup test cases
people commit that break clang. We're going to do this anyway for
other sources of breakage, I don't /think/ this particular kind of
breakage would be especially more egregious (possibly more common, but
providing a patch every few months doesn't sound like the end of the
world to me)
Though I agree that it's slightly subtle to make them non-static with
no comment.
> and if we're going to add a comment we might just as well use an
> attribute throughout I guess.
> However using the attribute is, technically, more complicated than
> that because we shouldn't unnecessarily break testing with other
> compilers.
While some test cases use #ifdefs, there are several test cases that
already use __attribute__((used)) unconditionally... so I'm not sure
if there's a problem adding more. But perhaps I misunderstand the
priority/need here.
> That suggests putting the attribute in a macro in a header protected
> by appropriate #ifdefs.
> The testsuite doesn't yet have a single location for such headers
> (testsuite/include or some such, though there is already testsuite/lib
> (cough) but if it's just for the one header ...).
next prev parent reply other threads:[~2014-04-11 20:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 6:51 David Blaikie
2014-04-11 7:03 ` pinskia
2014-04-11 18:23 ` Doug Evans
2014-04-11 19:32 ` Doug Evans
2014-04-11 20:16 ` David Blaikie [this message]
2014-04-11 20:17 ` David Blaikie
2014-04-12 4:00 ` Andrew Pinski
2014-04-13 7:11 ` David Blaikie
2014-04-14 22:56 ` Doug Evans
2014-04-15 3:24 ` David Blaikie
2014-04-23 21:50 ` Doug Evans
2014-04-25 5:36 ` David Blaikie
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='CAENS6Es52Sa5WZ9n_az50hdC=hf3TKVtY=Obcoo25oYbEH3qZw@mail.gmail.com' \
--to=dblaikie@gmail.com \
--cc=dje@google.com \
--cc=echristo@gmail.com \
--cc=gdb-patches@sourceware.org \
/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