2015-02-16 23:06:05

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH RFC v02 00/45] Compile test and fixes for exported header files

v2:
added cross compiler support with CROSS_COMPILE,
detecting libc and GCC headers from compiler,
more header file fixes

v1:
https://lkml.org/lkml/2014/8/21/665

Users of kernel header files would be happier if they did not contain
kernel specific parts and would contain #include statements for all
other header files that they depend on, and in general would compile.

This patch set fixes some headers_install issues, then introduces a
compile test for headers exported to userspace and then fixes many of the
userspace header compilation failures.

Changes are also available in headers_test_v02 branch at github:
https://github.com/mcfrisk/linux/tree/headers_test_v02

Mikko Rapeli (45):
Makefile: propagate verbose options
scripts/headers.sh: add verbose option to make calls if defined
headers_install.sh: enhance error handling
scripts/headers_compile_test.sh: compile test script for exported
headers
drm.h: include stdlib.h in userspace
drm_mode.h: include stdint.h and linux/types.h in userspace
exynos_drm.h: include stdint.h in userspace
nouveau_drm.h: include stdint.h in userspace
radeon_drm.h: include stdint.h in userspace
r128_drm.h: include drm/drm.h
via_drm.h: include linux/types.h instead of non-existing
via_drmclient.h
via_drm.h: hide struct via_file_private in userspace
savage_drm.h: include <drm/drm.h>
sis_drm.h: hide sis_file_private in userspace
dm-log-userspace.h: include stdint.h in userspace
hsi_char.h: include stdint.h in userspace
ebtables.h: include stdint.h in userspace
cld.h: include stdint.h in userspace
rds.h: include stdint.h in userspace
sctp.h: include stdint.h in userspace
scsi_bsg_fc.h: include stdint.h in userspace
scsi_netlink.h: include stdint.h in userspace
scsi_netlink_fc.h: include stdint.h in userspace
hdspm.h: include stdint.h in userspace
gntalloc.h: include stdint.h in userspace
gntdev.h: include stdint.h in userspace
include/uapi/linux/sysctl.h: include stdlib.h in userspace
include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h
include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h
include/uapi/asm-generic/shmbuf.h: include fixes
asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h
drm/i810_drm.h: include drm/drm.h
include/uapi/asm-generic/signal.h: include stdlib.h in userspace
include/uapi/asm-generic/signal.h: hide sigset_t definition in
userspace
include/uapi/sound/asound.h: include stdlib.h in userspace
include/uapi/linux/netfilter.h: include in.h and in6.h
include/uapi/linux/socket.h: include sys/socket.h in userspace
include/uapi/linux/agpgart.h: include stdlib.h in userspace
include/uapi/sound/asequencer.h: include sound/asound.h
include/uapi/sound/emu10k1.h: include sound/asound.h
include/uapi/sound/emu10k1.h: hide gpr_valid, tram_valid and
code_valid in userspace
include/uapi/linux/rds.h: include linux/socket.h and linux/types.h
always
include/uapi/linux/netfilter_bridge.h: include if.h
nf_conntrack_tuple_common.h: include linux/types.h and
linux/netfilter.h
include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

Makefile | 8 +-
include/uapi/asm-generic/ipcbuf.h | 2 +
include/uapi/asm-generic/msgbuf.h | 2 +
include/uapi/asm-generic/sembuf.h | 2 +
include/uapi/asm-generic/shmbuf.h | 6 +
include/uapi/asm-generic/signal.h | 7 +
include/uapi/asm-generic/ucontext.h | 3 +
include/uapi/drm/drm.h | 4 +
include/uapi/drm/drm_mode.h | 5 +
include/uapi/drm/exynos_drm.h | 5 +
include/uapi/drm/i810_drm.h | 2 +
include/uapi/drm/nouveau_drm.h | 6 +
include/uapi/drm/r128_drm.h | 2 +
include/uapi/drm/radeon_drm.h | 5 +
include/uapi/drm/savage_drm.h | 2 +
include/uapi/drm/sis_drm.h | 2 +
include/uapi/drm/via_drm.h | 6 +-
include/uapi/linux/agpgart.h | 1 +
include/uapi/linux/dm-log-userspace.h | 5 +
include/uapi/linux/hsi/hsi_char.h | 7 +-
include/uapi/linux/netfilter.h | 3 +-
.../linux/netfilter/nf_conntrack_tuple_common.h | 3 +
include/uapi/linux/netfilter_bridge.h | 1 +
include/uapi/linux/netfilter_bridge/ebtables.h | 5 +
include/uapi/linux/nfsd/cld.h | 6 +
include/uapi/linux/rds.h | 4 +
include/uapi/linux/sctp.h | 4 +
include/uapi/linux/socket.h | 4 +
include/uapi/linux/sysctl.h | 4 +
include/uapi/scsi/scsi_bsg_fc.h | 6 +
include/uapi/scsi/scsi_netlink.h | 6 +-
include/uapi/scsi/scsi_netlink_fc.h | 5 +
include/uapi/sound/asequencer.h | 1 +
include/uapi/sound/asound.h | 3 +
include/uapi/sound/emu10k1.h | 9 +-
include/uapi/sound/hdspm.h | 6 +
include/uapi/xen/gntalloc.h | 6 +
include/uapi/xen/gntdev.h | 6 +
scripts/headers.sh | 2 +-
scripts/headers_compile_test.sh | 143 +++++++++++++++++++++
scripts/headers_install.sh | 15 ++-
41 files changed, 306 insertions(+), 18 deletions(-)
create mode 100755 scripts/headers_compile_test.sh

--
2.1.4


2015-02-16 23:06:08

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 01/45] Makefile: propagate verbose options

Usefull when debugging the make scripts.

Signed-off-by: Mikko Rapeli <[email protected]>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 4e93284..c1b515d 100644
--- a/Makefile
+++ b/Makefile
@@ -912,13 +912,13 @@ quiet_cmd_link-vmlinux = LINK $@
# execute if the rest of the kernel build went well.
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_HEADERS_CHECK
- $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
+ $(Q)$(MAKE) V=$(KBUILD_VERBOSE) -f $(srctree)/Makefile headers_check
endif
ifdef CONFIG_SAMPLES
- $(Q)$(MAKE) $(build)=samples
+ $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=samples
endif
ifdef CONFIG_BUILD_DOCSRC
- $(Q)$(MAKE) $(build)=Documentation
+ $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=Documentation
endif
+$(call if_changed,link-vmlinux)

@@ -1069,7 +1069,7 @@ headers_check_all: headers_install_all
PHONY += headers_check
headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
- $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
+ $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Kernel selftest
--
2.1.4

2015-02-16 23:06:18

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 02/45] scripts/headers.sh: add verbose option to make calls if defined

Useful when debugging the scripts.

Signed-off-by: Mikko Rapeli <[email protected]>
---
scripts/headers.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/headers.sh b/scripts/headers.sh
index 95ece06..aa62fd8 100755
--- a/scripts/headers.sh
+++ b/scripts/headers.sh
@@ -7,7 +7,7 @@ set -e
do_command()
{
if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
- make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
+ make V=$KBUILD_VERBOSE ARCH=$2 KBUILD_HEADERS=$1 headers_$1
else
printf "Ignoring arch: %s\n" ${arch}
fi
--
2.1.4

2015-02-16 23:06:21

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 03/45] headers_install.sh: enhance error handling

Exit with error if using undefined variables or if any sub command fails
with error return value. unidef needs special handling since but this can
be done without the trap. Enables exaniming intermediate files if some
commands failed.

Signed-off-by: Mikko Rapeli <[email protected]>
---
scripts/headers_install.sh | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index fdebd66..072f7d3 100755
--- a/scripts/headers_install.sh
+++ b/scripts/headers_install.sh
@@ -1,4 +1,7 @@
#!/bin/sh
+set -e
+set -u
+#set -x

if [ $# -lt 2 ]
then
@@ -26,7 +29,6 @@ shift
# Iterate through files listed on command line

FILE=
-trap 'rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed"' EXIT
for i in "$@"
do
FILE="$(basename "$i")"
@@ -37,10 +39,13 @@ do
-e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
-e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
-e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
- "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
+ "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || \
+ ( rm -f "$OUTDIR/$FILE.sed" ; exit 1 )
scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
- > "$OUTDIR/$FILE"
- [ $? -gt 1 ] && exit 1
+ > "$OUTDIR/$FILE" || \
+ ( if [ $? -gt 1 ]; then \
+ rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed" ; \
+ exit 1 ; \
+ fi )
rm -f "$OUTDIR/$FILE.sed"
done
-trap - EXIT
--
2.1.4

2015-02-16 23:06:32

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 04/45] scripts/headers_compile_test.sh: compile test script for exported headers

Users of kernel header files would be happier if they did not contain
kernel specific parts and would contain #include statements for all
other header files that they depend on, and in general would compile.

For each header file exported to userspace, this script creates
a simple .c file which just includes the header file. Then it
tries to compile it together with minimal header files from GCC
and libc, and reports results.

Default libc and GCC header file locations are parsed from compiler
configuration.

Kernel headers depend on GCC headers so their path is included in
the test compiler command line.

Some gcc and kernel headers depend on libc headers which are made available
by copying from the compiler default location to a temporary location and
removing possibly existing kernel headers from this directory. This is a bit
of a hack but seems to work in multiple environments.

Tested natively on:

Debian unstable, i586-linux-gnu and gcc 4.9.2
Raspbian Wheezy, arm-linux-gnueabihf and gcc 4.6.3
Ubuntu 12.04 LTS, x86_64-linux-gnu and gcc 4.6.3

Tested cross compilation using standard CROSS_COMPILE=/path/to/gcc with:

arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)

Execute the script in the directory where kernel header files are installed.
For example:

$ make headers_install
$ cd usr/include
$ ../../scripts/headers_compile_test.sh

Example statistics from 3.18.4 kernel:

130 files failed the compile test.
609 files passed the compile test.

Example error types from 3.18.4 kernel:

$ ../../scripts/headers_compile_test.sh 2>&1 | \
grep error: | sed -e 's/.*error://g' | sort | uniq -c | sort -rn

352 unknown type name ‘uint32_t’
134 unknown type name ‘uint64_t’
103 unknown type name ‘size_t’
43 unknown type name ‘__kernel_ulong_t’
38 unknown type name ‘uint8_t’
24 unknown type name ‘int32_t’
22 field ‘addr’ has incomplete type
18 field ‘tstamp’ has incomplete type
16 unknown type name ‘__kernel_time_t’
16 field ‘in’ has incomplete type
16 field ‘in6’ has incomplete type
14 unknown type name ‘__be16’
13 ‘IFNAMSIZ’ undeclared here (not in a function)
12 unknown type name ‘uint16_t’
9 field ‘ifru_netmask’ has incomplete type
9 field ‘ifru_hwaddr’ has incomplete type
9 field ‘ifru_dstaddr’ has incomplete type
9 field ‘ifru_broadaddr’ has incomplete type
9 field ‘ifru_addr’ has incomplete type
8 unknown type name ‘__kernel_pid_t’
7 unknown type name ‘u_short’
7 unknown type name ‘pid_t’
6 invalid application of ‘sizeof’ to incomplete type ‘struct timespec’
6 field ‘src’ has incomplete type
6 field ‘audio_tstamp’ has incomplete type
6 array type has incomplete element type
5 unknown type name ‘__kernel_long_t’
5 requested alignment is not an integer constant
5 field ‘smsk’ has incomplete type
4 unknown type name ‘__kernel_uid32_t’
4 unknown type name ‘__kernel_gid32_t’
4 ‘ETH_ALEN’ undeclared here (not in a function)
3 unknown type name ‘int64_t’
3 unknown type name ‘caddr_t’
3 ‘IPSET_ERR_TYPE_SPECIFIC’ undeclared here (not in a function)
3 field ‘trigger_tstamp’ has incomplete type
3 field ‘src_addr’ has incomplete type
3 field ‘sin_addr’ has incomplete type
3 field ‘laddr’ has incomplete type
3 field ‘id’ has incomplete type
3 field ‘dmsk’ has incomplete type
3 field ‘bssid’ has incomplete type
3 expected specifier-qualifier-list before ‘uint64_t’
2 unknown type name ‘u_long’
2 unknown type name ‘stack_t’
2 unknown type name ‘sigset_t’
2 unknown type name ‘sa_family_t’
2 unknown type name ‘__kernel_mode_t’
2 unknown type name ‘__kernel_key_t’
2 unknown type name ‘elf_gregset_t’
2 unknown type name ‘bool’
2 ‘uint64_t’ undeclared here (not in a function)
2 ‘true’ undeclared (first use in this function)
2 ‘NAME_MAX’ undeclared here (not in a function)
2 ‘__kernel_mode_t’ undeclared here (not in a function)
2 invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’
2 field ‘uc_mcontext’ has incomplete type
2 field ‘tmsk’ has incomplete type
2 field ‘tgt’ has incomplete type
2 field ‘shm_perm’ has incomplete type
2 field ‘sem_perm’ has incomplete type
2 field ‘raddr’ has incomplete type
2 field ‘msg_perm’ has incomplete type
2 field ‘grp’ has incomplete type
2 field ‘dst’ has incomplete type
2 field ‘dst_addr’ has incomplete type
2 field ‘arp_pa’ has incomplete type
2 field ‘arp_netmask’ has incomplete type
2 field ‘arp_ha’ has incomplete type
2 ‘false’ undeclared (first use in this function)
1 xen/interface/xen.h: No such file or directory
1 via_drmclient.h: No such file or directory
1 unknown type name ‘wait_queue_head_t’
1 unknown type name ‘snd_seq_client_type_t’
1 unknown type name ‘int16_t’
1 unknown type name ‘ino_t’
1 unknown type name ‘elf_greg_t’
1 unknown type name ‘elf_fpxregset_t’
1 unknown type name ‘elf_fpregset_t’
1 unknown type name ‘__be32’
1 ‘SIOCDEVPRIVATE’ undeclared here (not in a function)
1 ‘sa_family_t’ undeclared here (not in a function)
1 ‘NULL’ undeclared (first use in this function)
1 ‘MSG_FIN’ undeclared here (not in a function)
1 ‘MAX_IPOPTLEN’ undeclared here (not in a function)
1 ‘MAX_ADDR_LEN’ undeclared here (not in a function)
1 ‘IFHWADDRLEN’ undeclared here (not in a function)
1 field ‘vmask’ has incomplete type
1 field ‘vifc_rmt_addr’ has incomplete type
1 field ‘vifc_lcl_addr’ has incomplete type
1 field ‘vaddr’ has incomplete type
1 field ‘uc_chain’ has incomplete type
1 field ‘tgt_ip’ has incomplete type
1 field ‘tcp’ has incomplete type
1 field ‘sw_reserved’ has incomplete type
1 field ‘sspp_addr’ has incomplete type
1 field ‘ssp_addr’ has incomplete type
1 field ‘src_mask’ has incomplete type
1 field ‘src_ip’ has incomplete type
1 field ‘spt_address’ has incomplete type
1 field ‘spp_address’ has incomplete type
1 field ‘spinfo_address’ has incomplete type
1 field ‘spc_aaddr’ has incomplete type
1 field ‘sas_obs_rto_ipaddr’ has incomplete type
1 field ‘saddr’ has incomplete type
1 field ‘rtmsg_src’ has incomplete type
1 field ‘rtmsg_gateway’ has incomplete type
1 field ‘rtmsg_dst’ has incomplete type
1 field ‘rt_genmask’ has incomplete type
1 field ‘rt_gateway’ has incomplete type
1 field ‘rt_dst’ has incomplete type
1 field ‘real’ has incomplete type
1 field ‘prefix’ has incomplete type
1 field ‘obj_list’ has incomplete type
1 field ‘mfcc_origin’ has incomplete type
1 field ‘mfcc_mcastgrp’ has incomplete type
1 field ‘mf6cc_origin’ has incomplete type
1 field ‘mf6cc_mcastgrp’ has incomplete type
1 field ‘mask’ has incomplete type
1 field ‘ival2’ has incomplete type
1 field ‘ival1’ has incomplete type
1 field ‘iph’ has incomplete type
1 field ‘ip’ has incomplete type
1 field ‘im_src’ has incomplete type
1 field ‘im_dst’ has incomplete type
1 field ‘im6_src’ has incomplete type
1 field ‘im6_dst’ has incomplete type
1 field ‘gw’ has incomplete type
1 field ‘expected’ has incomplete type
1 field ‘dst_mask’ has incomplete type
1 field ‘dest_addr’ has incomplete type
1 field ‘daddr’ has incomplete type
1 field ‘ap_addr’ has incomplete type
1 field ‘a6’ has incomplete type
1 field ‘a4’ has incomplete type
1 expected specifier-qualifier-list before ‘DECLARE_BITMAP’
1 expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘snd_seq_client_type_t’
1 #error "patchkey.h included directly"
1 ‘DLM_RESNAME_MAXLEN’ undeclared here (not in a function)

Signed-off-by: Mikko Rapeli <[email protected]>
---
scripts/headers_compile_test.sh | 143 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 143 insertions(+)
create mode 100755 scripts/headers_compile_test.sh

