From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8617 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: musl and kernel headers [was Re: system-images 1.4.2: od is broken; bzip2 is missing] Date: Tue, 6 Oct 2015 13:01:58 +0200 Message-ID: <20151006110158.GM10551@port70.net> References: <5612925A.4070402@landley.net> <20151006014426.GL8645@brightrain.aerifal.cx> <561330C1.8070205@landley.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1444129338 17047 80.91.229.3 (6 Oct 2015 11:02:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2015 11:02:18 +0000 (UTC) Cc: Rich Felker , Denys Vlasenko , Aboriginal Linux To: musl@lists.openwall.com Original-X-From: musl-return-8629-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 06 13:02:18 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZjQ0c-0004P8-V8 for gllmg-musl@m.gmane.org; Tue, 06 Oct 2015 13:02:15 +0200 Original-Received: (qmail 8191 invoked by uid 550); 6 Oct 2015 11:02:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 8173 invoked from network); 6 Oct 2015 11:02:10 -0000 Mail-Followup-To: musl@lists.openwall.com, Rich Felker , Denys Vlasenko , Aboriginal Linux Content-Disposition: inline In-Reply-To: <561330C1.8070205@landley.net> User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:8617 Archived-At: * Rob Landley [2015-10-05 21:24:01 -0500]: > On 10/05/2015 08:44 PM, Rich Felker wrote: > > On Mon, Oct 05, 2015 at 10:08:10AM -0500, Rob Landley wrote: > > The cleaner approach is just avoiding including both the kernel > > headers and libc/userspace headers for the same things in the same > > file. In theory this may be hard in some cases, but I find that I can > > almost always fix these sorts of errors during a build by commenting > > out one or two #include lines. > > I am _deeply_ curious how you'd get linux/loop.h on a platform where you > need the 32 bit loopback structure definition without including the > kernel header. I struggled with that one a lot back in the busybox days. in theory you can put all usage of the structure in a separate translation unit where you don't include any libc headers. (if you need libc api you can declare prototypes e.g. int ioctl(int, int,...); but if you need libc types there then you are in trouble). > (For the 64 bit version you can block copy the structure out of the > header into your program, just like you can block copy everything out of > headers and never actually #include anything, in the name of portability!) > > Sadly, the kernel headers are exported for a _reason_. If I need to > syscall something you haven't wrapped, I need the _NR_ and it varies per > target. It's a thing. > > Rob