void-packages/srcpkgs/gcc-multilib/patches/fix-inline_vfprintf.patch
Đoàn Trần Công Danh 7fc9190f0e srcpkgs/g*: convert patches to -Np1
* gcc is kept at -Np0, because of void-cross

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

26 lines
704 B
Diff

Work around a bug when compiling the definition for
vfprintf(2) in /usr/include/bits/stdio2.h, which does
not guarantee inlined code for _FORTIFY_SOURCE=2.
Here we just don't include <stdio.h> and declare
the required types and functions locally.
--- a/libitm/util.cc 2015-09-02 17:19:01.176016940 +0200
+++ b/libitm/util.cc 2015-09-02 17:20:03.045016757 +0200
@@ -24,10 +24,15 @@
#include "libitm_i.h"
#include <stdarg.h>
-#include <stdio.h>
+#define FILE void
+extern FILE* stderr;
+extern int fputs(const char*, FILE *);
+extern int fputc(char, FILE *);
+extern int vfprintf(FILE*, const char*, va_list);
+
namespace GTM HIDDEN {
static void
gtm_verror (const char *fmt, va_list list)
{