diff --git a/scripts/headers_compile_test.sh b/scripts/headers_compile_test.sh
new file mode 100755
index 0000000..9a73945
--- /dev/null
+++ b/scripts/headers_compile_test.sh
@@ -0,0 +1,143 @@
+#!/bin/bash
+# bash due to arithmetics and pipefail
+set -euo pipefail
+
+# Debugging
+#set -x
+
+echo Simple compile test for header files meant for userspace.
+
+# sanity test
+if [ ! -d ./linux ]; then
+ echo Sanity check error: ./linux directory not found
+ echo Should be called in usr/include after \'make headers_install\'.
+ echo Returns number of failed files, 0 if none.
+ exit 1
+fi
+
+# Support CC variable for compiler and ccache, and cross compiling.
+# CC is used without quotes to support CC="ccache gcc".
+set +u
+if [ "$CC"foobar == "foobar" ]; then
+ CC=cc
+fi
+
+if [ "$CROSS_COMPILE"foobar != "foobar" ]; then
+ # Using gcc name since some cross compiler tool chains don't provide
+ # the cc symlink
+ CC="$CROSS_COMPILE"gcc
+fi
+set -u
+
+# Kernel headers refer to some gcc and libc headers so make them available.
+set +u
+if [ "$ARCH_TRIPLET"foobar == "foobar" ]; then
+ # Taking triplet from gcc/cpp
+ ARCH_TRIPLET="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+ grep Target | sed -e 's/Target: //' )"
+fi
+
+if [ "$LIBC"foobar == "foobar" ]; then
+ # trying to grep libc includes from gcc/cpp defaults
+ _TEMP="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+ sed -n -e '/^#include <...> search starts here:$/,/^End of search list.$/{//!p}' | \
+ sed -e 's/^\ \//\//g' | \
+ grep '/usr/include' )"
+
+ # sanity check and prepare LIBC dirs
+ for d in $_TEMP; do
+ if [ ! -d "$d" ]; then
+ echo "$d not a directory"
+ exit 1
+ fi
+ LIBC="$LIBC $d"
+ done
+fi
+set -u
+
+# Copy libc include files to temp directory for the tests.
+
+COMPILE_TEST_INC=../headers_compile_test_include
+rm -rf "$COMPILE_TEST_INC"
+mkdir -p "$COMPILE_TEST_INC"
+
+for d in $LIBC; do
+ # check if last part of dir is the arch triplet, cross compile paths
+ # can have it also elsewhere so just the last one counts.
+ if !( echo "$d" | egrep "$ARCH_TRIPLET$" > /dev/null ); then
+ # hopefully just main libc dir, e.g. /usr/include
+ cp -a "$d"/* "$COMPILE_TEST_INC"/
+ elif ( echo "$d" | egrep "$ARCH_TRIPLET$" > /dev/null ); then
+ # hopefully the arch specific dir, e.g. /usr/include/x86_64-linux-gnu
+ cp -ar "$d"/* "$COMPILE_TEST_INC/"
+ else
+ echo "$d unexpected, bailing out"
+ exit 1
+ fi
+done
+
+# Simulate libc headers without kernel headers by removing
+# all known kernel header dirs from the copied libc ones.
+# This seems to magically work.
+_KERNEL_DIRS="$( find . -type d | grep -v '^\.$' )"
+( cd "$COMPILE_TEST_INC" && rm -rf $_KERNEL_DIRS )
+
+# GCC headers
+set +u
+if [ "$GCC_INC"foobar == "foobar" ]; then
+ # Take from $CC default system include paths, filter out
+ # /usr/local/include and /usr/include stuff first, then try to match
+ # for gcc.
+ _TEMP="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+ sed -n -e '/^#include <...> search starts here:$/,/^End of search list.$/{//!p}' | \
+ sed -e 's/^\ \//\//g' | \
+ egrep -v '/usr/local/include' | \
+ egrep -v '/usr/include' | \
+ grep gcc | \
+ xargs )"
+
+ # merge and prepare for use with $CC
+ for d in $_TEMP; do
+ # sanity test
+ if [ ! -d "$d" ]; then
+ echo "$d: is not a directory"
+ exit 1
+ fi
+ GCC_INC="$GCC_INC -I $d"
+ done
+fi
+set -u
+
+# For each header file, create a .c which includes the header file
+# and try to compile it using only current directory for searching other
+# included header files.
+_FAILED=0
+_PASSED=0
+for f in $( find . -name "*\.h" | xargs ); do
+ _FAIL=0
+ CFILE="$( echo "$( dirname "$f" )"/"$( basename "$f" .h )".c )"
+
+ # create .c file
+ echo "#include <"$( echo "$f" | sed -e 's|^.\/||' )">" \
+ > "$(dirname "$f")"/"$(basename "$f" .h)".c
+
+ # compile test, CC not quoted to support ccache
+ echo $CC -Wall -c -nostdinc $GCC_INC -I . -I "$COMPILE_TEST_INC" -I "$COMPILE_TEST_INC/$ARCH_TRIPLET" "$CFILE"
+ $CC -Wall -c -nostdinc $GCC_INC -I . -I "$COMPILE_TEST_INC" -I "$COMPILE_TEST_INC/$ARCH_TRIPLET" "$CFILE" \
+ || _FAIL=1
+
+ # report errors
+ if [ "$_FAIL" -gt 0 ]; then
+ echo "FAILED: $f"
+ _FAILED="$(( $_FAILED + 1 ))"
+ else
+ echo "PASSED: $f"
+ _PASSED="$(( $_PASSED + 1))"
+ fi
+done
+
+echo Statistics:
+echo "$_FAILED files failed the compile test."
+echo "$_PASSED files passed the compile test."
+
+exit "$_FAILED"
--
2.1.4

2015-02-16 23:06:36

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 05/45] drm.h: include stdlib.h in userspace

Fixes <drm/drm.h> compilation error:

drm/drm.h:132:2: error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/drm.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index b0b8556..8f4488f 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -42,6 +42,10 @@
#include <asm/ioctl.h>
typedef unsigned int drm_handle_t;

+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif
+
#else /* One of the BSDs */

#include <sys/ioccom.h>
--
2.1.4

2015-02-16 23:18:09

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 06/45] drm_mode.h: include stdint.h and linux/types.h in userspace

Fixes compilation error:

drm/drm_mode.h:472:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/drm_mode.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index a0db2d4a..c55dfdf 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -27,7 +27,12 @@
#ifndef _DRM_MODE_H
#define _DRM_MODE_H

+#ifdef __KERNEL__
#include <linux/types.h>
+#else
+#include <stdint.h>
+#include <linux/types.h>
+#endif

#define DRM_DISPLAY_INFO_LEN 32
#define DRM_CONNECTOR_NAME_LEN 32
--
2.1.4

2015-02-16 23:06:46

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 07/45] exynos_drm.h: include stdint.h in userspace

Fixes compilation errors like:

drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/exynos_drm.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index 5575ed1..03d094d 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -15,6 +15,11 @@
#ifndef _UAPI_EXYNOS_DRM_H_
#define _UAPI_EXYNOS_DRM_H_

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <drm/drm.h>

/**
--
2.1.4

2015-02-16 23:06:44

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 08/45] nouveau_drm.h: include stdint.h in userspace

Fixes compilation error:

drm/nouveau_drm.h:41:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/nouveau_drm.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index 0d7608d..4baf959 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -35,6 +35,12 @@
#define NOUVEAU_ABI16_DEVICE 0xdddddddd
#define NOUVEAU_ABI16_CHAN(n) (0xcccc0000 | (n))

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
--
2.1.4

2015-02-16 23:06:54

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 09/45] radeon_drm.h: include stdint.h in userspace

Fixes compiler error:

drm/radeon_drm.h:794:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/radeon_drm.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 50d0fb4..4d8ed03 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -33,6 +33,11 @@
#ifndef __RADEON_DRM_H__
#define __RADEON_DRM_H__

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <drm/drm.h>

/* WARNING: If you change any of these defines, make sure to change the
--
2.1.4

2015-02-16 23:06:52

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 10/45] r128_drm.h: include drm/drm.h

Fixes compile error:

drm/r128_drm.h:156:23: error: array type has incomplete element type
struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/r128_drm.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/r128_drm.h b/include/uapi/drm/r128_drm.h
index 8d8878b..76b0aa3 100644
--- a/include/uapi/drm/r128_drm.h
+++ b/include/uapi/drm/r128_drm.h
@@ -33,6 +33,8 @@
#ifndef __R128_DRM_H__
#define __R128_DRM_H__

+#include <drm/drm.h>
+
/* WARNING: If you change any of these defines, make sure to change the
* defines in the X server file (r128_sarea.h)
*/
--
2.1.4

2015-02-16 23:17:04

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 11/45] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h

Fixes compiler error:

drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/via_drm.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 8b0533c..791531e 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -24,6 +24,7 @@
#ifndef _VIA_DRM_H_
#define _VIA_DRM_H_

+#include <linux/types.h>
#include <drm/drm.h>

/* WARNING: These defines must be the same as what the Xserver uses.
@@ -33,9 +34,6 @@
#ifndef _VIA_DEFINES_
#define _VIA_DEFINES_

-#ifndef __KERNEL__
-#include "via_drmclient.h"
-#endif

#define VIA_NR_SAREA_CLIPRECTS 8
#define VIA_NR_XVMC_PORTS 10
--
2.1.4

2015-02-16 23:06:57

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 12/45] via_drm.h: hide struct via_file_private in userspace

Fixes compiler error since list_head is not exported to userspace headers.

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/via_drm.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 791531e..34ce658 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -272,8 +272,10 @@ typedef struct drm_via_dmablit {
drm_via_blitsync_t sync;
} drm_via_dmablit_t;

+#ifdef __KERNEL__
struct via_file_private {
struct list_head obj_list;
};
+#endif

#endif /* _VIA_DRM_H_ */
--
2.1.4

2015-02-16 23:07:00

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 13/45] savage_drm.h: include <drm/drm.h>

Fixes compiler error:

drm/savage_drm.h:50:24: error: array type has incomplete element type
struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/savage_drm.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/savage_drm.h b/include/uapi/drm/savage_drm.h
index 818d49b..9dc9dc1 100644
--- a/include/uapi/drm/savage_drm.h
+++ b/include/uapi/drm/savage_drm.h
@@ -26,6 +26,8 @@
#ifndef __SAVAGE_DRM_H__
#define __SAVAGE_DRM_H__

+#include <drm/drm.h>
+
#ifndef __SAVAGE_SAREA_DEFINES__
#define __SAVAGE_SAREA_DEFINES__

--
2.1.4

2015-02-16 23:07:05

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 14/45] sis_drm.h: hide sis_file_private in userspace

