From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74655 invoked by alias); 10 Nov 2016 20:02:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 74631 invoked by uid 89); 10 Nov 2016 20:02:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-ua0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=emuOJwybpV5Z8O1p6TBQB+iK4j0AUvSL2gmgkbPRHCo=; b=Gc4HnKHTSSOk8f6j+DbxwZS9J0rHs3WoMLkO21bpy89wHMMFX2YIswuhpclfwhl4B9 7nVJ8UoCaRek/uAL2lIMNA3UWhtH2QIzRS5bau+no6wFQ2WFwK8Hmf54OcqM6o4vtraI EN8jJ4aWDMDGQChZbRvOugzIqesOeFFMVSIq0tAEOO6cwuu8V6trQEsJYJxoLkcLY5y9 /Cu8b9CTYN1CNH/fG2MQgI7PPbvAovKAxbOQKLA3Mri+YCtkLjq0sjE92Ae/WxzM5V0b 3cHBwSrCw5wYvnEHBWMmbd7kEAdPud9ZlbXa8OkBvPB0nVpH5XJOumXtfP0wCpjsKCST sPYQ== X-Gm-Message-State: ABUngvfPymN92gm01TDxnwbxsp9ufUd9w6XhBhhzE0s4D377aaPoJCpwvVJawT8kBvLMDs81 X-Received: by 10.176.16.74 with SMTP id g10mr3892968uab.54.1478808147105; Thu, 10 Nov 2016 12:02:27 -0800 (PST) Subject: Re: [PATCH] Fix sh4 build with __ASSUME_ST_INO_64_BIT redefinition To: Joseph Myers References: <1478695312-5009-1-git-send-email-adhemerval.zanella@linaro.org> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <4141e110-eb7a-ea12-a5b8-c72290f89d8c@linaro.org> Date: Thu, 10 Nov 2016 20:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00420.txt.bz2 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.