From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Fix sh4 build with __ASSUME_ST_INO_64_BIT redefinition
Date: Thu, 10 Nov 2016 20:02:00 -0000 [thread overview]
Message-ID: <4141e110-eb7a-ea12-a5b8-c72290f89d8c@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1611101759240.26763@digraph.polyomino.org.uk>
On 10/11/2016 16:07, Joseph Myers wrote:
> On Wed, 9 Nov 2016, Adhemerval Zanella wrote:
>
>> It is because sh4 kernel-features.sh is included multiple times
>> without guards and this patch fixes by adding them. Tested on a
>> sh4-linux-gnu build.
>>
>> Also with this issues, is there are strong reason to *not* have include guards
>> on kernel-features.h? With current approach, a architecture can't include
>> Linux default kernel-features.h and redefine it to a different value, only
>> undefine it (unless it explicit do not include default kernel-features.h,
>> and I think that's is not the idea).
>>
>> * sysdeps/unix/sysv/linux/sh/kernel-features.h: Add include
>> guards.
>
> OK. I think it's appropriate for all these headers to have include
> guards.
Ok, I will push this patch.
>
> The #ifndef, #undef etc. could be avoided (moving this header closer to
> glibc's macro-name-typo-proof norms in this regard) if the header were
> split up into smaller pieces for individual macros or groups of related
> macros whenever a macro's definition needs to vary between architectures.
> Thus, you'd have e.g. kernel-features-st-ino.h defining
> __ASSUME_ST_INO_64_BIT to either 0 or 1, the default version of that
> header would define to 0 and the architectures overriding it would define
> to 1 (and wouldn't need #include_next). kernel-features.h could end up as
> an architecture-independent header that just #includes the smaller
> architecture-specific headers. (This is not a full design, especially for
> the more complicated cases such as socket syscalls.)
This could be a feasible approach, although it would require some extensive
refactoring. But I think we current approach, where architecture
kernel-feature is used from sysdep and it is responsible to include default
linux one and undef and redefine value, plus guards should be also feasible
for macro-name-typo-proof as well.
prev parent reply other threads:[~2016-11-10 20:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 12:42 Adhemerval Zanella
2016-11-10 18:07 ` Joseph Myers
2016-11-10 20:02 ` Adhemerval Zanella [this message]
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=4141e110-eb7a-ea12-a5b8-c72290f89d8c@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).