Fixes compiler error:

drm/sis_drm.h:68:19: error: field ‘obj_list’ has incomplete type
struct list_head obj_list;

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/sis_drm.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/sis_drm.h b/include/uapi/drm/sis_drm.h
index df37632..3d0903f 100644
--- a/include/uapi/drm/sis_drm.h
+++ b/include/uapi/drm/sis_drm.h
@@ -64,8 +64,10 @@ typedef struct {
unsigned long offset, size;
} drm_sis_fb_t;

+#ifdef __KERNEL__
struct sis_file_private {
struct list_head obj_list;
};
+#endif

#endif /* __SIS_DRM_H__ */
--
2.1.4

2015-02-16 23:16:19

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

Fixes compilation error:

linux/dm-log-userspace.h:416:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/dm-log-userspace.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/dm-log-userspace.h b/include/uapi/linux/dm-log-userspace.h
index 0fa0d9e..7b9684e 100644
--- a/include/uapi/linux/dm-log-userspace.h
+++ b/include/uapi/linux/dm-log-userspace.h
@@ -7,6 +7,11 @@
#ifndef __DM_LOG_USERSPACE_H__
#define __DM_LOG_USERSPACE_H__

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <linux/dm-ioctl.h> /* For DM_UUID_LEN */

/*
--
2.1.4

2015-02-16 23:15:50

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 16/45] hsi_char.h: include stdint.h in userspace

Fixes compiler error:

linux/hsi/hsi_char.h:51:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/hsi/hsi_char.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/hsi/hsi_char.h b/include/uapi/linux/hsi/hsi_char.h
index 76160b4..9fa8f91 100644
--- a/include/uapi/linux/hsi/hsi_char.h
+++ b/include/uapi/linux/hsi/hsi_char.h
@@ -20,10 +20,15 @@
* 02110-1301 USA
*/

-
#ifndef __HSI_CHAR_H
#define __HSI_CHAR_H

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
#define HSI_CHAR_MAGIC 'k'
#define HSC_IOW(num, dtype) _IOW(HSI_CHAR_MAGIC, num, dtype)
#define HSC_IOR(num, dtype) _IOR(HSI_CHAR_MAGIC, num, dtype)
--
2.1.4

2015-02-16 23:07:12

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 17/45] ebtables.h: include stdint.h in userspace

Fixes compilation error:

linux/netfilter_bridge/ebtables.h:38:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/netfilter_bridge/ebtables.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/netfilter_bridge/ebtables.h b/include/uapi/linux/netfilter_bridge/ebtables.h
index ba99336..9e8d6b4 100644
--- a/include/uapi/linux/netfilter_bridge/ebtables.h
+++ b/include/uapi/linux/netfilter_bridge/ebtables.h
@@ -12,6 +12,11 @@

#ifndef _UAPI__LINUX_BRIDGE_EFF_H
#define _UAPI__LINUX_BRIDGE_EFF_H
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <linux/if.h>
#include <linux/netfilter_bridge.h>
#include <linux/if_ether.h>
--
2.1.4

2015-02-16 23:15:30

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 18/45] cld.h: include stdint.h in userspace

Fixes compilation error:

linux/nfsd/cld.h:40:2: error: unknown type name ‘uint16_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/nfsd/cld.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/nfsd/cld.h b/include/uapi/linux/nfsd/cld.h
index f14a9ab..9f60f9c 100644
--- a/include/uapi/linux/nfsd/cld.h
+++ b/include/uapi/linux/nfsd/cld.h
@@ -22,6 +22,12 @@
#ifndef _NFSD_CLD_H
#define _NFSD_CLD_H

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
/* latest upcall version available */
#define CLD_UPCALL_VERSION 1

--
2.1.4

2015-02-16 23:07:18

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 19/45] rds.h: include stdint.h in userspace

Fixes compilation error:

linux/rds.h:96:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/rds.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
index 9195095..7ff0c70 100644
--- a/include/uapi/linux/rds.h
+++ b/include/uapi/linux/rds.h
@@ -34,7 +34,11 @@
#ifndef _LINUX_RDS_H
#define _LINUX_RDS_H

+#ifdef __KERNEL__
#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif

#define RDS_IB_ABI_VERSION 0x301

--
2.1.4

2015-02-16 23:07:23

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 20/45] sctp.h: include stdint.h in userspace

Fixes compilation error:

linux/sctp.h:652:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/sctp.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index ce70fe6..9fd31cf 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -53,7 +53,11 @@
#ifndef _UAPI_SCTP_H
#define _UAPI_SCTP_H

+#ifdef __KERNEL__
#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <linux/socket.h>

typedef __s32 sctp_assoc_t;
--
2.1.4

2015-02-16 23:14:43

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 21/45] scsi_bsg_fc.h: include stdint.h in userspace

Fixes compilation error:

scsi/scsi_bsg_fc.h:83:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/scsi/scsi_bsg_fc.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
index 3031b90..5cc25df 100644
--- a/include/uapi/scsi/scsi_bsg_fc.h
+++ b/include/uapi/scsi/scsi_bsg_fc.h
@@ -22,6 +22,12 @@
#ifndef SCSI_BSG_FC_H
#define SCSI_BSG_FC_H

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
/*
* This file intended to be included by both kernel and user space
*/
--
2.1.4

2015-02-16 23:07:30

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 22/45] scsi_netlink.h: include stdint.h in userspace

Fixes compilation error:

scsi/scsi_netlink.h:43:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/scsi/scsi_netlink.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/uapi/scsi/scsi_netlink.h b/include/uapi/scsi/scsi_netlink.h
index 62b4eda..9d14592 100644
--- a/include/uapi/scsi/scsi_netlink.h
+++ b/include/uapi/scsi/scsi_netlink.h
@@ -22,8 +22,12 @@
#ifndef SCSI_NETLINK_H
#define SCSI_NETLINK_H

-#include <linux/netlink.h>
+#ifdef __KERNEL__
#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+#include <linux/netlink.h>

/*
* This file intended to be included by both kernel and user space
--
2.1.4

2015-02-16 23:14:13

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 23/45] scsi_netlink_fc.h: include stdint.h in userspace

Fixes compilation error:

scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-list before ‘uint64_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/scsi/scsi_netlink_fc.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h
index cbf76e4..d969337 100644
--- a/include/uapi/scsi/scsi_netlink_fc.h
+++ b/include/uapi/scsi/scsi_netlink_fc.h
@@ -21,6 +21,11 @@
#ifndef SCSI_NETLINK_FC_H
#define SCSI_NETLINK_FC_H

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
#include <scsi/scsi_netlink.h>

/*
--
2.1.4

2015-02-16 23:07:35

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 24/45] hdspm.h: include stdint.h in userspace

Fixes compilation error:

sound/hdspm.h:43:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/sound/hdspm.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h
index d956c35..f799828 100644
--- a/include/uapi/sound/hdspm.h
+++ b/include/uapi/sound/hdspm.h
@@ -20,6 +20,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
#define HDSPM_MAX_CHANNELS 64

--
2.1.4

2015-02-16 23:07:42

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 25/45] gntalloc.h: include stdint.h in userspace

Fixes compilation error:

xen/gntalloc.h:22:2: error: unknown type name ‘uint16_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/xen/gntalloc.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/xen/gntalloc.h b/include/uapi/xen/gntalloc.h
index 76bd580..184df7e 100644
--- a/include/uapi/xen/gntalloc.h
+++ b/include/uapi/xen/gntalloc.h
@@ -11,6 +11,12 @@
#ifndef __LINUX_PUBLIC_GNTALLOC_H__
#define __LINUX_PUBLIC_GNTALLOC_H__

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
/*
* Allocates a new page and creates a new grant reference.
*/
--
2.1.4

2015-02-16 23:07:39

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 26/45] gntdev.h: include stdint.h in userspace

Fixes compilation error:

xen/gntdev.h:38:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/xen/gntdev.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/xen/gntdev.h b/include/uapi/xen/gntdev.h
index 5304bd3..f724f75 100644
--- a/include/uapi/xen/gntdev.h
+++ b/include/uapi/xen/gntdev.h
@@ -33,6 +33,12 @@
#ifndef __LINUX_PUBLIC_GNTDEV_H__
#define __LINUX_PUBLIC_GNTDEV_H__

+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
struct ioctl_gntdev_grant_ref {
/* The domain ID of the grant to be mapped. */
uint32_t domid;
--
2.1.4

2015-02-16 23:07:46

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 27/45] include/uapi/linux/sysctl.h: include stdlib.h in userspace

Fixes userspace compilation error:

error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/sysctl.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index 43aaba1..b7b344f 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -26,6 +26,10 @@
#include <linux/types.h>
#include <linux/compiler.h>

+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif
+
struct completion;

#define CTL_MAXNAME 10 /* how many path components do we allow in a
--
2.1.4

2015-02-16 23:13:26

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 28/45] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h

Fixes userspace compilation error:

error: unknown type name ‘__kernel_key_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/ipcbuf.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/asm-generic/ipcbuf.h b/include/uapi/asm-generic/ipcbuf.h
index 3dbcc1e..909f825 100644
--- a/include/uapi/asm-generic/ipcbuf.h
+++ b/include/uapi/asm-generic/ipcbuf.h
@@ -1,6 +1,8 @@
#ifndef __ASM_GENERIC_IPCBUF_H
#define __ASM_GENERIC_IPCBUF_H

