Commit 53fc8d2f authored by Natanael Copa's avatar Natanael Copa

main/fortify-headers: upgrade to 0.6

parent 83fddbf5
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
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
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=fortify-headers
pkgver=0.5
pkgrel=1
pkgver=0.6
pkgrel=0
pkgdesc="standalone fortify source implementation"
url="http://git.2f30.org/fortify-headers/"
arch="noarch"
......@@ -13,9 +13,6 @@ 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
......@@ -39,15 +36,6 @@ package() {
rm -f "$pkgdir"/usr/lib/*.la
}
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"
md5sums="d85072939ec02a40af282fe3febc6c18 fortify-headers-0.6.tar.gz"
sha256sums="e3baedbd1a2ca612faf83f3c87c50eeb33b31c663948cfb3ca04300751d86b68 fortify-headers-0.6.tar.gz"
sha512sums="6106219332515e7c23354d916383cdac6efccba7eefa13b0c2c221d0fd03be7afb29b3a8622bd29b62ee0b602f9d1f273e1a08c07583bdcd12db9938ef4d7acc fortify-headers-0.6.tar.gz"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment