gcc: backport a libgcc fix for a dependency on libc write() on ARM
[openwrt/openwrt.git] / toolchain / gcc / patches / 5.2.0 / 050-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch
1 From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
2 Date: Mon, 23 Nov 2015 15:17:55 +0000
3 Subject: [PATCH] [ARM] PR target/68059 libgcc should not use __write for
4 printing fatal error
5
6 libgcc/
7 PR target/68059
8 * config/arm/linux-atomic-64bit.c (__write): Rename to...
9 (write): ...this and fix the return type.
10
11
12
13 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230762 138bc75d-0d04-0410-961f-82ee72b054a4
14 ---
15
16 --- a/libgcc/config/arm/linux-atomic-64bit.c
17 +++ b/libgcc/config/arm/linux-atomic-64bit.c
18 @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTI
19 kernels; we check for that in an init section and bail out rather
20 unceremoneously. */
21
22 -extern unsigned int __write (int fd, const void *buf, unsigned int count);
23 +extern int write (int fd, const void *buf, unsigned int count);
24 extern void abort (void);
25
26 /* Kernel helper for compare-and-exchange. */
27 @@ -56,7 +56,7 @@ static void __check_for_sync8_kernelhelp
28 for the user - I'm not sure I can rely on much else being
29 available at this point, so do the same as generic-morestack.c
30 write () and abort (). */
31 - __write (2 /* stderr. */, err, sizeof (err));
32 + write (2 /* stderr. */, err, sizeof (err));
33 abort ();
34 }
35 };