+#include <linux/posix_types.h>
+
/*
* The generic ipc64_perm structure:
* Note extra padding because this structure is passed back and forth
--
2.1.4

2015-02-16 23:07:49

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 29/45] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h

Fixes userspace compilation errors like:

error: field ‘msg_perm’ has incomplete type
struct ipc64_perm msg_perm

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/msgbuf.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index f55ecc4..f5fbd8e 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -2,6 +2,8 @@
#define __ASM_GENERIC_MSGBUF_H

#include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+
/*
* generic msqid64_ds structure.
*
--
2.1.4

2015-02-16 23:12:56

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 30/45] include/uapi/asm-generic/shmbuf.h: include fixes

Fixes userspace compilation errors like:

error: field ‘shm_perm’ has incomplete type
struct ipc64_perm shm_perm; /* operation perms */
error: unknown type name ‘size_t’
error: unknown type name ‘__kernel_time_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/shmbuf.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
index 7e9fb2f..24ef152 100644
--- a/include/uapi/asm-generic/shmbuf.h
+++ b/include/uapi/asm-generic/shmbuf.h
@@ -1,7 +1,13 @@
#ifndef __ASM_GENERIC_SHMBUF_H
#define __ASM_GENERIC_SHMBUF_H

+#include <linux/types.h>
#include <asm/bitsperlong.h>
+#include <asm/msgbuf.h>
+
+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif

/*
* The shmid64_ds structure for x86 architecture.
--
2.1.4

2015-02-16 23:12:36

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 31/45] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h

Fixes userspace compilation errors like:

error: field ‘msg_perm’ has incomplete type
struct ipc64_perm msg_perm;
error: unknown type name ‘__kernel_ulong_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/sembuf.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/asm-generic/sembuf.h b/include/uapi/asm-generic/sembuf.h
index 4cb2c13..17d523f 100644
--- a/include/uapi/asm-generic/sembuf.h
+++ b/include/uapi/asm-generic/sembuf.h
@@ -2,6 +2,8 @@
#define __ASM_GENERIC_SEMBUF_H

#include <asm/bitsperlong.h>
+#include <asm/posix_types.h>
+#include <asm/ipcbuf.h>

/*
* The semid64_ds structure for x86 architecture.
--
2.1.4

2015-02-16 23:11:59

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 32/45] drm/i810_drm.h: include drm/drm.h

Fixes userspace compilation error:

error: array type has incomplete element type
struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/drm/i810_drm.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h
index 7a10bb6..34736ef 100644
--- a/include/uapi/drm/i810_drm.h
+++ b/include/uapi/drm/i810_drm.h
@@ -1,6 +1,8 @@
#ifndef _I810_DRM_H_
#define _I810_DRM_H_

+#include <drm/drm.h>
+
/* WARNING: These defines must be the same as what the Xserver uses.
* if you change them, you must change the defines in the Xserver.
*/
--
2.1.4

2015-02-16 23:11:38

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 33/45] include/uapi/asm-generic/signal.h: include stdlib.h in userspace

Fixes compiler warning:
error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/signal.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 9df61f1..8a341a2 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -3,6 +3,10 @@

#include <linux/types.h>

+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif
+
#define _NSIG 64
#define _NSIG_BPW __BITS_PER_LONG
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
--
2.1.4

2015-02-16 23:07:55

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 34/45] include/uapi/asm-generic/signal.h: hide sigset_t definition in userspace

It is already defined by libc headers in
/usr/include/i386-linux-gnu/sys/select.h

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/signal.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 8a341a2..af4d83a 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -88,9 +88,12 @@
#define SIGSTKSZ 8192

#ifndef __ASSEMBLY__
+#ifdef __KERNEL__
+/* already defined in userspace via stdlib.h */
typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;
+#endif /* __KERNEL__ */

/* not actually used, but required for linux/syscalls.h */
typedef unsigned long old_sigset_t;
--
2.1.4

2015-02-16 23:07:58

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 35/45] include/uapi/sound/asound.h: include stdlib.h in userspace

Fixes compiler errors like:
error: field ‘trigger_tstamp’ has incomplete type
error: invalid application of ‘sizeof’ to incomplete t
ype ‘struct timespec’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/sound/asound.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index 941d32f..af156b0 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -25,6 +25,9 @@

#include <linux/types.h>

+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif

/*
* protocol version
--
2.1.4

2015-02-16 23:08:02

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 36/45] include/uapi/linux/netfilter.h: include in.h and in6.h

Fixes userspace compile errors like:
error: field ‘in’ has incomplete type
error: field ‘in6’ has incomplete type

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/netfilter.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
index ef1b1f8..750c04e 100644
--- a/include/uapi/linux/netfilter.h
+++ b/include/uapi/linux/netfilter.h
@@ -4,7 +4,8 @@
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/sysctl.h>
-
+#include <linux/in.h>
+#include <linux/in6.h>

/* Responses from hook functions. */
#define NF_DROP 0
--
2.1.4

2015-02-16 23:10:48

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 37/45] include/uapi/linux/socket.h: include sys/socket.h in userspace

This libc header has sockaddr definition for userspace.
Fixes compilation errors like:
error: field ‘ifru_addr’ has incomplete type
struct sockaddr ifru_addr;

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/socket.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
index 76ab0c6..8a81197 100644
--- a/include/uapi/linux/socket.h
+++ b/include/uapi/linux/socket.h
@@ -1,6 +1,10 @@
#ifndef _UAPI_LINUX_SOCKET_H
#define _UAPI_LINUX_SOCKET_H

+#ifndef __KERNEL__
+#include <sys/socket.h>
+#endif
+
/*
* Desired design of maximum size and alignment (see RFC2553)
*/
--
2.1.4

2015-02-16 23:08:10

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 38/45] include/uapi/linux/agpgart.h: include stdlib.h in userspace

Fixes userspace compiler error:
error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/agpgart.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/agpgart.h b/include/uapi/linux/agpgart.h
index 4e828cf..f525104 100644
--- a/include/uapi/linux/agpgart.h
+++ b/include/uapi/linux/agpgart.h
@@ -52,6 +52,7 @@

#ifndef __KERNEL__
#include <linux/types.h>
+#include <stdlib.h>

struct agp_version {
__u16 major;
--
2.1.4

2015-02-16 23:08:07

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 39/45] include/uapi/sound/asequencer.h: include sound/asound.h

Fixes userspace compilation error:
error: unknown type name ‘snd_seq_client_type_t’
snd_seq_client_type_t type; /* client type */

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/sound/asequencer.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h
index 09c8a00..5a5fa49 100644
--- a/include/uapi/sound/asequencer.h
+++ b/include/uapi/sound/asequencer.h
@@ -22,6 +22,7 @@
#ifndef _UAPI__SOUND_ASEQUENCER_H
#define _UAPI__SOUND_ASEQUENCER_H

+#include <sound/asound.h>

/** version of the sequencer */
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
--
2.1.4

2015-02-16 23:10:24

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 40/45] include/uapi/sound/emu10k1.h: include sound/asound.h

Fixes userspace compilation errors like:
error: field ‘id’ has incomplete type
struct snd_ctl_elem_id id; /* full control ID definition */

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/sound/emu10k1.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h
index d1bbaf7..ec1535b 100644
--- a/include/uapi/sound/emu10k1.h
+++ b/include/uapi/sound/emu10k1.h
@@ -23,8 +23,7 @@
#define _UAPI__SOUND_EMU10K1_H

#include <linux/types.h>
-
-
+#include <sound/asound.h>

/*
* ---- FX8010 ----
--
2.1.4

2015-02-16 23:08:12

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 41/45] include/uapi/sound/emu10k1.h: hide gpr_valid, tram_valid and code_valid in userspace

The DECLARE_BITMAP macro is not available in userspace headers.
Fixes userspace compile error:
error: expected specifier-qualifier-list before ‘DECLARE_BITMAP’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/sound/emu10k1.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h
index ec1535b..f2fd870 100644
--- a/include/uapi/sound/emu10k1.h
+++ b/include/uapi/sound/emu10k1.h
@@ -300,7 +300,9 @@ struct snd_emu10k1_fx8010_control_old_gpr {
struct snd_emu10k1_fx8010_code {
char name[128];

+#ifdef __KERNEL__
DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
+#endif
__u32 __user *gpr_map; /* initializers */

unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
@@ -313,11 +315,15 @@ struct snd_emu10k1_fx8010_code {
unsigned int gpr_list_control_total; /* total count of GPR controls */
struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */

+#ifdef __KERNEL__
DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
+#endif
__u32 __user *tram_data_map; /* data initializers */
__u32 __user *tram_addr_map; /* map initializers */

+#ifdef __KERNEL__
DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
+#endif
__u32 __user *code; /* one instruction - 64 bits */
};

--
2.1.4

2015-02-16 23:09:23

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 42/45] include/uapi/linux/rds.h: include linux/socket.h and linux/types.h always

Fixes compilation errors in userspace like:

error: unknown type name ‘__be32’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/rds.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
index 7ff0c70..47b1ede 100644
--- a/include/uapi/linux/rds.h
+++ b/include/uapi/linux/rds.h
@@ -34,9 +34,9 @@
#ifndef _LINUX_RDS_H
#define _LINUX_RDS_H

-#ifdef __KERNEL__
#include <linux/types.h>
-#else
+#include <linux/socket.h>
+#ifndef __KERNEL__
#include <stdint.h>
#endif

