diff options
author | Daniel Engberg <daniel.engberg.lists@pyret.net> | 2018-05-02 10:23:45 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-12-18 11:28:12 +0100 |
commit | 39420c3eadd826cda9e864fa9f436881ec95f6a8 (patch) | |
tree | 40901eb00fc62861b0dae315b03a41e249b90937 /package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch | |
parent | 8ec7ad033efd68b609591cca0584772d95f78d8e (diff) | |
download | upstream-39420c3eadd826cda9e864fa9f436881ec95f6a8.tar.gz upstream-39420c3eadd826cda9e864fa9f436881ec95f6a8.tar.bz2 upstream-39420c3eadd826cda9e864fa9f436881ec95f6a8.zip |
libbsd: Update to 0.8.7
Update libbsd to 0.8.7
Remove glibc dependency
Clean up InstallDev and install entries
Use /usr path for consistency
Cherry pick patches from upstream to fix musl compilation
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(backported from e341f45913beac28e5574d470ed79e4b6f9ee255)
Diffstat (limited to 'package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch')
-rw-r--r-- | package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch b/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch new file mode 100644 index 0000000000..3ce1d654c9 --- /dev/null +++ b/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch @@ -0,0 +1,65 @@ +From 1f8a3f7bccfc84b195218ad0086ebd57049c3490 Mon Sep 17 00:00:00 2001 +From: Guillem Jover <guillem@hadrons.org> +Date: Tue, 6 Mar 2018 01:39:45 +0100 +Subject: Fix function declaration protection for glibc already providing them +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On non-glibc based systems we cannot unconditionally use the +__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead, +if it is undefined, define it to 0. + +We should also always declare these functions on non-glibc based +systems. And on systems with a new enough glibc, which provides these +functions, we should still provide the declarations if _GNU_SOURCE +is *not* defined. + +Reported-by: Jörg Krause <joerg.krause@embedded.rocks> +--- + include/bsd/stdlib.h | 3 ++- + include/bsd/string.h | 3 ++- + include/bsd/sys/cdefs.h | 8 ++++++++ + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/include/bsd/stdlib.h ++++ b/include/bsd/stdlib.h +@@ -71,7 +71,8 @@ int sradixsort(const unsigned char **bas + const unsigned char *table, unsigned endbyte); + + void *reallocf(void *ptr, size_t size); +-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26) ++#if !defined(__GLIBC__) || \ ++ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 26) || !defined(_GNU_SOURCE))) + void *reallocarray(void *ptr, size_t nmemb, size_t size); + #endif + +--- a/include/bsd/string.h ++++ b/include/bsd/string.h +@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *sr + char *strnstr(const char *str, const char *find, size_t str_len); + void strmode(mode_t mode, char *str); + +-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25) ++#if !defined(__GLIBC__) || \ ++ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE))) + void explicit_bzero(void *buf, size_t len); + #endif + __END_DECLS +--- a/include/bsd/sys/cdefs.h ++++ b/include/bsd/sys/cdefs.h +@@ -59,6 +59,14 @@ + #endif + + /* ++ * On non-glibc based systems, we cannot unconditionally use the ++ * __GLIBC_PREREQ macro as it gets expanded before evaluation. ++ */ ++#ifndef __GLIBC_PREREQ ++#define __GLIBC_PREREQ(maj, min) 0 ++#endif ++ ++/* + * Some kFreeBSD headers expect those macros to be set for sanity checks. + */ + #ifndef _SYS_CDEFS_H_ |