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=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11996 invoked from network); 2 Nov 2020 08:04:36 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 2 Nov 2020 08:04:36 -0000 Received: (qmail 3438 invoked by uid 550); 2 Nov 2020 08:04:30 -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 3420 invoked from network); 2 Nov 2020 08:04:30 -0000 Date: Mon, 2 Nov 2020 09:04:16 +0100 From: Szabolcs Nagy To: Chen Wang Cc: musl Message-ID: <20201102080416.GB1370092@port70.net> Mail-Followup-To: Chen Wang , musl References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] [Question] some =?utf-8?Q?quest?= =?utf-8?Q?ions_about_kernel_header_files_for_musl=EF=BC=9F?= * Chen Wang [2020-11-02 15:44:38 +0800]: > hi, I'm a newbie learning msul, I have some questions about kernel header files for musl. Appreciated if anybody can answer my quesitons, thanks in adv. > > Q1) What's the rule to pick up kernel header files for musl? Do we need to catch up the latest kernel when the kernel is upgraded? What version of kernel is musl currently in usage? musl can be built without linux headers. you can use whatever linux version to build your toolchain, but recent ones (e.g. linux v5.*) will have less issues when libc and linux headers are included together in some code. > Q2) I see duplicated headers files in different folders, for example: unistd.h, I see it under both "include/unistd.h" and "src/include/unistd.h". Why we need multiple copies? Are they used for different purpose? src/* is musl internal, it is only used for building musl. > Q3) For different arch, such as arm/x86/riscv, do they share the same kernel header files? I double checked android bionic and found it has different kernel header files for differnet arch. musl does not use linux headers. it uses its own target specific definitions see arch/*/bits/*.h, an installed header set is only valid for one arch because the bits/ directory is arch specific. linux headers are similar: different targets cannot share the same headers because the asm/ directory is arch specific.