--
2.1.4

2015-02-16 23:08:16

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 43/45] include/uapi/linux/netfilter_bridge.h: include if.h

Fixes userspace compilation errors like:

error: field ‘in’ has incomplete type
struct in_addr in;

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/netfilter_bridge.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/netfilter_bridge.h b/include/uapi/linux/netfilter_bridge.h
index a5eda6d..5bb0528 100644
--- a/include/uapi/linux/netfilter_bridge.h
+++ b/include/uapi/linux/netfilter_bridge.h
@@ -4,6 +4,7 @@
/* bridge-specific defines for netfilter.
*/

+#include <linux/if.h>
#include <linux/netfilter.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
--
2.1.4

2015-02-16 23:08:52

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 44/45] nf_conntrack_tuple_common.h: include linux/types.h and linux/netfilter.h

Fixes userspace compilation errors like:
error: unknown type name ‘__be16’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/linux/netfilter/nf_conntrack_tuple_common.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
index 2f6bbc5..a9c3834 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
@@ -1,6 +1,9 @@
#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
#define _NF_CONNTRACK_TUPLE_COMMON_H

+#include <linux/types.h>
+#include <linux/netfilter.h>
+
enum ip_conntrack_dir {
IP_CT_DIR_ORIGINAL,
IP_CT_DIR_REPLY,
--
2.1.4

2015-02-16 23:08:29

by Mikko Rapeli

[permalink] [raw]
Subject: [PATCH 45/45] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

Fixes userspace compiler errors:

error: unknown type name ‘stack_t’
error: field ‘uc_mcontext’ has incomplete type
struct sigcontext uc_mcontext;
error: unknown type name ‘sigset_t’

Signed-off-by: Mikko Rapeli <[email protected]>
---
include/uapi/asm-generic/ucontext.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/uapi/asm-generic/ucontext.h b/include/uapi/asm-generic/ucontext.h
index ad77343..31ece341 100644
--- a/include/uapi/asm-generic/ucontext.h
+++ b/include/uapi/asm-generic/ucontext.h
@@ -1,6 +1,9 @@
#ifndef __ASM_GENERIC_UCONTEXT_H
#define __ASM_GENERIC_UCONTEXT_H

+#include <asm-generic/signal.h>
+#include <asm/sigcontext.h>
+
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
--
2.1.4

2015-02-16 23:33:08

by Mike Snitzer

[permalink] [raw]
Subject: Re: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

On Mon, Feb 16 2015 at 6:05pm -0500,
Mikko Rapeli <[email protected]> wrote:

> Fixes compilation error:
>
> linux/dm-log-userspace.h:416:2: error: unknown type name ‘uint64_t’

What userspace code are you compiling? Do you have a feel for when this
stopped working?

2015-02-16 23:48:20

by Mikko Rapeli

[permalink] [raw]
Subject: Re: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

On Mon, Feb 16, 2015 at 06:32:54PM -0500, Mike Snitzer wrote:
> On Mon, Feb 16 2015 at 6:05pm -0500,
> Mikko Rapeli <[email protected]> wrote:
>
> > Fixes compilation error:
> >
> > linux/dm-log-userspace.h:416:2: error: unknown type name ‘uint64_t’
>
> What userspace code are you compiling? Do you have a feel for when this
> stopped working?

See Message-Id: <[email protected]>
or https://lkml.org/lkml/2015/2/16/521

The failure comes from a test which tries to compile each exported header file
in userspace one at a time.

-Mikko

2015-02-17 00:02:54

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH 43/45] include/uapi/linux/netfilter_bridge.h: include if.h

On Tuesday 2015-02-17 00:05, Mikko Rapeli wrote:

>Fixes userspace compilation errors like:
>
>error: field ‘in’ has incomplete type
>struct in_addr in;
>
>+#include <linux/if.h>

Patch 36/45 included linux/in.h instead of linux/if.h for addressing "in has incomplete
type". Should this be used here too?

2015-02-17 06:27:42

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 41/45] include/uapi/sound/emu10k1.h: hide gpr_valid, tram_valid and code_valid in userspace

At Tue, 17 Feb 2015 00:05:44 +0100,
Mikko Rapeli wrote:
>
> The DECLARE_BITMAP macro is not available in userspace headers.
> Fixes userspace compile error:
> error: expected specifier-qualifier-list before ‘DECLARE_BITMAP’

It's nonsense. This results in an incompatible structure, thus ABI
would be broken completely (actually this will break the compile of
ld10k1).


Takashi

>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> include/uapi/sound/emu10k1.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h
> index ec1535b..f2fd870 100644
> --- a/include/uapi/sound/emu10k1.h
> +++ b/include/uapi/sound/emu10k1.h
> @@ -300,7 +300,9 @@ struct snd_emu10k1_fx8010_control_old_gpr {
> struct snd_emu10k1_fx8010_code {
> char name[128];
>
> +#ifdef __KERNEL__
> DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
> +#endif
> __u32 __user *gpr_map; /* initializers */
>
> unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
> @@ -313,11 +315,15 @@ struct snd_emu10k1_fx8010_code {
> unsigned int gpr_list_control_total; /* total count of GPR controls */
> struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
>
> +#ifdef __KERNEL__
> DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
> +#endif
> __u32 __user *tram_data_map; /* data initializers */
> __u32 __user *tram_addr_map; /* map initializers */
>
> +#ifdef __KERNEL__
> DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
> +#endif
> __u32 __user *code; /* one instruction - 64 bits */
> };
>
> --
> 2.1.4
>

2015-02-17 06:46:07

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 24/45] hdspm.h: include stdint.h in userspace

At Tue, 17 Feb 2015 00:05:27 +0100,
Mikko Rapeli wrote:
>
> Fixes compilation error:
>
> sound/hdspm.h:43:2: error: unknown type name ‘uint32_t’
>
> Signed-off-by: Mikko Rapeli <[email protected]>

Applied for 3.21, thanks.


Takashi

> ---
> include/uapi/sound/hdspm.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h
> index d956c35..f799828 100644
> --- a/include/uapi/sound/hdspm.h
> +++ b/include/uapi/sound/hdspm.h
> @@ -20,6 +20,12 @@
> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> */
>
> +#ifdef __KERNEL__
> +#include <linux/types.h>
> +#else
> +#include <stdint.h>
> +#endif
> +
> /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
> #define HDSPM_MAX_CHANNELS 64
>
> --
> 2.1.4
>

2015-02-17 06:46:20

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 35/45] include/uapi/sound/asound.h: include stdlib.h in userspace

At Tue, 17 Feb 2015 00:05:38 +0100,
Mikko Rapeli wrote:
>
> Fixes compiler errors like:
> error: field ‘trigger_tstamp’ has incomplete type
> error: invalid application of ‘sizeof’ to incomplete t
> ype ‘struct timespec’
>
> Signed-off-by: Mikko Rapeli <[email protected]>

Applied for 3.21, thanks.


Takashi

> ---
> include/uapi/sound/asound.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
> index 941d32f..af156b0 100644
> --- a/include/uapi/sound/asound.h
> +++ b/include/uapi/sound/asound.h
> @@ -25,6 +25,9 @@
>
> #include <linux/types.h>
>
> +#ifndef __KERNEL__
> +#include <stdlib.h>
> +#endif
>
> /*
> * protocol version
> --
> 2.1.4
>

2015-02-17 06:46:33

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 39/45] include/uapi/sound/asequencer.h: include sound/asound.h

At Tue, 17 Feb 2015 00:05:42 +0100,
Mikko Rapeli wrote:
>
> Fixes userspace compilation error:
> error: unknown type name ‘snd_seq_client_type_t’
> snd_seq_client_type_t type; /* client type */
>
> Signed-off-by: Mikko Rapeli <[email protected]>

Applied for 3.21, thanks.


Takashi

> ---
> include/uapi/sound/asequencer.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h
> index 09c8a00..5a5fa49 100644
> --- a/include/uapi/sound/asequencer.h
> +++ b/include/uapi/sound/asequencer.h
> @@ -22,6 +22,7 @@
> #ifndef _UAPI__SOUND_ASEQUENCER_H
> #define _UAPI__SOUND_ASEQUENCER_H
>
> +#include <sound/asound.h>
>
> /** version of the sequencer */
> #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
> --
> 2.1.4
>

2015-02-17 06:46:43

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 40/45] include/uapi/sound/emu10k1.h: include sound/asound.h

At Tue, 17 Feb 2015 00:05:43 +0100,
Mikko Rapeli wrote:
>
> Fixes userspace compilation errors like:
> error: field ‘id’ has incomplete type
> struct snd_ctl_elem_id id; /* full control ID definition */
>
> Signed-off-by: Mikko Rapeli <[email protected]>

Applied for 3.21, thanks.


Takashi

