From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SUBJ_OBFU_PUNCT_FEW autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23645 invoked from network); 1 Oct 2020 19:53:03 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 1 Oct 2020 19:53:03 -0000 Received: (qmail 18174 invoked by uid 550); 1 Oct 2020 19:53:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 18147 invoked from network); 1 Oct 2020 19:52:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJc6n7J9BQbGIPDfHST0UIzxn6TBz7z+s2UfbvXIFRE=; b=KhS7zqcj3kiX9syu3bz6eYyGQApOMzgk0JNVm98yQNpQPH5nZN3Dm9LprI1byYmfjG mMWdGOIotmfgrtDn9PXXEv6wMkC8oJDTb62Z4GabZz5Mp62IESH+yUkPP52GOqh3hf0T EcAwqApndo8bSOBWIkIU/AAhr98JN3hh6yVcwD8ILmlwgYjFbz9qAFnq+CdMrNr5R4RX Am4B3MuAOKeQZh8n/lA2/nlktaYTefrO9vKz21eXTdw0+msOYOPjE0GniHkFAJFSNOgP NTQFGYy1hFXr1p7TkwizzJIl95omw0ZNKq18Lnwkr7SrX+3XdV7yLX2cb3m7o8BH9Vq1 VgMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJc6n7J9BQbGIPDfHST0UIzxn6TBz7z+s2UfbvXIFRE=; b=j9py1HLPwzaM+gHCYml3JyzcdPGx9jKxgACQGdDC+tNYaAoIVDD54zW4YnzVxNhUi3 jTtrFPiZWGWhplcmXw9W4R4on90OOwY25MLzS1b7VKztZ009pFOm5no7gUPX/GgsqYh3 6VgjIocw3X+lU52aMwrpbrAiepa8ArI0jHiwQK4LFAzldS+1B0hhI3WcXzDTRqqnZZdm knKkweNaYovqpXf7838vAzltsZtOoOrRLZlX0vqRLpIh3gaVhREhzZsbYBqAcNqNFjM8 AxC732m+xOmCBB3Pw+C+DbMvzdWG8n/5MTbCOjVIe38W2u9jMKxVU0CD/Qgn8FyG4Shs g8mw== X-Gm-Message-State: AOAM531AUEt8IktFKb4P0gxyxb0W7suIJOQBZimqZ4KTm2A48A9av3wE rKmyGGSQpxcvjWoZh46zxag= X-Google-Smtp-Source: ABdhPJwrqilKtnbwHnlpFsAI1/LHcHpR2zkDVvpGWVT4AWBa0cBmXi7MfQjKytkpgKTcRoJVSkbCXA== X-Received: by 2002:a5d:40cd:: with SMTP id b13mr10840302wrq.297.1601581968344; Thu, 01 Oct 2020 12:52:48 -0700 (PDT) From: Petr Vorel To: linux-kernel@vger.kernel.org Cc: Petr Vorel , Rich Felker , musl@lists.openwall.com, linux-api@vger.kernel.org, libc-alpha@sourceware.org, Peter Korsgaard , Florian Weimer , Baruch Siach , "David S . Miller" , Michal Kubecek , Stephen Hemminger Date: Thu, 1 Oct 2020 21:52:31 +0200 Message-Id: <20201001195231.17226-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH 1/1] uapi: Don't include in + update code where needed (include in code which included only to get struct sysinfo or SI_LOAD_SHIFT). The reason is to avoid indirect include when using some network headers: or others [1] -> -> . This indirect include causes redefinition of struct sysinfo when included both and some of network headers: In file included from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5, from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5, from ../include/tst_netlink.h:14, from tst_crypto.c:13: x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: redefinition of ‘struct sysinfo’ struct sysinfo { ^~~~~~~ In file included from ../include/tst_safe_macros.h:15, from ../include/tst_test.h:93, from tst_crypto.c:11: x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here [1] or , , , Suggested-by: Rich Felker Signed-off-by: Petr Vorel --- Hi, this looks to be long standing problem: python-psutil [2], iproute2 [3], even for glibc in the past [4] and it tried to be solved before [5]. This will require glibc fix after: +++ sysdeps/unix/sysv/linux/sys/sysinfo.h @@ -21,7 +21,7 @@ #include /* Get sysinfo structure from kernel header. */ -#include +#include __BEGIN_DECLS Kind regards, Petr [2] https://git.buildroot.net/buildroot/commit/?id=ab930190d7754b7f5fdda115b2069d00f1320861 [3] http://patchwork.ozlabs.org/project/netdev/patch/602128d22db86bd67e11dec8fe40a73832c222c9.1559230347.git.baruch@tkos.co.il/ [4] https://www.mail-archive.com/busybox@busybox.net/msg15363.html [5] https://lore.kernel.org/patchwork/patch/449607/ drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- fs/eventpoll.c | 2 +- fs/proc/meminfo.c | 2 +- include/linux/mm.h | 1 + include/uapi/linux/kernel.h | 2 -- kernel/debug/kdb/kdb_main.c | 2 +- kernel/sys.c | 2 +- mm/page_alloc.c | 2 +- net/ipv4/inetpeer.c | 2 +- net/rds/ib_recv.c | 2 +- 10 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 8062bd99add8..6c84c92e5112 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -43,7 +43,7 @@ * USA. */ -#include +#include #include #include #include diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 8107e06d7f6f..a4c2e199f9ea 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 887a5532e449..c80e42e1eaf9 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include -#include +#include #include #include #include diff --git a/include/linux/mm.h b/include/linux/mm.h index b2f370f0b420..4ac1af86db59 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -7,6 +7,7 @@ #ifdef __KERNEL__ #include +#include #include #include #include diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h index 0ff8f7477847..e95f8cd801cd 100644 --- a/include/uapi/linux/kernel.h +++ b/include/uapi/linux/kernel.h @@ -2,8 +2,6 @@ #ifndef _UAPI_LINUX_KERNEL_H #define _UAPI_LINUX_KERNEL_H -#include - /* * 'kernel.h' contains some often-used function prototypes etc */ diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 5c7949061671..3193b9dd90e8 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kernel/sys.c b/kernel/sys.c index ab6c409b1159..9a3ee7ba84a7 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fab5e97dc9ca..42e14c5392a6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index ff327a62c9ce..1c7385dab1c4 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 694d411dc72f..81425a2863e0 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c @@ -30,7 +30,7 @@ * SOFTWARE. * */ -#include +#include #include #include #include -- 2.28.0