Skip to contentSkip to conversation

hdf5: Upgrade to 1.8.21

PATCH New Khem Raj 2 participants 9 messages Dec 12, 2019 – Dec 14, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 hdf5: Upgrade to 1.8.21

Forward port 0001-cross-compiling-support.patch

---
 .../files/0001-cross-compiling-support.patch  | 23 ++++++++-----------
 .../hdf5/{hdf5_1.8.19.bb => hdf5_1.8.21.bb}   |  5 ++--
 2 files changed, 12 insertions(+), 16 deletions(-)
 rename meta-oe/recipes-support/hdf5/{hdf5_1.8.19.bb => hdf5_1.8.21.bb} (92%)
meta-oe/recipes-support/hdf5/files/0001-cross-compiling-support.patch +10 -13
index 97f16bbc0b..bdc1fa5f96 100644
@@ -14,11 +14,9 @@ Signed-off-by: Hongxu Jia <[email protected]>
  src/CMakeLists.txt | 23 -----------------------
  2 files changed, 6 insertions(+), 23 deletions(-)
 
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 08a65c4..9af14d5 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -817,4 +817,10 @@ endif ()
+@@ -770,4 +770,10 @@ endif ()
  #-----------------------------------------------------------------------------
  configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY)
  
@@ -29,22 +27,22 @@ index 08a65c4..9af14d5 100644
 +configure_file(H5lib_settings.c H5lib_settings.c COPYONLY)
 +
  include (CMakeInstallation.cmake)
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index d343208..d11525b 100644
 --- a/src/CMakeLists.txt
 +++ b/src/CMakeLists.txt
