All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Jayant Chowdhary <jchowdhary@google.com>, linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, kernel-team@android.com,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] uapi: Make generic uapi headers compile standalone.
Date: Thu, 7 Jun 2018 17:07:01 -0700	[thread overview]
Message-ID: <b6b6dd56-c948-54e8-df95-3d170a3c1e7d@infradead.org> (raw)
In-Reply-To: <20180606231602.231326-1-jchowdhary@google.com>

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

On 06/06/2018 04:16 PM, Jayant Chowdhary wrote:
> In order for static analysis tools to analyze each of the uapi headers,
> we need to enable them to compile stand-alone. Some uapi headers were
> missing dependencies which would not make them compile stand-alone in
> user-land. This patch adds those dependencies.

Hi,

Thanks for getting started on this.  I see that the kbuild robot and I were
still not able to do successful builds even after this patch is applied.
We were building different targets though.  robot was doing kernel builds
and I was doing a large "all-uapi" build.

I started on my all-uapi work about 1 week ago but haven't posted anything yet,
but it's posted (attached) below.  It's not yet up to kernel quality yet (for a
Makefile), and I have made very little progress toward a successful userspace build.

If anyone is interested, just put these 3 files in <kernel_tree>/tools/build
and then run:

make ARCH=$some_arch O=build_dir headers_check
so that the headers will be cleaned up and installed in build_dir/usr/.

Then run 'make -f all-uapi.mk'
and the userspace program with all header files found in build_dir/usr/include
will be built -- i.e., attempted (not successfully).

(note: chmod +x hdr-fix-lines.pl)


-- 
~Randy

[-- Attachment #2: all-uapi.mk --]
[-- Type: text/x-makefile, Size: 581 bytes --]

# all-uapi.mk
# currently resides in tools/build/
#
# before running 'make -f all-uapi.mk',
# run (from top of kernel tree): make ARCH=arch O=dir headers_check
# so that the uapi headers will be installed.

srctree=../..
CC=gcc

all: all-uapi.h all-uapi.o

all-uapi.h: all-uapi.mk hdr-fix-lines.pl
	rm -f all-uapi.h
	touch all-uapi.h
#	find $(srctree)/xx64/usr/include/uapi -type f | grep -v \\.orig |
	find $(srctree)/xx64/usr/include -type f | grep -v \\.orig | \
		./hdr-fix-lines.pl >>all-uapi.h

all-uapi.o: all-uapi.h
	$(CC) -I../../xx64/usr/include all-uapi.c -o all-uapi.o

[-- Attachment #3: all-uapi.c --]
[-- Type: text/x-csrc, Size: 316 bytes --]

// SPDX GPL 2.0
// This userspace source file pulls in all #include <uapi/*> header files
// to see what kinds of problems happen.

#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>

#include <linux/posix_types.h>
#include <asm-generic/ipcbuf.h>

#include "all-uapi.h"

int main(int argc, char *argv[])
{
}

[-- Attachment #4: hdr-fix-lines.pl --]
[-- Type: application/x-perl, Size: 487 bytes --]

  parent reply	other threads:[~2018-06-08  0:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 23:16 [PATCH] uapi: Make generic uapi headers compile standalone Jayant Chowdhary
2018-06-07  4:58 ` Masahiro Yamada
2018-06-08  1:14   ` Jayant Chowdhary
2018-06-07 20:05 ` kbuild test robot
2018-06-07 20:05   ` kbuild test robot
2018-06-07 21:26 ` kbuild test robot
2018-06-07 21:26   ` kbuild test robot
2018-06-07 22:37 ` kbuild test robot
2018-06-07 22:37   ` kbuild test robot
2018-06-08  0:07 ` Randy Dunlap [this message]
2018-06-08 18:36   ` Jayant Chowdhary
2018-06-08 20:48     ` Randy Dunlap
2018-06-08  2:11 ` kbuild test robot
2018-06-08  2:11   ` kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2018-06-06 22:37 Jayant Chowdhary

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=b6b6dd56-c948-54e8-df95-3d170a3c1e7d@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=jchowdhary@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.