libcap: fix build with gperf 3.1
PATCH v2 1/1 libcap: fix build with gperf 3.1
--- .../files/0001-Fix-build-with-gperf-3.1.patch | 41 ++++++++++++++++++++++ meta/recipes-support/libcap/libcap_2.25.bb | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch
meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch new file +41 -0
@@ -0,0 +1,41 @@ +From a05eba68c42222f02465d7ba376015926433c531 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Wed, 26 Jul 2017 13:37:49 +0300 +Subject: [PATCH] Fix build with gperf 3.1 + +The generated gperf file refers to size_t which needs to be +provided by stddef.h include. Also, adjust the makefile +to match the declaration in the gperf file. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> + +--- + libcap/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcap/Makefile b/libcap/Makefile +index d189777..1a57206 100644 +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -22,7 +22,7 @@ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc + + ifeq ($(BUILD_GPERF),yes) + USE_GPERF_OUTPUT = $(GPERF_OUTPUT) +-INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT) ++INCLUDE_GPERF_OUTPUT = -include stddef.h -include $(GPERF_OUTPUT) + endif + + libcap.pc: libcap.pc.in +@@ -41,7 +41,7 @@ cap_names.h: _makenames + ./_makenames > cap_names.h + + $(GPERF_OUTPUT): cap_names.list.h +- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ ++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, register size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ + + cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h + @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h" +-- +2.13.2 +
meta/recipes-support/libcap/libcap_2.25.bb +2 -1
@@ -9,7 +9,8 @@ DEPENDS = "hostperl-runtime-native gperf-native" SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ -" + file://0001-Fix-build-with-gperf-3.1.patch \ + " SRC_URI[md5sum] = "6666b839e5d46c2ad33fc8aa2ceb5f77" SRC_URI[sha256sum] = "693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162"
Signature · 1 line
2.13.2
This breaks systemd:
| In file included from ../git/src/basic/cap-list.c:31:0:
| ./src/basic/cap-from-name.h:141:1: error: conflicting types for 'lookup_capability'
| lookup_capability (register const char *str, register size_t len) | ^~~~~~~~~~~~~~~~~ | ../git/src/basic/cap-list.c:29:38: note: previous declaration of
'lookup_capability' was here
| static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
| ^~~~~~~~~~~~~~~~~
Ross
Quoted 95 lines · Alexander Kanavin
Signed-off-by Alexander Kanavin <[email protected]>--- .../files/0001-Fix-build-with-gperf-3.1.patch | 41 ++++++++++++++++++++++ meta/recipes-support/libcap/libcap_2.25.bb | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch
meta/recipes-support/libcap/files/0001-Fix-build-with- new file +0
-0gperf-3.1.patch
meta/recipes-support/libcap/files/0001-Fix-build-with- new file +34
-0@@ -0,0 +1,41 @@ +From a05eba68c42222f02465d7ba376015926433c531 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Wed, 26 Jul 2017 13:37:49 +0300 +Subject: [PATCH] Fix build with gperf 3.1 + +The generated gperf file refers to size_t which needs to be +provided by stddef.h include. Also, adjust the makefile +to match the declaration in the gperf file. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> + +--- + libcap/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcap/Makefile b/libcap/Makefile +index d189777..1a57206 100644 +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -22,7 +22,7 @@ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc + + ifeq ($(BUILD_GPERF),yes) + USE_GPERF_OUTPUT = $(GPERF_OUTPUT) +-INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT) ++INCLUDE_GPERF_OUTPUT = -include stddef.h -include $(GPERF_OUTPUT) + endif + + libcap.pc: libcap.pc.in +@@ -41,7 +41,7 @@ cap_names.h: _makenames + ./_makenames > cap_names.h + + $(GPERF_OUTPUT): cap_names.list.h +- perl -e 'print "struct __cap_token_s { const char *name; intindex; };\n%{\nconst struct
__cap_token_s*__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ perl -e 'print "struct__cap_token_s{ const char *name; int
index; };\n%{\nconst struct__cap_token_s*__cap_lookup_name(const char *, register size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@meta/recipes-support/libcap/files/0001-Fix-build-with- new file +6
-0+ + cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h + @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h" +-- +2.13.2 +meta/recipes-support/libcap/libcap_2.25.bb +2
-1@@ -9,7 +9,8 @@ DEPENDS = "hostperl-runtime-native gperf-native" SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ -" + file://0001-Fix-build-with-gperf-3.1.patch \ + " SRC_URI[md5sum] = "6666b839e5d46c2ad33fc8aa2ceb5f77"SRC_URI[sha256sum] = "
693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162"--
2.13.2--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core