-@@ -613,32 +613,9 @@ set (H5_PRIVATE_HEADERS
+@@ -613,36 +613,9 @@ set (H5_PRIVATE_HEADERS
  #-----------------------------------------------------------------------------
  add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
  TARGET_C_PROPERTIES (H5detect STATIC " " " ")
 -if (MSVC OR MINGW)
 -  target_link_libraries (H5detect "ws2_32.lib")
 -endif ()
+-if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+-  set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0")
+-endif ()
 -
--set (CMD $<TARGET_FILE:H5detect>)
 -add_custom_command (
 -    OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
--    COMMAND ${CMD}
+-    COMMAND $<TARGET_FILE:H5detect>
 -    ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
 -    DEPENDS H5detect
 -)
@@ -54,11 +52,13 @@ index d343208..d11525b 100644
 -if (MSVC OR MINGW)
 -  target_link_libraries (H5make_libsettings "ws2_32.lib")
 -endif ()
+-if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+-  set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0")
+-endif ()
 -
--set (CMD $<TARGET_FILE:H5make_libsettings>)
 -add_custom_command (
 -    OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
--    COMMAND ${CMD}
+-    COMMAND $<TARGET_FILE:H5make_libsettings>
 -    ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
 -    DEPENDS H5make_libsettings
 -    WORKING_DIRECTORY ${HDF5_BINARY_DIR}
@@ -66,6 +66,3 @@ index d343208..d11525b 100644
  
  if (GENERATE_ERROR_HEADERS)
    find_package (Perl)
--- 
-2.7.4
-
meta-oe/recipes-support/hdf5/hdf5_1.8.21.bb renamed from meta-oe/recipes-support/hdf5/hdf5_1.8.19.bb +2 -3
similarity index 92%
rename from meta-oe/recipes-support/hdf5/hdf5_1.8.19.bb
rename to meta-oe/recipes-support/hdf5/hdf5_1.8.21.bb
index fcbe9b0d62..9af2b67149 100644
@@ -16,9 +16,8 @@ SRC_URI = " \
     file://0001-cross-compiling-support.patch \
     file://0002-Remove-suffix-shared-from-shared-library-name.patch \
 "
-
-SRC_URI[md5sum] = "6f0353ee33e99089c110a1c8d2dd1b22"
-SRC_URI[sha256sum] = "59c03816105d57990329537ad1049ba22c2b8afe1890085f0c022b75f1727238"
+SRC_URI[md5sum] = "2d2408f2a9dfb5c7b79998002e9a90e9"
+SRC_URI[sha256sum] = "e5b1b1dee44a64b795a91c3321ab7196d9e0871fe50d42969761794e3899f40d"
 
 FILES_${PN} += "${libdir}/libhdf5.settings ${datadir}/*"
 
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH 1/1 libnftnl: upgrade 1.1.4 -> 1.1.5

From: Todd Cunningham <[email protected]>

Remove obselete patch:
0001-Move-exports-before-symbol-definition.patch
Refresh patch:
0002-avoid-naming-local-function-as-one-of-printf-family.patch
Add one new file in this patch:
src/obj/synproxy.c

---
 ...ove-exports-before-symbol-definition.patch | 294 ------------------
 ...al-function-as-one-of-printf-family.patch} |  19 +-
 .../{libnftnl_1.1.4.bb => libnftnl_1.1.5.bb}  |   5 +-
 3 files changed, 18 insertions(+), 300 deletions(-)
 delete mode 100644 meta-networking/recipes-filter/libnftnl/libnftnl/0001-Move-exports-before-symbol-definition.patch
 rename meta-networking/recipes-filter/libnftnl/libnftnl/{0002-avoid-naming-local-function-as-one-of-printf-family.patch => 0001-avoid-naming-local-function-as-one-of-printf-family.patch} (97%)
 rename meta-networking/recipes-filter/libnftnl/{libnftnl_1.1.4.bb => libnftnl_1.1.5.bb} (64%)
meta-networking/recipes-filter/libnftnl/libnftnl/0001-Move-exports-before-symbol-definition.patch deleted +0 -294
deleted file mode 100644
index 699d0d922b..0000000000
@@ -1,294 +0,0 @@
-From 6b76c76e6b3f93c422d666f49ee68df9d5426078 Mon Sep 17 00:00:00 2001
-From: Alex Kiernan <[email protected]>
-Date: Wed, 7 Nov 2018 21:19:53 +0000
-Subject: [PATCH] Move exports before symbol definition
-
-Based on 7966020 ("src: Fix exporting symbols with clang"), when
-EXPORT_SYMBOL is located after function definition, clang won't properly
-export the function, resulting in a library with no symbols when built with
-clang.
-
-Signed-off-by: Alex Kiernan <[email protected]>
----
- src/flowtable.c | 54 ++++++++++++++++++++++++-------------------------
- 1 file changed, 27 insertions(+), 27 deletions(-)
-
-diff --git a/src/flowtable.c b/src/flowtable.c
-index 1f7ba30..80de952 100644
---- a/src/flowtable.c
-+++ b/src/flowtable.c
-@@ -34,12 +34,13 @@ struct nftnl_flowtable {
- 	uint32_t		flags;
- };
- 
-+EXPORT_SYMBOL(nftnl_flowtable_alloc);
- struct nftnl_flowtable *nftnl_flowtable_alloc(void)
- {
- 	return calloc(1, sizeof(struct nftnl_flowtable));
- }
--EXPORT_SYMBOL(nftnl_flowtable_alloc);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_free);
- void nftnl_flowtable_free(const struct nftnl_flowtable *c)
- {
- 	int i;
-@@ -56,14 +57,14 @@ void nftnl_flowtable_free(const struct nftnl_flowtable *c)
- 	}
- 	xfree(c);
- }
--EXPORT_SYMBOL(nftnl_flowtable_free);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_is_set);
- bool nftnl_flowtable_is_set(const struct nftnl_flowtable *c, uint16_t attr)
- {
- 	return c->flags & (1 << attr);
- }
--EXPORT_SYMBOL(nftnl_flowtable_is_set);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_unset);
- void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr)
- {
- 	int i;
-@@ -95,7 +96,6 @@ void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr)
- 
- 	c->flags &= ~(1 << attr);
- }
--EXPORT_SYMBOL(nftnl_flowtable_unset);
- 
- static uint32_t nftnl_flowtable_validate[NFTNL_FLOWTABLE_MAX + 1] = {
- 	[NFTNL_FLOWTABLE_HOOKNUM]	= sizeof(uint32_t),
-@@ -104,6 +104,7 @@ static uint32_t nftnl_flowtable_validate[NFTNL_FLOWTABLE_MAX + 1] = {
- 	[NFTNL_FLOWTABLE_FLAGS]		= sizeof(uint32_t),
- };
- 
-+EXPORT_SYMBOL(nftnl_flowtable_set_data);
- int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
- 			     const void *data, uint32_t data_len)
- {
-@@ -169,32 +170,32 @@ int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr,
- 	c->flags |= (1 << attr);
- 	return 0;
- }
--EXPORT_SYMBOL(nftnl_flowtable_set_data);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_set);
- void nftnl_flowtable_set(struct nftnl_flowtable *c, uint16_t attr, const void *data)
- {
- 	nftnl_flowtable_set_data(c, attr, data, nftnl_flowtable_validate[attr]);
- }
--EXPORT_SYMBOL(nftnl_flowtable_set);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_set_u32);
- void nftnl_flowtable_set_u32(struct nftnl_flowtable *c, uint16_t attr, uint32_t data)
- {
- 	nftnl_flowtable_set_data(c, attr, &data, sizeof(uint32_t));
- }
--EXPORT_SYMBOL(nftnl_flowtable_set_u32);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_set_s32);
- void nftnl_flowtable_set_s32(struct nftnl_flowtable *c, uint16_t attr, int32_t data)
- {
- 	nftnl_flowtable_set_data(c, attr, &data, sizeof(int32_t));
- }
--EXPORT_SYMBOL(nftnl_flowtable_set_s32);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_set_str);
- int nftnl_flowtable_set_str(struct nftnl_flowtable *c, uint16_t attr, const char *str)
- {
- 	return nftnl_flowtable_set_data(c, attr, str, strlen(str) + 1);
- }
--EXPORT_SYMBOL(nftnl_flowtable_set_str);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_get_data);
- const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c,
- 				     uint16_t attr, uint32_t *data_len)
- {
-@@ -228,21 +229,21 @@ const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c,
- 	}
- 	return NULL;
- }
--EXPORT_SYMBOL(nftnl_flowtable_get_data);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_get);
- const void *nftnl_flowtable_get(const struct nftnl_flowtable *c, uint16_t attr)
- {
- 	uint32_t data_len;
- 	return nftnl_flowtable_get_data(c, attr, &data_len);
- }
--EXPORT_SYMBOL(nftnl_flowtable_get);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_get_str);
- const char *nftnl_flowtable_get_str(const struct nftnl_flowtable *c, uint16_t attr)
- {
- 	return nftnl_flowtable_get(c, attr);
- }
--EXPORT_SYMBOL(nftnl_flowtable_get_str);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_get_u32);
- uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr)
- {
- 	uint32_t data_len = 0;
-@@ -252,8 +253,8 @@ uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr)
- 
- 	return val ? *val : 0;
- }
--EXPORT_SYMBOL(nftnl_flowtable_get_u32);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_get_s32);
- int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr)
- {
- 	uint32_t data_len = 0;
-@@ -263,8 +264,8 @@ int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr)
- 
- 	return val ? *val : 0;
- }
--EXPORT_SYMBOL(nftnl_flowtable_get_s32);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_build_payload);
- void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh,
- 					 const struct nftnl_flowtable *c)
- {
-@@ -300,7 +301,6 @@ void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh,
- 	if (c->flags & (1 << NFTNL_FLOWTABLE_SIZE))
- 		mnl_attr_put_u32(nlh, NFTA_FLOWTABLE_SIZE, htonl(c->size));
- }
--EXPORT_SYMBOL(nftnl_flowtable_nlmsg_build_payload);
- 
- static int nftnl_flowtable_parse_attr_cb(const struct nlattr *attr, void *data)
- {
-@@ -415,6 +415,7 @@ static int nftnl_flowtable_parse_hook(struct nlattr *attr, struct nftnl_flowtabl
- 	return 0;
- }
- 
-+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_parse);
- int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtable *c)
- {
- 	struct nlattr *tb[NFTA_FLOWTABLE_MAX + 1] = {};
-@@ -463,7 +464,6 @@ int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtab
- 
- 	return ret;
- }
--EXPORT_SYMBOL(nftnl_flowtable_nlmsg_parse);
- 
- static const char *nftnl_hooknum2str(int family, int hooknum)
- {
-@@ -516,14 +516,15 @@ static inline int nftnl_str2hooknum(int family, const char *hook)
- 	return -1;
- }
- 
-+EXPORT_SYMBOL(nftnl_flowtable_parse);
- int nftnl_flowtable_parse(struct nftnl_flowtable *c, enum nftnl_parse_type type,
- 			  const char *data, struct nftnl_parse_err *err)
- {
- 	errno = EOPNOTSUPP;
- 	return -1;
- }
--EXPORT_SYMBOL(nftnl_flowtable_parse);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_parse_file);
- int nftnl_flowtable_parse_file(struct nftnl_flowtable *c,
- 			       enum nftnl_parse_type type,
- 			       FILE *fp, struct nftnl_parse_err *err)
-@@ -531,7 +532,6 @@ int nftnl_flowtable_parse_file(struct nftnl_flowtable *c,
- 	errno = EOPNOTSUPP;
- 	return -1;
- }
--EXPORT_SYMBOL(nftnl_flowtable_parse_file);
- 
- static int nftnl_flowtable_snprintf_default(char *buf, size_t size,
- 					    const struct nftnl_flowtable *c)
-@@ -587,6 +587,7 @@ static int nftnl_flowtable_cmd_snprintf(char *buf, size_t size,
- 	return offset;
- }
- 
-+EXPORT_SYMBOL(nftnl_flowtable_snprintf);
- int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtable *c,
- 			 uint32_t type, uint32_t flags)
- {
-@@ -596,7 +597,6 @@ int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtabl
- 	return nftnl_flowtable_cmd_snprintf(buf, size, c, nftnl_flag2cmd(flags),
- 					    type, flags);
- }
--EXPORT_SYMBOL(nftnl_flowtable_snprintf);
- 
- static int nftnl_flowtable_do_snprintf(char *buf, size_t size, const void *c,
- 				   uint32_t cmd, uint32_t type, uint32_t flags)
-@@ -604,18 +604,19 @@ static int nftnl_flowtable_do_snprintf(char *buf, size_t size, const void *c,
- 	return nftnl_flowtable_snprintf(buf, size, c, type, flags);
- }
- 
-+EXPORT_SYMBOL(nftnl_flowtable_fprintf);
- int nftnl_flowtable_fprintf(FILE *fp, const struct nftnl_flowtable *c,
- 			    uint32_t type, uint32_t flags)
- {
- 	return nftnl_fprintf(fp, c, NFTNL_CMD_UNSPEC, type, flags,
- 			   nftnl_flowtable_do_snprintf);
- }
--EXPORT_SYMBOL(nftnl_flowtable_fprintf);
- 
- struct nftnl_flowtable_list {
- 	struct list_head list;
- };
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_alloc);
- struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void)
- {
- 	struct nftnl_flowtable_list *list;
-@@ -628,8 +629,8 @@ struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void)
- 
- 	return list;
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_alloc);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_free);
- void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
- {
- 	struct nftnl_flowtable *s, *tmp;
-@@ -640,34 +641,34 @@ void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list)
- 	}
- 	xfree(list);
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_free);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_is_empty);
- int nftnl_flowtable_list_is_empty(const struct nftnl_flowtable_list *list)
- {
- 	return list_empty(&list->list);
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_is_empty);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_add);
- void nftnl_flowtable_list_add(struct nftnl_flowtable *s,
- 			      struct nftnl_flowtable_list *list)
- {
- 	list_add(&s->head, &list->list);
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_add);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_add_tail);
- void nftnl_flowtable_list_add_tail(struct nftnl_flowtable *s,
- 				   struct nftnl_flowtable_list *list)
- {
- 	list_add_tail(&s->head, &list->list);
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_add_tail);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_del);
- void nftnl_flowtable_list_del(struct nftnl_flowtable *s)
- {
- 	list_del(&s->head);
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_del);
- 
-+EXPORT_SYMBOL(nftnl_flowtable_list_foreach);
- int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list,
- 				 int (*cb)(struct nftnl_flowtable *t, void *data), void *data)
- {
-@@ -681,4 +682,3 @@ int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list,
- 	}
- 	return 0;
- }
--EXPORT_SYMBOL(nftnl_flowtable_list_foreach);
--- 
-2.17.1
-
meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch renamed from meta-networking/recipes-filter/libnftnl/libnftnl/0002-avoid-naming-local-function-as-one-of-printf-family.patch +16 -3
similarity index 97%
rename from meta-networking/recipes-filter/libnftnl/libnftnl/0002-avoid-naming-local-function-as-one-of-printf-family.patch
rename to meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch
index e64091b50b..f49ef2a78c 100644
@@ -1,6 +1,6 @@
-From 373e13e28e34b4d415fc096e1c7175f4ecfbf0da Mon Sep 17 00:00:00 2001
-From: Yuan Chao <[email protected]>
-Date: Wed, 21 Aug 2019 11:18:56 +0900
+From e03b003610a176d608da9a02e433e7ded7e4b75f Mon Sep 17 00:00:00 2001
+From: Todd Cunningham <[email protected]>
+Date: Wed, 11 Dec 2019 10:18:56 +1000
 Subject: [PATCH] avoid naming local function as one of printf family
 
 Fixes build issues with clang