> ---
> include/uapi/sound/emu10k1.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h
> index d1bbaf7..ec1535b 100644
> --- a/include/uapi/sound/emu10k1.h
> +++ b/include/uapi/sound/emu10k1.h
> @@ -23,8 +23,7 @@
> #define _UAPI__SOUND_EMU10K1_H
>
> #include <linux/types.h>
> -
> -
> +#include <sound/asound.h>
>
> /*
> * ---- FX8010 ----
> --
> 2.1.4
>

2015-02-17 07:18:33

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 01/45] Makefile: propagate verbose options

Hi Mikko,

On Tue, 17 Feb 2015 00:05:04 +0100
Mikko Rapeli <[email protected]> wrote:

> Usefull when debugging the make scripts.
>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> Makefile | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 4e93284..c1b515d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -912,13 +912,13 @@ quiet_cmd_link-vmlinux = LINK $@
> # execute if the rest of the kernel build went well.
> vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
> ifdef CONFIG_HEADERS_CHECK
> - $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
> + $(Q)$(MAKE) V=$(KBUILD_VERBOSE) -f $(srctree)/Makefile headers_check
> endif
> ifdef CONFIG_SAMPLES
> - $(Q)$(MAKE) $(build)=samples
> + $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=samples
> endif
> ifdef CONFIG_BUILD_DOCSRC
> - $(Q)$(MAKE) $(build)=Documentation
> + $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=Documentation
> endif
> +$(call if_changed,link-vmlinux)
>
> @@ -1069,7 +1069,7 @@ headers_check_all: headers_install_all
> PHONY += headers_check
> headers_check: headers_install
> $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
> - $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
> + $(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
>
> # ---------------------------------------------------------------------------
> # Kernel selftest



If you give V=... from the command line, it is automatically propagated
to its sub-makes.

I think this patch has no point.


Best Regards
Masahiro Yamada

2015-02-17 07:19:13

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 02/45] scripts/headers.sh: add verbose option to make calls if defined


On Tue, 17 Feb 2015 00:05:05 +0100
Mikko Rapeli <[email protected]> wrote:

> Useful when debugging the scripts.
>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> scripts/headers.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/headers.sh b/scripts/headers.sh
> index 95ece06..aa62fd8 100755
> --- a/scripts/headers.sh
> +++ b/scripts/headers.sh
> @@ -7,7 +7,7 @@ set -e
> do_command()
> {
> if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
> - make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
> + make V=$KBUILD_VERBOSE ARCH=$2 KBUILD_HEADERS=$1 headers_$1
> else
> printf "Ignoring arch: %s\n" ${arch}
> fi
> --


KBUILD_VERBOSE is already exported.

Why do you need to set V=... again here?


Best Regards
Masahiro Yamada

2015-02-17 09:09:05

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

On Tuesday 17 February 2015 00:05:18 Mikko Rapeli wrote:
> --- a/include/uapi/linux/dm-log-userspace.h
> +++ b/include/uapi/linux/dm-log-userspace.h
> @@ -7,6 +7,11 @@
> #ifndef __DM_LOG_USERSPACE_H__
> #define __DM_LOG_USERSPACE_H__
>
> +#ifdef __KERNEL__
> +#include <linux/types.h>
> +#else
> +#include <stdint.h>
> +#endif
> #include <linux/dm-ioctl.h> /* For DM_UUID_LEN */
>

The normal way to do this in kernel headers is to use linux/types.h
but change the data structures to use __u64 instead of uint64_t
to avoid the build error.

It's possible that the maintainers of this code have a strong opinion
on this matter, but try doing that first.

Arnd

2015-02-17 09:10:56

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 45/45] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

On Tuesday 17 February 2015 00:05:48 Mikko Rapeli wrote:
> #ifndef __ASM_GENERIC_UCONTEXT_H
> #define __ASM_GENERIC_UCONTEXT_H
>
> +#include <asm-generic/signal.h>
> +#include <asm/sigcontext.h>
> +
> struct ucontext {
>

Including another asm-generic header here is a bad idea: it breaks
if an architecture overrides asm/signal.h with its own version
but wants to use the asm-generic/ucontext.h file.

It would be best to just use linux/signal.h here, which includes
the correct architecture specific files.

Arnd

2015-02-17 09:14:36

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 37/45] include/uapi/linux/socket.h: include sys/socket.h in userspace

On Tuesday 17 February 2015 00:05:40 Mikko Rapeli wrote:
> This libc header has sockaddr definition for userspace.
> Fixes compilation errors like:
> error: field ‘ifru_addr’ has incomplete type
> struct sockaddr ifru_addr;
>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> include/uapi/linux/socket.h | 4 ++++
> 1 file changed, 4 insertions(+)

This looks wrong: where do you see a use of ifru_addr
in uapi/linux/socket.h?

Arnd

2015-02-17 09:16:14

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 34/45] include/uapi/asm-generic/signal.h: hide sigset_t definition in userspace

On Tuesday 17 February 2015 00:05:37 Mikko Rapeli wrote:
> +#ifdef __KERNEL__
> +/* already defined in userspace via stdlib.h */
> typedef struct {
> unsigned long sig[_NSIG_WORDS];
> } sigset_t;
> +#endif /* __KERNEL__ */

I'm not sure here: Is this structure always identical to the one
we see in user space?

If not, we might want to rename the typedef to __kernel_sigset_t
instead and use that inside of the uapi headers.

Arnd

2015-02-17 09:44:54

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 33/45] include/uapi/asm-generic/signal.h: include stdlib.h in userspace

On Tuesday 17 February 2015 00:05:36 Mikko Rapeli wrote:
> Fixes compiler warning:
> error: unknown type name ‘size_t’
>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> include/uapi/asm-generic/signal.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
> index 9df61f1..8a341a2 100644
> --- a/include/uapi/asm-generic/signal.h
> +++ b/include/uapi/asm-generic/signal.h
> @@ -3,6 +3,10 @@
>
> #include <linux/types.h>
>
> +#ifndef __KERNEL__
> +#include <stdlib.h>
> +#endif
> +

Hmm, maybe we should use __kernel_size_t instead?

Arnd

2015-02-17 13:11:45

by Neil Horman

[permalink] [raw]
Subject: Re: [PATCH 20/45] sctp.h: include stdint.h in userspace

On Tue, Feb 17, 2015 at 12:05:23AM +0100, Mikko Rapeli wrote:
> Fixes compilation error:
>
> linux/sctp.h:652:2: error: unknown type name ‘uint32_t’
>
> Signed-off-by: Mikko Rapeli <[email protected]>
Acked-by: Neil Horman <[email protected]>

> ---
> include/uapi/linux/sctp.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
> index ce70fe6..9fd31cf 100644
> --- a/include/uapi/linux/sctp.h
> +++ b/include/uapi/linux/sctp.h
> @@ -53,7 +53,11 @@
> #ifndef _UAPI_SCTP_H
> #define _UAPI_SCTP_H
>
> +#ifdef __KERNEL__
> #include <linux/types.h>
> +#else
> +#include <stdint.h>
> +#endif
> #include <linux/socket.h>
>
> typedef __s32 sctp_assoc_t;
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2015-02-17 13:17:55

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH 03/45] headers_install.sh: enhance error handling

On 2015-02-17 00:05, Mikko Rapeli wrote:
> Exit with error if using undefined variables or if any sub command fails
> with error return value. unidef needs special handling since but this can
> be done without the trap. Enables exaniming intermediate files if some
> commands failed.

The intermediate files are removed by your patch as well, aren't they?
Actually, I don't see any change in behavior after your patch.


> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> scripts/headers_install.sh | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
> index fdebd66..072f7d3 100755
> --- a/scripts/headers_install.sh
> +++ b/scripts/headers_install.sh
> @@ -1,4 +1,7 @@
> #!/bin/sh
> +set -e
> +set -u
> +#set -x

The commented-out statement should be removed.

Michal

2015-02-17 13:38:27

by Alasdair G Kergon

[permalink] [raw]
Subject: Re: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

On Tue, Feb 17, 2015 at 10:08:56AM +0100, Arnd Bergmann wrote:
> The normal way to do this in kernel headers is to use linux/types.h
> but change the data structures to use __u64 instead of uint64_t
> to avoid the build error.

That's what happened to dm-ioctl.h.
(Or someone could adjust linux/types.h to include these as standard.)

Alasdair

2015-02-17 13:55:56

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 15/45] dm-log-userspace.h: include stdint.h in userspace

On Tuesday 17 February 2015 13:38:06 Alasdair G Kergon wrote:
> On Tue, Feb 17, 2015 at 10:08:56AM +0100, Arnd Bergmann wrote:
> > The normal way to do this in kernel headers is to use linux/types.h
> > but change the data structures to use __u64 instead of uint64_t
> > to avoid the build error.
>
> That's what happened to dm-ioctl.h.

Ah, indeed. It turns out that it was my own change that did this:


commit 9adfbfb611307060db54691bc7e6d53fdc12312b
Author: Arnd Bergmann <[email protected]>
Date: Thu Feb 26 00:51:40 2009 +0100

make most exported headers use strict integer types

This takes care of all files that have only a small number
of non-strict integer type uses.

> (Or someone could adjust linux/types.h to include these as standard.)

No, that wouldn't work. The C user space headers are not meant to
be included implicitly by any standard headers, which might pull
in linux/types.h implicitly.

I think it would be best to change all patches in the new series
in the same way for consistency and try to avoid using stdint.h
as much as we can.

Arnd

2015-02-18 11:53:27

by David Vrabel

[permalink] [raw]
Subject: Re: [Xen-devel] [PATCH 25/45] gntalloc.h: include stdint.h in userspace

