From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- ...all_headers.sh-Strip-_UAPI-from-if-define.patch | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 external/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch (limited to 'external/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch') diff --git a/external/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch b/external/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch new file mode 100644 index 00000000..54528b6e --- /dev/null +++ b/external/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-kbuild-install_headers.sh-Strip-_UAPI-from-if-define.patch @@ -0,0 +1,38 @@ +From 9ca6c6a510bda90954aa2532711200b89dd1df89 Mon Sep 17 00:00:00 2001 +From: Dave Martin +Date: Tue, 11 Dec 2018 19:26:45 +0000 +Subject: [PATCH 1/3] kbuild: install_headers.sh: Strip _UAPI from + #if-defined() guards + +install_headers.sh knows how to strip the _UAPI prefix from #ifdef/ +ifndef and #define directives used to guard headers against multiple +or inappropriate inclusion. Currently this does not work for guards +in the "#if defined()" style, which may be needed for non-trivial +cases. + +This patch adds similar logic so that the _UAPI prefix is also +stripped from guard directives written using "#if defined()" etc. + +This is not completely foolproof, but will work for simple cases of +using #if defined() to guard against inappropriate header inclusion. + +Signed-off-by: Dave Martin +Signed-off-by: Bruce Ashfield + +Upstream-Status: Submitted [https://www.spinics.net/lists/arm-kernel/msg694800.html] +--- + scripts/headers_install.sh | 1 + + 1 file changed, 1 insertion(+) + +Index: linux-5.4/scripts/headers_install.sh +=================================================================== +--- linux-5.4.orig/scripts/headers_install.sh ++++ linux-5.4/scripts/headers_install.sh +@@ -36,6 +36,7 @@ + s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g + s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g + s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @ ++ :1;s/(#(if|elif)(.*[^A-Za-z0-9_])defined\([[:space:]]*)_UAPI/\1/;t1 + ' $INFILE > $TMPFILE || exit 1 + + scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE -- cgit 1.2.3-korg