@@ -10,6 +10,7 @@ Signed-off-by: Khem Raj <[email protected]>
 Signed-off-by: Alex Kiernan <[email protected]>
 
 Signed-off-by: Yuan Chao <[email protected]>
+Signed-off-by: Todd Cunningham <[email protected]>
 ---
  include/expr_ops.h      | 2 +-
  include/obj.h           | 2 +-
@@ -58,6 +59,7 @@ Signed-off-by: Yuan Chao <[email protected]>
  src/obj/limit.c         | 2 +-
  src/obj/quota.c         | 2 +-
  src/obj/secmark.c       | 2 +-
+ src/obj/synproxy.c      | 2 +-
  src/obj/tunnel.c        | 2 +-
  src/object.c            | 2 +-
  49 files changed, 50 insertions(+), 50 deletions(-)
@@ -613,6 +615,17 @@ index d8c87ee..5307d7e 100644
  					 obj);
  		SNPRINTF_BUFFER_SIZE(ret, remain, offset);
  	}
+diff --git a/src/obj/synproxy.c b/src/obj/synproxy.c
+index 56ebc85..6b5380f 100644
+--- a/src/obj/synproxy.c
++++ b/src/obj/synproxy.c
+@@ -157,5 +157,5 @@ struct obj_ops obj_ops_synproxy = {
+ 	.get		= nftnl_obj_synproxy_get,
+ 	.parse		= nftnl_obj_synproxy_parse,
+ 	.build		= nftnl_obj_synproxy_build,
+-	.snprintf	= nftnl_obj_synproxy_snprintf,
++	.snprintf_	= nftnl_obj_synproxy_snprintf,
+ };
 -- 
 2.17.1
 
meta-networking/recipes-filter/libnftnl/libnftnl_1.1.5.bb renamed from meta-networking/recipes-filter/libnftnl/libnftnl_1.1.4.bb +2 -3
similarity index 64%
rename from meta-networking/recipes-filter/libnftnl/libnftnl_1.1.4.bb
rename to meta-networking/recipes-filter/libnftnl/libnftnl_1.1.5.bb
index 705b6a6c34..e1c2720da8 100644
@@ -4,10 +4,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
 SECTION = "libs"
 DEPENDS = "libmnl"
 
-SRCREV = "7c19dc01a88dbcf9a45fa791cd27a51b563bcf29"
+SRCREV = "a71599dc0ae1a808e970e96850ea83d77f452994"
 SRC_URI = "git://git.netfilter.org/libnftnl \
-           file://0001-Move-exports-before-symbol-definition.patch \
-           file://0002-avoid-naming-local-function-as-one-of-printf-family.patch \
+           file://0001-avoid-naming-local-function-as-one-of-printf-family.patch \
            "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.24.1
author
#2 lore raw

PATCH 1/1 xterm: Fix latent issue found with musl

In reply to Khem Raj

[YOCTO #13691]

Cc Ross Burton <[email protected]>
Cc Armin Kuster <[email protected]>
---
 .../xorg-app/xterm/posix_ptys.patch           | 29 +++++++++++++++++++
 .../recipes-graphics/xorg-app/xterm_351.bb    |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch
meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch new file +29 -0
new file mode 100644
index 0000000000..54020d53e9
@@ -0,0 +1,29 @@
+there is no test to define HAVE_GRANTPT_PTY_ISATTY and
+_POSIX_SOURCE is app-defined not system
+This fix ptys and launching xterm
+
+Upstream-Status: Pending
+
+Suggested By Rich Felker
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/main.c
++++ b/main.c
+@@ -2892,7 +2892,7 @@ get_pty(int *pty, char *from GCC_UNUSED)
+ 	close(opened_tty);
+ 	opened_tty = -1;
+     }
+-#elif defined(HAVE_POSIX_OPENPT) && defined(HAVE_PTSNAME) && defined(HAVE_GRANTPT_PTY_ISATTY)
++#elif defined(HAVE_POSIX_OPENPT) && defined(HAVE_PTSNAME)
+     if ((*pty = posix_openpt(O_RDWR)) >= 0) {
+ 	char *name = ptsname(*pty);
+ 	if (name != 0) {
+@@ -4040,7 +4040,7 @@ spawnXTerm(XtermWidget xw, unsigned line
+ 	    /*
+ 	     * now in child process
+ 	     */
+-#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
++#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
+ 	    int pgrp = setsid();	/* variable may not be used... */
+ #else
+ 	    int pgrp = getpid();
meta-oe/recipes-graphics/xorg-app/xterm_351.bb +3 -1
index 394d2cb9de..abfda8a5fa 100644
@@ -4,7 +4,9 @@ DEPENDS = "libxaw xorgproto libxext libxau libxinerama libxpm ncurses"
 
 LIC_FILES_CHKSUM = "file://xterm.h;beginline=3;endline=31;md5=c7faceb872d90115e7c0ad90e90c390d"
 
-SRC_URI = "http://invisible-mirror.net/archives/${BPN}/${BP}.tgz"
+SRC_URI = "http://invisible-mirror.net/archives/${BPN}/${BP}.tgz \
+           file://posix_ptys.patch \
+          "
 
 SRC_URI[md5sum] = "a07edfbee2e2f4c6a9ddbf834fa4bbec"
 SRC_URI[sha256sum] = "760a8a10221c9c9744afd86db87c7ad95bbf9be4f5f525fecf39125f0d2a6e16"
Signature · 1 line
2.24.1
#3 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 2 lines · Khem Raj

...
+Upstream-Status: Pending

Not upstreamed OE-only musl patches create a technical debt.

Quoted 2 lines

...
+there is no test to define HAVE_GRANTPT_PTY_ISATTY

Is the definition in xterm_io.h not working?

Quoted 2 lines

...
+_POSIX_SOURCE is app-defined not system

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl and glibc due to glibc supporting older POSIX versions, and glibc also supporting developers of portable code to select some specific older POSIX version.

meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch line 29

Quoted 7 lines

...

+-#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
++#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch new file +3 -0
+ 	    int pgrp = setsid();	/* variable may not be used... */
+ #else
+         int pgrp = getpid();
...

So this was caused by musl not supporting older versions of POSIX, where _POSIX_SOURCE was part of the standard.

The proper fix would be an autoconf test for setsid().

cu
Adrian

author
#4 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 15 lines · Adrian Bunk
Quoted 2 lines · Khem Raj

...
+Upstream-Status: Pending

Not upstreamed OE-only musl patches create a technical debt.

Quoted 2 lines

...
+there is no test to define HAVE_GRANTPT_PTY_ISATTY

Is the definition in xterm_io.h not working?

Quoted 2 lines

...
+_POSIX_SOURCE is app-defined not system

Quoted 7 lines

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl and glibc due to glibc supporting older POSIX versions, and glibc also supporting developers of portable code to select some specific older POSIX version.

No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile it's not libc telling you "this is posix" or anything like that. _POSIX_VERSION tells
you that

Quoted 11 lines

meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch line 29

Quoted 7 lines

...

+-#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
++#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
meta-oe/recipes-graphics/xorg-app/xterm/posix_ptys.patch new file +3 -0
+         int pgrp = setsid();        /* variable may not be used... */
+ #else
+         int pgrp = getpid();
...

So this was caused by musl not supporting older versions of POSIX, where _POSIX_SOURCE was part of the standard.

see above.

Quoted 2 lines

The proper fix would be an autoconf test for setsid().

Thats a good idea. I have sent a v2 which adds a configure test got setsid()

Quoted 2 lines

cu
Adrian

#5 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 12 lines · Khem Raj
Quoted 1 line · Adrian Bunk

On Thu, Dec 12, 2019 at 12:22:52PM -0800, Khem Raj wrote:

...

Quoted 9 lines
Quoted 1 line

+_POSIX_SOURCE is app-defined not system

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl and glibc due to glibc supporting older POSIX versions, and glibc also supporting developers of portable code to select some specific older POSIX version.

Quoted 4 lines

No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile it's not libc telling you "this is posix" or anything like that.

It is also defined when _POSIX_C_SOURCE is defined, or _GNU_SOURCE, or when the default non-strict gcc mode is used.

The latter means that it is in practice nearly always defined when the libc supports applications written against older versions of POSIX.

Quoted 2 lines

_POSIX_VERSION tells you that
...

_POSIX_VERSION being defined tells you that you have unistd.h included.

With glibc the value of _POSIX_VERSION depends on what feature/standards profile the application has requested.

cu
Adrian

author
#6 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 18 lines · Adrian Bunk
Quoted 12 lines · Khem Raj
Quoted 1 line · Adrian Bunk

On Thu, Dec 12, 2019 at 12:22:52PM -0800, Khem Raj wrote:

...

Quoted 9 lines
Quoted 1 line

+_POSIX_SOURCE is app-defined not system

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl and glibc due to glibc supporting older POSIX versions, and glibc also supporting developers of portable code to select some specific older POSIX version.

Quoted 4 lines

No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile it's not libc telling you "this is posix" or anything like that.

Quoted 6 lines

It is also defined when _POSIX_C_SOURCE is defined, or _GNU_SOURCE, or when the default non-strict gcc mode is used.

The latter means that it is in practice nearly always defined when the libc supports applications written against older versions of POSIX.

but these macros are not used in this case so its irrelevant here.

Quoted 7 lines
Quoted 2 lines

_POSIX_VERSION tells you that
...

_POSIX_VERSION being defined tells you that you have unistd.h included.

With glibc the value of _POSIX_VERSION depends on what feature/standards profile the application has requested.

I would not look into how glibc does something and call it standard. It guards these definitions by its internal defines ( prefixed with __) which is internal to a libc implementation, applications are not exposed to private namespace.

Quoted 4 lines

cu
Adrian

#7 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 19 lines · Khem Raj
Quoted 18 lines · Adrian Bunk
Quoted 16 lines · Khem Raj
Quoted 1 line · Adrian Bunk

On Thu, Dec 12, 2019 at 12:22:52PM -0800, Khem Raj wrote:

...

Quoted 9 lines
Quoted 1 line

+_POSIX_SOURCE is app-defined not system

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl and glibc due to glibc supporting older POSIX versions, and glibc also supporting developers of portable code to select some specific older POSIX version.

No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile it's not libc telling you "this is posix" or anything like that.

Quoted 7 lines
Quoted 6 lines

It is also defined when _POSIX_C_SOURCE is defined, or _GNU_SOURCE, or when the default non-strict gcc mode is used.

The latter means that it is in practice nearly always defined when the libc supports applications written against older versions of POSIX.

but these macros are not used in this case so its irrelevant here.

No macro has to be used, with gcc default settings _POSIX_SOURCE is defined:

$ cat test.c
#include <unistd.h>
int tmp = _POSIX_SOURCE;
$ gcc -O2 -Wall -c test.c 
$

musl is different, since it does not aim at fully supporting applications that were written against an older version of the POSIX standard.

Quoted 9 lines
Quoted 7 lines
Quoted 2 lines

_POSIX_VERSION tells you that
...

_POSIX_VERSION being defined tells you that you have unistd.h included.

With glibc the value of _POSIX_VERSION depends on what feature/standards profile the application has requested.

I would not look into how glibc does something and call it standard.

I would not look into how musl does something and call it standard.

I checked what musl and glibc do and what the standard says.

Quoted 3 lines

It guards these definitions by its internal defines ( prefixed with __) which is internal to a libc implementation, applications are not exposed to private namespace.

_POSIX_SOURCE is defined in POSIX.1-1990 and mentioned in later versions of POSIX.

_POSIX_VERSION is defined in all(?) versions of POSIX.

cu
Adrian

author
#8 lore raw

Re: [meta-oe][PATCH] xterm: Fix latent issue found with musl

Quoted 26 lines · Adrian Bunk
Quoted 10 lines · Khem Raj
Quoted 9 lines · Adrian Bunk
Quoted 8 lines · Khem Raj
Quoted 1 line · Adrian Bunk

On Thu, Dec 12, 2019 at 12:22:52PM -0800, Khem Raj wrote:

...

Quoted 5 lines
Quoted 1 line

+_POSIX_SOURCE is app-defined not system

This is true for musl, not for glibc.

The handling of _POSIX_SOURCE and _POSIX_VERSION differs between

musl

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

and glibc due to glibc supporting older POSIX versions, and glibc

also

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

supporting developers of portable code to select some specific

older

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 2 lines

POSIX version.

No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile it's not libc telling you "this is posix" or anything like that.

It is also defined when _POSIX_C_SOURCE is defined, or _GNU_SOURCE, or when the default non-strict gcc mode is used.

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

The latter means that it is in practice nearly always defined when the libc supports applications written against older versions of POSIX.

but these macros are not used in this case so its irrelevant here.

No macro has to be used, with gcc default settings _POSIX_SOURCE is defined:

Again this was what I said originally was not correct

Quoted 20 lines

$ cat test.c
#include <unistd.h>
int tmp = _POSIX_SOURCE;
$ gcc -O2 -Wall -c test.c
$

musl is different, since it does not aim at fully supporting applications that were written against an older version of the POSIX standard.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

_POSIX_VERSION tells you that
...

_POSIX_VERSION being defined tells you that you have unistd.h included.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

With glibc the value of _POSIX_VERSION depends on what

feature/standards

Quoted 3 lines
Quoted 1 line

profile the application has requested.

I would not look into how glibc does something and call it standard.

I would not look into how musl does something and call it standard.

Who said that effort is to find common solution

Quoted 5 lines

I checked what musl and glibc do and what the standard says.

Quoted 1 line

It guards these definitions by its internal defines ( prefixed with __)

Quoted 9 lines

which

Quoted 2 lines

is internal to a libc implementation, applications are not exposed to private namespace.

_POSIX_SOURCE is defined in POSIX.1-1990 and mentioned in later versions of POSIX.

_POSIX_VERSION is defined in all(?) versions of POSIX.

Ok thank you

Quoted 4 lines

cu
Adrian