On 16/02/15 23:05, Mikko Rapeli wrote:
> Fixes compilation error:
>
> xen/gntalloc.h:22:2: error: unknown type name ‘uint16_t’
>
> Signed-off-by: Mikko Rapeli <[email protected]>
> ---
> include/uapi/xen/gntalloc.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/uapi/xen/gntalloc.h b/include/uapi/xen/gntalloc.h
> index 76bd580..184df7e 100644
> --- a/include/uapi/xen/gntalloc.h
> +++ b/include/uapi/xen/gntalloc.h
> @@ -11,6 +11,12 @@
> #ifndef __LINUX_PUBLIC_GNTALLOC_H__
> #define __LINUX_PUBLIC_GNTALLOC_H__
>
> +#ifdef __KERNEL__
> +#include <linux/types.h>
> +#else
> +#include <stdint.h>
> +#endif

I think it would be preferrable to #include <linux/types.h> only and
switch to using the __u32 etc. types (as others have suggested).

David

2015-02-18 16:10:34

by Daniel Borkmann

[permalink] [raw]
Subject: Re: [PATCH 20/45] sctp.h: include stdint.h in userspace

On 02/17/2015 12:05 AM, Mikko Rapeli wrote:
> Fixes compilation error:
>
> linux/sctp.h:652:2: error: unknown type name ‘uint32_t’
>
> Signed-off-by: Mikko Rapeli <[email protected]>

I have no idea where the rest of this series went (neither netdev, nor
lkml, nor linux-sctp) and what user space application making use of the
header you are trying to fix !?

> ---
> include/uapi/linux/sctp.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
> index ce70fe6..9fd31cf 100644
> --- a/include/uapi/linux/sctp.h
> +++ b/include/uapi/linux/sctp.h
> @@ -53,7 +53,11 @@
> #ifndef _UAPI_SCTP_H
> #define _UAPI_SCTP_H
>
> +#ifdef __KERNEL__
> #include <linux/types.h>
> +#else
> +#include <stdint.h>
> +#endif
> #include <linux/socket.h>

Looks ugly, but could also be resolved in user space.

2015-02-18 16:05:30

by Mikko Rapeli

[permalink] [raw]
Subject: Re: [PATCH 20/45] sctp.h: include stdint.h in userspace

On Wed, Feb 18, 2015 at 04:48:04PM +0100, Daniel Borkmann wrote:
> On 02/17/2015 12:05 AM, Mikko Rapeli wrote:
> >Fixes compilation error:
> >
> >linux/sctp.h:652:2: error: unknown type name ‘uint32_t’
> >
> >Signed-off-by: Mikko Rapeli <[email protected]>
>
> I have no idea where the rest of this series went (neither netdev, nor
> lkml, nor linux-sctp) and what user space application making use of the
> header you are trying to fix !?

There is a test written to test compilation of exported kernel headers
one by one in userspace. lkml thread is here:

https://lkml.org/lkml/2015/2/16/521

The series should have gone to the right addresses with:

$ git send-email --to [email protected] \
--cc-cmd "scripts/get_maintainer.pl --norolestats"

-Mikko

2015-02-18 16:17:15

by Mikko Rapeli

[permalink] [raw]
Subject: Re: [PATCH RFC v02 00/45] Compile test and fixes for exported header files

Thanks for all the reviews!

I'm going through the review feedback and will try to address all findings
and find correct ways to fix things but this will take some time from my
side.

-Mikko

2015-02-23 10:26:56

by Emil Velikov

[permalink] [raw]
Subject: Re: [PATCH 05/45] drm.h: include stdlib.h in userspace

On 16/02/15 23:05, Mikko Rapeli wrote:
> Fixes <drm/drm.h> compilation error:
>
> drm/drm.h:132:2: error: unknown type name ‘size_t’
>
Hi Mikko,

Can you let us know how you're getting these (series-wise) errors ? I've
been meaning to sync the uapi/drm and libdrm headers and would be nice
to have an extra step to test things.

Thanks
Emil

2015-02-23 10:35:54

by Mikko Rapeli

[permalink] [raw]
Subject: Re: [PATCH 05/45] drm.h: include stdlib.h in userspace

On Mon, Feb 23, 2015 at 10:26:58AM +0000, Emil Velikov wrote:
> On 16/02/15 23:05, Mikko Rapeli wrote:
> > Fixes <drm/drm.h> compilation error:
> >
> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >
> Hi Mikko,
>
> Can you let us know how you're getting these (series-wise) errors ? I've
> been meaning to sync the uapi/drm and libdrm headers and would be nice
> to have an extra step to test things.

This should have everything needed to reproduce these compile errors,
though some of the errors hide behind other errors and fixes:

https://lkml.org/lkml/2015/2/16/525

-Mikko

2015-04-09 16:00:55

by Emil Velikov

[permalink] [raw]
Subject: Re: [PATCH 05/45] drm.h: include stdlib.h in userspace

Hi Mikko

Pardon for the late response,

On 21 March 2015 at 12:17, Mikko Rapeli <[email protected]> wrote:
> On Fri, Mar 20, 2015 at 08:25:40PM +0000, Emil Velikov wrote:
>> On 23 February 2015 at 10:35, Mikko Rapeli <[email protected]> wrote:
>> > On Mon, Feb 23, 2015 at 10:26:58AM +0000, Emil Velikov wrote:
>> >> On 16/02/15 23:05, Mikko Rapeli wrote:
>> >> > Fixes <drm/drm.h> compilation error:
>> >> >
>> >> > drm/drm.h:132:2: error: unknown type name ‘size_t’
>> >> >
>> >> Hi Mikko,
>> >>
>> >> Can you let us know how you're getting these (series-wise) errors ? I've
>> >> been meaning to sync the uapi/drm and libdrm headers and would be nice
>> >> to have an extra step to test things.
>> >
>> > This should have everything needed to reproduce these compile errors,
>> > though some of the errors hide behind other errors and fixes:
>> >
>> > https://lkml.org/lkml/2015/2/16/525
>> >
>> Thanks for the link Mikko.
>>
>> Afaict the general consensus seems to be that one should avoid using
>> stdint's uint8_t, but stick to __u8 and friends. Did you had the
>> chance to roll out another series that does so ?
>
> Yes, new series with these changes is on the way. I'm trying to follow up to
> all other review comments as well and get down to 100% compiling uapi
> headers; 35 failures to go...
>
Glad to hear that it's getting there. Might be a bit slower than
expected but we'll get there :-) Can you please Cc me on the next
iteration ?

>> That aside I'm not 100% sure that doing the UAPI split, as is, was the
>> perfect solution. Afaik drm used to live as an out of tree userspace
>> library(libdrm). Not sure at which point the major restructuring took
>> part, but one is certain - libdrm remains the only authoritative
>> sources of the headers. It's possible that some buggy programs pull
>> the UAPI headers while linking against the library, but I'd say that
>> won't end up well in the long term. Additionally since the UAPI split
>> the `make update-headers' target used to sync libdrm's headers have
>> been broken leading people to copy misc. hunks and/or files. Leading
>> to greater chance of things going sour.
>>
>> All that said, I will need to gather some opinions for drm developers
>> and maintainers if the idea of part revering 718dcedd7e8(UAPI:
>> (Scripted) Disintegrate include/drm) will be the way forward.
>
> Ok, I'll follow what is available in Linus' tree (or -next, not shure which
> one I should track for these changes).
>
After discussing (more like annoying) our DRM maintainer we got to the
conclusion that the headers will stay exposed to userspace. So any and
all of your work will be greatly appreciated.

Thanks
Emil

2015-04-09 16:09:42

by Mikko Rapeli

[permalink] [raw]
Subject: Re: [PATCH 05/45] drm.h: include stdlib.h in userspace

On Thu, Apr 09, 2015 at 05:00:48PM +0100, Emil Velikov wrote:
> Hi Mikko
>
> Pardon for the late response,
>
> On 21 March 2015 at 12:17, Mikko Rapeli <[email protected]> wrote:
> > On Fri, Mar 20, 2015 at 08:25:40PM +0000, Emil Velikov wrote:
> >> On 23 February 2015 at 10:35, Mikko Rapeli <[email protected]> wrote:
> >> > On Mon, Feb 23, 2015 at 10:26:58AM +0000, Emil Velikov wrote:
> >> >> On 16/02/15 23:05, Mikko Rapeli wrote:
> >> >> > Fixes <drm/drm.h> compilation error:
> >> >> >
> >> >> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >> >> >
> >> >> Hi Mikko,
> >> >>
> >> >> Can you let us know how you're getting these (series-wise) errors ? I've
> >> >> been meaning to sync the uapi/drm and libdrm headers and would be nice
> >> >> to have an extra step to test things.
> >> >
> >> > This should have everything needed to reproduce these compile errors,
> >> > though some of the errors hide behind other errors and fixes:
> >> >
> >> > https://lkml.org/lkml/2015/2/16/525
> >> >
> >> Thanks for the link Mikko.
> >>
> >> Afaict the general consensus seems to be that one should avoid using
> >> stdint's uint8_t, but stick to __u8 and friends. Did you had the
> >> chance to roll out another series that does so ?
> >
> > Yes, new series with these changes is on the way. I'm trying to follow up to
> > all other review comments as well and get down to 100% compiling uapi
> > headers; 35 failures to go...
> >
> Glad to hear that it's getting there. Might be a bit slower than
> expected but we'll get there :-) Can you please Cc me on the next
> iteration ?

Yes will Cc you too, and sorry life is getting on the way of this work. Draft
version is visible at

https://github.com/torvalds/linux/compare/master...mcfrisk:headers_test_v03

-Mikko