aboutsummaryrefslogtreecommitdiffstats
path: root/main/fortify-headers
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-06-04 07:15:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-06-05 13:51:17 +0000
commit11377c9afac8bf9aced1756910eb31cc80dce565 (patch)
tree401c4edeb318e5e9cf03cd4011cda8367400c428 /main/fortify-headers
parent6e1b72b5cd3e62bb418efaae68bd0f50d7391700 (diff)
downloadaports-11377c9afac8bf9aced1756910eb31cc80dce565.tar.bz2
aports-11377c9afac8bf9aced1756910eb31cc80dce565.tar.xz
main/fortify-headers: add fix for gcc5 (gnu11)
ncurses had problem with __inline when building with the new default -std=gnu11.
Diffstat (limited to 'main/fortify-headers')
-rw-r--r--main/fortify-headers/0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch29
-rw-r--r--main/fortify-headers/0002-Use-namespace-safe-macro-param-and-variable-names.patch1032
-rw-r--r--main/fortify-headers/0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch69
-rw-r--r--main/fortify-headers/APKBUILD20
4 files changed, 1146 insertions, 4 deletions
diff --git a/main/fortify-headers/0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch b/main/fortify-headers/0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
new file mode 100644
index 0000000000..1c9eed5b25
--- /dev/null
+++ b/main/fortify-headers/0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
@@ -0,0 +1,29 @@
+From a9ee1d2743acb0b2903db87c0a241c0a569cfc4e Mon Sep 17 00:00:00 2001
+From: Trutz Behn <me@trutz.be>
+Date: Tue, 2 Jun 2015 21:33:39 +0200
+Subject: [PATCH 1/3] Fix usage of __USER_LABEL_PREFIX__
+
+The predefined __USER_LABEL_PREFIX__ macro if it is non-empty contains
+an identifier, not a string literal, thus it needs to be stringified.
+---
+ include/fortify-headers.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/include/fortify-headers.h b/include/fortify-headers.h
+index 72b99ec..fcb862d 100644
+--- a/include/fortify-headers.h
++++ b/include/fortify-headers.h
+@@ -16,7 +16,9 @@
+ #ifndef _FORTIFY_HEADERS_H
+ #define _FORTIFY_HEADERS_H
+
+-#define fortify_fn(fn) __typeof__(fn) __orig_##fn __asm__(__USER_LABEL_PREFIX__ #fn); \
++#define _FORTIFY_STR(s) #s
++#define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
++#define fortify_fn(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
+ extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+
+ #endif
+--
+2.4.2
+
diff --git a/main/fortify-headers/0002-Use-namespace-safe-macro-param-and-variable-names.patch b/main/fortify-headers/0002-Use-namespace-safe-macro-param-and-variable-names.patch
new file mode 100644
index 0000000000..6ae2bd8a8b
--- /dev/null
+++ b/main/fortify-headers/0002-Use-namespace-safe-macro-param-and-variable-names.patch
@@ -0,0 +1,1032 @@
+From 1cd5461a5375207602f2cbdfd9a50a9b751cb7c8 Mon Sep 17 00:00:00 2001
+From: Trutz Behn <me@trutz.be>
+Date: Wed, 3 Jun 2015 19:27:01 +0200
+Subject: [PATCH 2/3] Use namespace-safe macro, param and variable names
+
+---
+ include/fortify-headers.h | 2 +-
+ include/poll.h | 18 ++---
+ include/stdio.h | 78 ++++++++++----------
+ include/stdlib.h | 12 +--
+ include/string.h | 124 +++++++++++++++----------------
+ include/strings.h | 18 ++---
+ include/sys/select.h | 16 ++--
+ include/sys/socket.h | 36 ++++-----
+ include/unistd.h | 96 ++++++++++++------------
+ include/wchar.h | 182 +++++++++++++++++++++++-----------------------
+ 10 files changed, 291 insertions(+), 291 deletions(-)
+
+diff --git a/include/fortify-headers.h b/include/fortify-headers.h
+index fcb862d..288a973 100644
+--- a/include/fortify-headers.h
++++ b/include/fortify-headers.h
+@@ -18,7 +18,7 @@
+
+ #define _FORTIFY_STR(s) #s
+ #define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
+-#define fortify_fn(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
++#define _FORTIFY_FN(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
+ extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+
+ #endif
+diff --git a/include/poll.h b/include/poll.h
+index 6ca08a7..d9b602c 100644
+--- a/include/poll.h
++++ b/include/poll.h
+@@ -27,25 +27,25 @@ extern "C" {
+
+ #undef poll
+
+-fortify_fn(poll) int poll(struct pollfd *fds, nfds_t nfds, int timeout)
++_FORTIFY_FN(poll) int poll(struct pollfd *__f, nfds_t __n, int __s)
+ {
+- __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
++ __typeof__(sizeof 0) __b = __builtin_object_size(__f, 0);
+
+- if (nfds > bos / sizeof(struct pollfd))
++ if (__n > __b / sizeof(struct pollfd))
+ __builtin_trap();
+- return __orig_poll(fds, nfds, timeout);
++ return __orig_poll(__f, __n, __s);
+ }
+
+ #ifdef _GNU_SOURCE
+ #undef ppoll
+-fortify_fn(ppoll) int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+- const sigset_t *mask)
++_FORTIFY_FN(ppoll) int ppoll(struct pollfd *__f, nfds_t __n, const struct timespec *__s,
++ const sigset_t *__m)
+ {
+- __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
++ __typeof__(sizeof 0) __b = __builtin_object_size(__f, 0);
+
+- if (nfds > bos / sizeof(struct pollfd))
++ if (__n > __b / sizeof(struct pollfd))
+ __builtin_trap();
+- return __orig_ppoll(fds, nfds, timeout, mask);
++ return __orig_ppoll(__f, __n, __s, __m);
+ }
+ #endif
+
+diff --git a/include/stdio.h b/include/stdio.h
+index 6689519..996c661 100644
+--- a/include/stdio.h
++++ b/include/stdio.h
+@@ -33,84 +33,84 @@ extern "C" {
+ #undef snprintf
+ #undef sprintf
+
+-fortify_fn(fgets) char *fgets(char *s, int n, FILE *fp)
++_FORTIFY_FN(fgets) char *fgets(char *__s, int __n, FILE *__f)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if ((size_t)n > bos)
++ if ((size_t)__n > __b)
+ __builtin_trap();
+- return __orig_fgets(s, n, fp);
++ return __orig_fgets(__s, __n, __f);
+ }
+
+-fortify_fn(fread) size_t fread(void *dst, size_t n, size_t nmemb, FILE *fp)
++_FORTIFY_FN(fread) size_t fread(void *__d, size_t __n, size_t __m, FILE *__f)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n != 0 && (n * nmemb) / n != nmemb)
++ if (__n != 0 && (__n * __m) / __n != __m)
+ __builtin_trap();
+- if (n * nmemb > bos)
++ if (__n * __m > __b)
+ __builtin_trap();
+- return __orig_fread(dst, n, nmemb, fp);
++ return __orig_fread(__d, __n, __m, __f);
+ }
+
+-fortify_fn(fwrite) size_t fwrite(const void *dst, size_t n, size_t nmemb, FILE *fp)
++_FORTIFY_FN(fwrite) size_t fwrite(const void *__d, size_t __n, size_t __m, FILE *__f)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n != 0 && (n * nmemb) / n != nmemb)
++ if (__n != 0 && (__n * __m) / __n != __m)
+ __builtin_trap();
+- if (n * nmemb > bos)
++ if (__n * __m > __b)
+ __builtin_trap();
+- return __orig_fwrite(dst, n, nmemb, fp);
++ return __orig_fwrite(__d, __n, __m, __f);
+ }
+
+-fortify_fn(vsnprintf) int vsnprintf(char *s, size_t n, const char *fmt,
+- __builtin_va_list ap)
++_FORTIFY_FN(vsnprintf) int vsnprintf(char *__s, size_t __n, const char *__f,
++ __builtin_va_list __v)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_vsnprintf(s, n, fmt, ap);
++ return __orig_vsnprintf(__s, __n, __f, __v);
+ }
+
+-fortify_fn(vsprintf) int vsprintf(char *s, const char *fmt, __builtin_va_list ap)
++_FORTIFY_FN(vsprintf) int vsprintf(char *__s, const char *__f, __builtin_va_list __v)
+ {
+- size_t bos = __builtin_object_size(s, 0);
+- int r;
++ size_t __b = __builtin_object_size(__s, 0);
++ int __r;
+
+- if (bos != (size_t)-1) {
+- r = __orig_vsnprintf(s, bos, fmt, ap);
+- if (r != -1 && (size_t)r >= bos)
++ if (__b != (size_t)-1) {
++ __r = __orig_vsnprintf(__s, __b, __f, __v);
++ if (__r != -1 && (size_t)__r >= __b)
+ __builtin_trap();
+ } else {
+- r = __orig_vsprintf(s, fmt, ap);
++ __r = __orig_vsprintf(__s, __f, __v);
+ }
+- return r;
++ return __r;
+ }
+
+-fortify_fn(snprintf) int snprintf(char *s, size_t n, const char *fmt, ...)
++_FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, const char *__f, ...)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_snprintf(s, n, fmt, __builtin_va_arg_pack());
++ return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
+ }
+
+-fortify_fn(sprintf) int sprintf(char *s, const char *fmt, ...)
++_FORTIFY_FN(sprintf) int sprintf(char *__s, const char *__f, ...)
+ {
+- size_t bos = __builtin_object_size(s, 0);
+- int r;
++ size_t __b = __builtin_object_size(__s, 0);
++ int __r;
+
+- if (bos != (size_t)-1) {
+- r = __orig_snprintf(s, bos, fmt, __builtin_va_arg_pack());
+- if (r != -1 && (size_t)r >= bos)
++ if (__b != (size_t)-1) {
++ __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
++ if (__r != -1 && (size_t)__r >= __b)
+ __builtin_trap();
+ } else {
+- r = __orig_sprintf(s, fmt, __builtin_va_arg_pack());
++ __r = __orig_sprintf(__s, __f, __builtin_va_arg_pack());
+ }
+- return r;
++ return __r;
+ }
+
+ #ifdef __cplusplus
+diff --git a/include/stdlib.h b/include/stdlib.h
+index 5566ab4..2b67235 100644
+--- a/include/stdlib.h
++++ b/include/stdlib.h
+@@ -31,20 +31,20 @@ extern "C" {
+
+ #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+ #undef realpath
+-fortify_fn(realpath) char *realpath(const char *path, char *resolved)
++_FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
+ {
+- size_t bos;
++ size_t __b;
+
+- if (resolved) {
++ if (__r) {
+ #ifndef PATH_MAX
+ #error PATH_MAX unset. A fortified realpath will not work.
+ #else
+- bos = __builtin_object_size(resolved, 0);
+- if (PATH_MAX > bos)
++ __b = __builtin_object_size(__r, 0);
++ if (PATH_MAX > __b)
+ __builtin_trap();
+ #endif
+ }
+- return __orig_realpath(path, resolved);
++ return __orig_realpath(__p, __r);
+ }
+ #endif
+
+diff --git a/include/string.h b/include/string.h
+index 5db7ac9..98bfea1 100644
+--- a/include/string.h
++++ b/include/string.h
+@@ -33,141 +33,141 @@ extern "C" {
+ #undef strncat
+ #undef strncpy
+
+-fortify_fn(memcpy) void *memcpy(void *dst, const void *src, size_t n)
++_FORTIFY_FN(memcpy) void *memcpy(void *__od, const void *__os, size_t __n)
+ {
+- size_t bos_dst = __builtin_object_size(dst, 0);
+- size_t bos_src = __builtin_object_size(src, 0);
+- char *d = (char *)dst;
+- const char *s = (const char *)src;
++ size_t __bd = __builtin_object_size(__od, 0);
++ size_t __bs = __builtin_object_size(__os, 0);
++ char *__d = (char *)__od;
++ const char *__s = (const char *)__os;
+
+ /* trap if pointers are overlapping but not if dst == src.
+ * gcc seems to like to generate code that relies on dst == src */
+- if ((d < s && d + n > s) ||
+- (s < d && s + n > d))
++ if ((__d < __s && __d + __n > __s) ||
++ (__s < __d && __s + __n > __d))
+ __builtin_trap();
+- if (n > bos_dst || n > bos_src)
++ if (__n > __bd || __n > __bs)
+ __builtin_trap();
+- return __orig_memcpy(dst, src, n);
++ return __orig_memcpy(__od, __os, __n);
+ }
+
+-fortify_fn(memmove) void *memmove(void *dst, const void *src, size_t n)
++_FORTIFY_FN(memmove) void *memmove(void *__d, const void *__s, size_t __n)
+ {
+- size_t bos_dst = __builtin_object_size(dst, 0);
+- size_t bos_src = __builtin_object_size(src, 0);
++ size_t __bd = __builtin_object_size(__d, 0);
++ size_t __bs = __builtin_object_size(__s, 0);
+
+- if (n > bos_dst || n > bos_src)
++ if (__n > __bd || __n > __bs)
+ __builtin_trap();
+- return __orig_memmove(dst, src, n);
++ return __orig_memmove(__d, __s, __n);
+ }
+
+-fortify_fn(memset) void *memset(void *dst, int c, size_t n)
++_FORTIFY_FN(memset) void *memset(void *__d, int __c, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_memset(dst, c, n);
++ return __orig_memset(__d, __c, __n);
+ }
+
+ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+ #undef stpcpy
+-fortify_fn(stpcpy) char *stpcpy(char *dst, const char *src)
++_FORTIFY_FN(stpcpy) char *stpcpy(char *__d, const char *__s)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (strlen(src) + 1 > bos)
++ if (strlen(__s) + 1 > __b)
+ __builtin_trap();
+- return __orig_stpcpy(dst, src);
++ return __orig_stpcpy(__d, __s);
+ }
+
+ #undef stpncpy
+-fortify_fn(stpncpy) char *stpncpy(char *dst, const char *src, size_t n)
++_FORTIFY_FN(stpncpy) char *stpncpy(char *__d, const char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_stpncpy(dst, src, n);
++ return __orig_stpncpy(__d, __s, __n);
+ }
+ #endif
+
+-fortify_fn(strcat) char *strcat(char *dst, const char *src)
++_FORTIFY_FN(strcat) char *strcat(char *__d, const char *__s)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (strlen(src) + strlen(dst) + 1 > bos)
++ if (strlen(__s) + strlen(__d) + 1 > __b)
+ __builtin_trap();
+- return __orig_strcat(dst, src);
++ return __orig_strcat(__d, __s);
+ }
+
+-fortify_fn(strcpy) char *strcpy(char *dst, const char *src)
++_FORTIFY_FN(strcpy) char *strcpy(char *__d, const char *__s)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (strlen(src) + 1 > bos)
++ if (strlen(__s) + 1 > __b)
+ __builtin_trap();
+- return __orig_strcpy(dst, src);
++ return __orig_strcpy(__d, __s);
+ }
+
+-fortify_fn(strncat) char *strncat(char *dst, const char *src, size_t n)
++_FORTIFY_FN(strncat) char *strncat(char *__d, const char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
+- size_t slen, dlen;
+-
+- if (n > bos) {
+- slen = strlen(src);
+- dlen = strlen(dst);
+- if (slen > n)
+- slen = n;
+- if (slen + dlen + 1 > bos)
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __sl, __dl;
++
++ if (__n > __b) {
++ __sl = strlen(__s);
++ __dl = strlen(__d);
++ if (__sl > __n)
++ __sl = __n;
++ if (__sl + __dl + 1 > __b)
+ __builtin_trap();
+ }
+- return __orig_strncat(dst, src, n);
++ return __orig_strncat(__d, __s, __n);
+ }
+
+-fortify_fn(strncpy) char *strncpy(char *dst, const char *src, size_t n)
++_FORTIFY_FN(strncpy) char *strncpy(char *__d, const char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_strncpy(dst, src, n);
++ return __orig_strncpy(__d, __s, __n);
+ }
+
+ #ifdef _GNU_SOURCE
+ #undef mempcpy
+-fortify_fn(mempcpy) void *mempcpy(void *dst, const void *src, size_t n)
++_FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n)
+ {
+- size_t bos_dst = __builtin_object_size(dst, 0);
+- size_t bos_src = __builtin_object_size(src, 0);
++ size_t __bd = __builtin_object_size(__d, 0);
++ size_t __bs = __builtin_object_size(__s, 0);
+
+- if (n > bos_dst || n > bos_src)
++ if (__n > __bd || __n > __bs)
+ __builtin_trap();
+- return __orig_mempcpy(dst, src, n);
++ return __orig_mempcpy(__d, __s, __n);
+ }
+ #endif
+
+ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+ #undef strlcat
+ #undef strlcpy
+-fortify_fn(strlcat) size_t strlcat(char *dst, const char *src, size_t n)
++_FORTIFY_FN(strlcat) size_t strlcat(char *__d, const char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_strlcat(dst, src, n);
++ return __orig_strlcat(__d, __s, __n);
+ }
+
+-fortify_fn(strlcpy) size_t strlcpy(char *dst, const char *src, size_t n)
++_FORTIFY_FN(strlcpy) size_t strlcpy(char *__d, const char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(dst, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_strlcpy(dst, src, n);
++ return __orig_strlcpy(__d, __s, __n);
+ }
+ #endif
+
+diff --git a/include/strings.h b/include/strings.h
+index ed8efdb..4eb5486 100644
+--- a/include/strings.h
++++ b/include/strings.h
+@@ -30,23 +30,23 @@ extern "C" {
+ || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
+ #undef bcopy
+ #undef bzero
+-fortify_fn(bcopy) void bcopy(const void *src, void *dst, size_t n)
++_FORTIFY_FN(bcopy) void bcopy(const void *__s, void *__d, size_t __n)
+ {
+- size_t bos_dst = __builtin_object_size(dst, 0);
+- size_t bos_src = __builtin_object_size(src, 0);
++ size_t __bd = __builtin_object_size(__d, 0);
++ size_t __bs = __builtin_object_size(__s, 0);
+
+- if (n > bos_dst || n > bos_src)
++ if (__n > __bd || __n > __bs)
+ __builtin_trap();
+- return __orig_bcopy(src, dst, n);
++ return __orig_bcopy(__s, __d, __n);
+ }
+
+-fortify_fn(bzero) void bzero(void *src, size_t n)
++_FORTIFY_FN(bzero) void bzero(void *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(src, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_bzero(src, n);
++ return __orig_bzero(__s, __n);
+ }
+ #endif
+
+diff --git a/include/sys/select.h b/include/sys/select.h
+index 0f1e1df..4623071 100644
+--- a/include/sys/select.h
++++ b/include/sys/select.h
+@@ -25,23 +25,23 @@ extern "C" {
+ #endif
+
+ static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+-void __fortify_FD_CLR(int fd, fd_set *set)
++void __fortify_FD_CLR(int __f, fd_set *__s)
+ {
+- size_t bos = __builtin_object_size(set, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set))
++ if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set))
+ __builtin_trap();
+- FD_CLR(fd, set);
++ FD_CLR(__f, __s);
+ }
+
+ static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+-void __fortify_FD_SET(int fd, fd_set *set)
++void __fortify_FD_SET(int __f, fd_set *__s)
+ {
+- size_t bos = __builtin_object_size(set, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set))
++ if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set))
+ __builtin_trap();
+- FD_SET(fd, set);
++ FD_SET(__f, __s);
+ }
+
+ #undef FD_CLR
+diff --git a/include/sys/socket.h b/include/sys/socket.h
+index c6e4c35..e68e21c 100644
+--- a/include/sys/socket.h
++++ b/include/sys/socket.h
+@@ -30,42 +30,42 @@ extern "C" {
+ #undef send
+ #undef sendto
+
+-fortify_fn(recv) ssize_t recv(int sockfd, void *buf, size_t n, int flags)
++_FORTIFY_FN(recv) ssize_t recv(int __f, void *__s, size_t __n, int __fl)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_recv(sockfd, buf, n, flags);
++ return __orig_recv(__f, __s, __n, __fl);
+ }
+
+-fortify_fn(recvfrom) ssize_t recvfrom(int sockfd, void *buf, size_t n, int flags,
+- struct sockaddr *sa, socklen_t *salen)
++_FORTIFY_FN(recvfrom) ssize_t recvfrom(int __f, void *__s, size_t __n, int __fl,
++ struct sockaddr *__a, socklen_t *__l)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_recvfrom(sockfd, buf, n, flags, sa, salen);
++ return __orig_recvfrom(__f, __s, __n, __fl, __a, __l);
+ }
+
+-fortify_fn(send) ssize_t send(int sockfd, const void *buf, size_t n, int flags)
++_FORTIFY_FN(send) ssize_t send(int __f, const void *__s, size_t __n, int __fl)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_send(sockfd, buf, n, flags);
++ return __orig_send(__f, __s, __n, __fl);
+ }
+
+-fortify_fn(sendto) ssize_t sendto(int sockfd, const void *buf, size_t n, int flags,
+- const struct sockaddr *sa, socklen_t salen)
++_FORTIFY_FN(sendto) ssize_t sendto(int __f, const void *__s, size_t __n, int __fl,
++ const struct sockaddr *__a, socklen_t __l)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_sendto(sockfd, buf, n, flags, sa, salen);
++ return __orig_sendto(__f, __s, __n, __fl, __a, __l);
+ }
+
+ #ifdef __cplusplus
+diff --git a/include/unistd.h b/include/unistd.h
+index 7986e52..45304e1 100644
+--- a/include/unistd.h
++++ b/include/unistd.h
+@@ -37,115 +37,115 @@ extern "C" {
+ #undef ttyname_r
+ #undef write
+
+-fortify_fn(confstr) size_t confstr(int name, char *buf, size_t len)
++_FORTIFY_FN(confstr) size_t confstr(int __n, char *__s, size_t __l)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos)
++ if (__l > __b)
+ __builtin_trap();
+- return __orig_confstr(name, buf, len);
++ return __orig_confstr(__n, __s, __l);
+ }
+
+-fortify_fn(getcwd) char *getcwd(char *buf, size_t len)
++_FORTIFY_FN(getcwd) char *getcwd(char *__s, size_t __l)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos)
++ if (__l > __b)
+ __builtin_trap();
+- return __orig_getcwd(buf, len);
++ return __orig_getcwd(__s, __l);
+ }
+
+ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+ #undef getdomainname
+-fortify_fn(getdomainname) int getdomainname(char *name, size_t len)
++_FORTIFY_FN(getdomainname) int getdomainname(char *__s, size_t __l)
+ {
+- size_t bos = __builtin_object_size(name, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos)
++ if (__l > __b)
+ __builtin_trap();
+- return __orig_getdomainname(name, len);
++ return __orig_getdomainname(__s, __l);
+ }
+ #endif
+
+-fortify_fn(getgroups) int getgroups(int len, gid_t *set)
++_FORTIFY_FN(getgroups) int getgroups(int __l, gid_t *__s)
+ {
+- size_t bos = __builtin_object_size(set, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos / sizeof(gid_t))
++ if (__l > __b / sizeof(gid_t))
+ __builtin_trap();
+- return __orig_getgroups(len, set);
++ return __orig_getgroups(__l, __s);
+ }
+
+-fortify_fn(gethostname) int gethostname(char *name, size_t len)
++_FORTIFY_FN(gethostname) int gethostname(char *__s, size_t __l)
+ {
+- size_t bos = __builtin_object_size(name, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos)
++ if (__l > __b)
+ __builtin_trap();
+- return __orig_gethostname(name, len);
++ return __orig_gethostname(__s, __l);
+ }
+
+-fortify_fn(getlogin_r) int getlogin_r(char *name, size_t len)
++_FORTIFY_FN(getlogin_r) int getlogin_r(char *__s, size_t __l)
+ {
+- size_t bos = __builtin_object_size(name, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (len > bos)
++ if (__l > __b)
+ __builtin_trap();
+- return __orig_getlogin_r(name, len);
++ return __orig_getlogin_r(__s, __l);
+ }
+
+-fortify_fn(pread) ssize_t pread(int fd, void *buf, size_t n, off_t offset)
++_FORTIFY_FN(pread) ssize_t pread(int __f, void *__s, size_t __n, off_t __o)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_pread(fd, buf, n, offset);
++ return __orig_pread(__f, __s, __n, __o);
+ }
+
+-fortify_fn(read) ssize_t read(int fd, void *buf, size_t n)
++_FORTIFY_FN(read) ssize_t read(int __f, void *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_read(fd, buf, n);
++ return __orig_read(__f, __s, __n);
+ }
+
+-fortify_fn(readlink) ssize_t readlink(const char *path, char *buf, size_t n)
++_FORTIFY_FN(readlink) ssize_t readlink(const char *__p, char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_readlink(path, buf, n);
++ return __orig_readlink(__p, __s, __n);
+ }
+
+-fortify_fn(readlinkat) ssize_t readlinkat(int fd, const char *path, char *buf, size_t n)
++_FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p, char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_readlinkat(fd, path, buf, n);
++ return __orig_readlinkat(__f, __p, __s, __n);
+ }
+
+-fortify_fn(ttyname_r) int ttyname_r(int fd, char *name, size_t n)
++_FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(name, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_ttyname_r(fd, name, n);
++ return __orig_ttyname_r(__f, __s, __n);
+ }
+
+-fortify_fn(write) ssize_t write(int fd, const void *buf, size_t n)
++_FORTIFY_FN(write) ssize_t write(int __f, const void *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(buf, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos)
++ if (__n > __b)
+ __builtin_trap();
+- return __orig_write(fd, buf, n);
++ return __orig_write(__f, __s, __n);
+ }
+
+ #ifdef __cplusplus
+diff --git a/include/wchar.h b/include/wchar.h
+index 64618f1..6fa86f2 100644
+--- a/include/wchar.h
++++ b/include/wchar.h
+@@ -41,190 +41,190 @@ extern "C" {
+ #undef wmemmove
+ #undef wmemset
+
+-fortify_fn(fgetws) wchar_t *fgetws(wchar_t *s, int n, FILE *fp)
++_FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t *__s, int __n, FILE *__f)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if ((size_t)n > bos / sizeof(wchar_t))
++ if ((size_t)__n > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_fgetws(s, n, fp);
++ return __orig_fgetws(__s, __n, __f);
+ }
+
+ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+ #undef mbsnrtowcs
+-fortify_fn(mbsnrtowcs) size_t mbsnrtowcs(wchar_t *d, const char **s, size_t n,
+- size_t wn, mbstate_t *st)
++_FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t *__d, const char **__s, size_t __n,
++ size_t __wn, mbstate_t *__st)
+ {
+- size_t bos = __builtin_object_size(d, 0);
+- size_t r;
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __r;
+
+- if (wn > n / sizeof(wchar_t)) {
+- bos /= sizeof(wchar_t);
+- r = __orig_mbsnrtowcs(d, s, n, wn > bos ? bos : wn, st);
+- if (bos < wn && d && *s && r != (size_t)-1)
++ if (__wn > __n / sizeof(wchar_t)) {
++ __b /= sizeof(wchar_t);
++ __r = __orig_mbsnrtowcs(__d, __s, __n, __wn > __b ? __b : __wn, __st);
++ if (__b < __wn && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+ } else {
+- r = __orig_mbsnrtowcs(d, s, n > bos ? bos : n, wn, st);
+- if (bos < n && d && *s && r != (size_t)-1)
++ __r = __orig_mbsnrtowcs(__d, __s, __n > __b ? __b : __n, __wn, __st);
++ if (__b < __n && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+ }
+- return r;
++ return __r;
+ }
+ #endif
+
+-fortify_fn(mbsrtowcs) size_t mbsrtowcs(wchar_t *d, const char **s, size_t wn,
+- mbstate_t *st)
++_FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t *__d, const char **__s, size_t __wn,
++ mbstate_t *__st)
+ {
+- size_t bos = __builtin_object_size(d, 0);
+- size_t r;
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __r;
+
+- bos /= sizeof(wchar_t);
+- r = __orig_mbsrtowcs(d, s, wn > bos ? bos : wn, st);
+- if (bos < wn && d && *s && r != (size_t)-1)
++ __b /= sizeof(wchar_t);
++ __r = __orig_mbsrtowcs(__d, __s, __wn > __b ? __b : __wn, __st);
++ if (__b < __wn && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+- return r;
++ return __r;
+ }
+
+-fortify_fn(mbstowcs) size_t mbstowcs(wchar_t *ws, const char *s, size_t wn)
++_FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t *__ws, const char *__s, size_t __wn)
+ {
+- size_t bos = __builtin_object_size(ws, 0);
++ size_t __b = __builtin_object_size(__ws, 0);
+
+- if (ws && wn > bos / sizeof(wchar_t))
++ if (__ws && __wn > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_mbstowcs(ws, s, wn);
++ return __orig_mbstowcs(__ws, __s, __wn);
+ }
+
+-fortify_fn(wcrtomb) size_t wcrtomb(char *s, wchar_t wc, mbstate_t *st)
++_FORTIFY_FN(wcrtomb) size_t wcrtomb(char *__s, wchar_t __w, mbstate_t *__st)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (s && MB_CUR_MAX > bos)
++ if (__s && MB_CUR_MAX > __b)
+ __builtin_trap();
+- return __orig_wcrtomb(s, wc, st);
++ return __orig_wcrtomb(__s, __w, __st);
+ }
+
+-fortify_fn(wcscat) wchar_t *wcscat(wchar_t *d, const wchar_t *s)
++_FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t *__d, const wchar_t *__s)
+ {
+- size_t bos = __builtin_object_size(d, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (wcslen(s) + wcslen(d) + 1 > bos / sizeof(wchar_t))
++ if (wcslen(__s) + wcslen(__d) + 1 > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wcscat(d, s);
++ return __orig_wcscat(__d, __s);
+ }
+
+-fortify_fn(wcscpy) wchar_t *wcscpy(wchar_t *d, const wchar_t *s)
++_FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t *__d, const wchar_t *__s)
+ {
+- size_t bos = __builtin_object_size(d, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (wcslen(s) + 1 > bos / sizeof(wchar_t))
++ if (wcslen(__s) + 1 > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wcscpy(d, s);
++ return __orig_wcscpy(__d, __s);
+ }
+
+-fortify_fn(wcsncat) wchar_t *wcsncat(wchar_t *d, const wchar_t *s, size_t n)
++_FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t *__d, const wchar_t *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(d, 0);
+- size_t slen, dlen;
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __sl, __dl;
+
+- if (n > bos / sizeof(wchar_t)) {
+- slen = wcslen(s);
+- dlen = wcslen(d);
+- if (slen > n)
+- slen = n;
+- if (slen + dlen + 1 > bos / sizeof(wchar_t))
++ if (__n > __b / sizeof(wchar_t)) {
++ __sl = wcslen(__s);
++ __dl = wcslen(__d);
++ if (__sl > __n)
++ __sl = __n;
++ if (__sl + __dl + 1 > __b / sizeof(wchar_t))
+ __builtin_trap();
+ }
+- return __orig_wcsncat(d, s, n);
++ return __orig_wcsncat(__d, __s, __n);
+ }
+
+-fortify_fn(wcsncpy) wchar_t *wcsncpy(wchar_t *d, const wchar_t *s, size_t n)
++_FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t *__d, const wchar_t *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(d, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos / sizeof(wchar_t))
++ if (__n > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wcsncpy(d, s, n);
++ return __orig_wcsncpy(__d, __s, __n);
+ }
+
+ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+ #undef wcsnrtombs
+-fortify_fn(wcsnrtombs) size_t wcsnrtombs(char *d, const wchar_t **s, size_t wn,
+- size_t n, mbstate_t *st)
++_FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char *__d, const wchar_t **__s, size_t __wn,
++ size_t __n, mbstate_t *__st)
+ {
+- size_t bos = __builtin_object_size(d, 0);
+- size_t r;
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __r;
+
+- if (wn > n / sizeof(wchar_t)) {
+- bos /= sizeof(wchar_t);
+- r = __orig_wcsnrtombs(d, s, wn > bos ? bos : wn, n, st);
+- if (bos < wn && d && *s && r != (size_t)-1)
++ if (__wn > __n / sizeof(wchar_t)) {
++ __b /= sizeof(wchar_t);
++ __r = __orig_wcsnrtombs(__d, __s, __wn > __b ? __b : __wn, __n, __st);
++ if (__b < __wn && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+ } else {
+- r = __orig_wcsnrtombs(d, s, wn, n > bos ? bos : n, st);
+- if (bos < n && d && *s && r != (size_t)-1)
++ __r = __orig_wcsnrtombs(__d, __s, __wn, __n > __b ? __b : __n, __st);
++ if (__b < __n && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+ }
+- return r;
++ return __r;
+ }
+ #endif
+
+-fortify_fn(wcsrtombs) size_t wcsrtombs(char *d, const wchar_t **s, size_t n,
+- mbstate_t *st)
++_FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char *__d, const wchar_t **__s, size_t __n,
++ mbstate_t *__st)
+ {
+- size_t bos = __builtin_object_size(d, 0);
+- size_t r;
++ size_t __b = __builtin_object_size(__d, 0);
++ size_t __r;
+
+- r = __orig_wcsrtombs(d, s, n > bos ? bos : n, st);
+- if (bos < n && d && *s && r != (size_t)-1)
++ __r = __orig_wcsrtombs(__d, __s, __n > __b ? __b : __n, __st);
++ if (__b < __n && __d && *__s && __r != (size_t)-1)
+ __builtin_trap();
+- return r;
++ return __r;
+ }
+
+-fortify_fn(wcstombs) size_t wcstombs(char *s, const wchar_t *ws, size_t n)
++_FORTIFY_FN(wcstombs) size_t wcstombs(char *__s, const wchar_t *__ws, size_t __n)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (s && n > bos)
++ if (__s && __n > __b)
+ __builtin_trap();
+- return __orig_wcstombs(s, ws, n);
++ return __orig_wcstombs(__s, __ws, __n);
+ }
+
+-fortify_fn(wctomb) int wctomb(char *s, wchar_t wc)
++_FORTIFY_FN(wctomb) int wctomb(char *__s, wchar_t __w)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (s && MB_CUR_MAX > bos)
++ if (__s && MB_CUR_MAX > __b)
+ __builtin_trap();
+- return __orig_wctomb(s, wc);
++ return __orig_wctomb(__s, __w);
+ }
+
+-fortify_fn(wmemcpy) wchar_t *wmemcpy(wchar_t *d, const wchar_t *s, size_t n)
++_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t *__d, const wchar_t *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(d, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos / sizeof(wchar_t))
++ if (__n > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wmemcpy(d, s, n);
++ return __orig_wmemcpy(__d, __s, __n);
+ }
+
+-fortify_fn(wmemmove) wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
++_FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t *__d, const wchar_t *__s, size_t __n)
+ {
+- size_t bos = __builtin_object_size(d, 0);
++ size_t __b = __builtin_object_size(__d, 0);
+
+- if (n > bos / sizeof(wchar_t))
++ if (__n > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wmemmove(d, s, n);
++ return __orig_wmemmove(__d, __s, __n);
+ }
+
+-fortify_fn(wmemset) wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n)
++_FORTIFY_FN(wmemset) wchar_t *wmemset(wchar_t *__s, wchar_t __c, size_t __n)
+ {
+- size_t bos = __builtin_object_size(s, 0);
++ size_t __b = __builtin_object_size(__s, 0);
+
+- if (n > bos / sizeof(wchar_t))
++ if (__n > __b / sizeof(wchar_t))
+ __builtin_trap();
+- return __orig_wmemset(s, c, n);
++ return __orig_wmemset(__s, __c, __n);
+ }
+
+ #ifdef __cplusplus
+--
+2.4.2
+
diff --git a/main/fortify-headers/0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch b/main/fortify-headers/0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch
new file mode 100644
index 0000000000..17f6a3ab3a
--- /dev/null
+++ b/main/fortify-headers/0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch
@@ -0,0 +1,69 @@
+From 4cdac9cbdaa01f884e0e8b3f947b7f0cb1170729 Mon Sep 17 00:00:00 2001
+From: Trutz Behn <me@trutz.be>
+Date: Thu, 4 Jun 2015 15:01:37 +0200
+Subject: [PATCH 3/3] Use the __inline__ keyword instead of __inline to avoid
+ breakage
+
+Newer compilers default to GNU11, a C11 dialect. Some software however
+is unprepared for this or has wrong compatibility checks. What happens
+is that some software will for compatibility with C89
+
+ #define inline
+
+before inclusion of a standard header, which is undefined behaviour in
+C99 and above (C99/C11 7.1.2/4), as inline is a keyword.
+
+If any libc headers that are then included via #include_next provide an
+__inline macro definition (current musl does this if C++ or C99 and
+above is detected) like the following
+
+ #define __inline inline
+
+this results in any __inline token to be preprocessed away.
+
+This breaks use of __builtin_va_arg_pack() in our stdio.h at
+compile-time as it can only be used in always inlined functions. The
+function attributes __always_inline__ and __gnu_inline__ themselves
+require an inline specifier on the function to be applied.
+---
+ include/fortify-headers.h | 2 +-
+ include/sys/select.h | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/include/fortify-headers.h b/include/fortify-headers.h
+index 288a973..c4e6495 100644
+--- a/include/fortify-headers.h
++++ b/include/fortify-headers.h
+@@ -19,6 +19,6 @@
+ #define _FORTIFY_STR(s) #s
+ #define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
+ #define _FORTIFY_FN(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
+- extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
++ extern __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+
+ #endif
+diff --git a/include/sys/select.h b/include/sys/select.h
+index 4623071..db6135d 100644
+--- a/include/sys/select.h
++++ b/include/sys/select.h
+@@ -24,7 +24,7 @@
+ extern "C" {
+ #endif
+
+-static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
++static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+ void __fortify_FD_CLR(int __f, fd_set *__s)
+ {
+ size_t __b = __builtin_object_size(__s, 0);
+@@ -34,7 +34,7 @@ void __fortify_FD_CLR(int __f, fd_set *__s)
+ FD_CLR(__f, __s);
+ }
+
+-static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
++static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__))
+ void __fortify_FD_SET(int __f, fd_set *__s)
+ {
+ size_t __b = __builtin_object_size(__s, 0);
+--
+2.4.2
+
diff --git a/main/fortify-headers/APKBUILD b/main/fortify-headers/APKBUILD
index a2bbd52aac..8ea50b4118 100644
--- a/main/fortify-headers/APKBUILD
+++ b/main/fortify-headers/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=fortify-headers
pkgver=0.5
-pkgrel=0
+pkgrel=1
pkgdesc="standalone fortify source implementation"
url="http://git.2f30.org/fortify-headers/"
arch="noarch"
@@ -13,6 +13,9 @@ makedepends="$depends_dev"
install=""
subpackages=""
source="http://dl.2f30.org/releases/$pkgname-$pkgver.tar.gz
+ 0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
+ 0002-Use-namespace-safe-macro-param-and-variable-names.patch
+ 0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch
"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -36,6 +39,15 @@ package() {
rm -f "$pkgdir"/usr/lib/*.la
}
-md5sums="56487ae93e3f45ffc0736afd3ebce549 fortify-headers-0.5.tar.gz"
-sha256sums="4564f0ee9cb7c789b5a827d21a0d3b6da9df61fcb7ba31b711999f638e9e913a fortify-headers-0.5.tar.gz"
-sha512sums="951e3a5771c3cf9b2fe248e62badfc6699f0a05b8967f3982d279de8473501c66a6d1c17d7b42c90ef8bd303c06a642d7bdfea334caef892c90a15c45d4bb1c4 fortify-headers-0.5.tar.gz"
+md5sums="56487ae93e3f45ffc0736afd3ebce549 fortify-headers-0.5.tar.gz
+714b730430421676f4f4522068d383a8 0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
+a187cf4e7357b91d2df939494e8fc238 0002-Use-namespace-safe-macro-param-and-variable-names.patch
+d541c38e645b34d15b178b4f4204d3a9 0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch"
+sha256sums="4564f0ee9cb7c789b5a827d21a0d3b6da9df61fcb7ba31b711999f638e9e913a fortify-headers-0.5.tar.gz
+d2a33f6689039f33e5ead42fe27e1be65580beb2c3e748efe7437f24a6366e20 0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
+d6e4e8d75d0543feca2e5966bb9586ec6e9113e66c80a8a47d5b45ad9d3141eb 0002-Use-namespace-safe-macro-param-and-variable-names.patch
+004c8f2332a5f4b258d7a685425c285fd90b55f0d93f11de8095db2a44f86194 0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch"
+sha512sums="951e3a5771c3cf9b2fe248e62badfc6699f0a05b8967f3982d279de8473501c66a6d1c17d7b42c90ef8bd303c06a642d7bdfea334caef892c90a15c45d4bb1c4 fortify-headers-0.5.tar.gz
+060a2e8b4a5f441368df57447528e7c29491c3f4c03fc095cefaa9ed79858601f74496b1734be8604534696b74b40cd47fa7b8ba384e143ff21db75cf09d8ae8 0001-Fix-usage-of-__USER_LABEL_PREFIX__.patch
+8a4b76dfcbe9c50a1a1cd2ba2757a1936a296532bc63227e0783c5b9e881f96363c421b6470456fe901a4a51a0ff1e0ca2f3b084dda4b82e0878991f3caa8854 0002-Use-namespace-safe-macro-param-and-variable-names.patch
+538830d2f69c8b628e0b65ac37b02ff78a6af4a10b46aa8b00c3e7830d7f52a55475ba78793f84ad1ca3614f0eebebd1932101dca869af5ce92044682365eadf 0003-Use-the-__inline__-keyword-instead-of-__inline-to-av.patch"