python-pathvalidate: bump version to 0.14.1
[buildroot-gz.git] / boot / lpc32xxcdl / lpc32xxcdl-2.11-libnosys_gnu.patch
blobcfd77bead6fe15ac892f21db81c5a6df0c95d101
1 Fix compilation and eabi issues
3 Since we are not linking with libc anymore, we need to define our own memset,
4 strlen and memcpy. Also, as we are using a *libc compiler, we need to "handle"
5 exceptions (mostly division by 0) by defining raise() and
6 __aeabi_unwind_cpp_pr0.
8 Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
9 ---
10 csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
11 csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
12 csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
13 3 files changed, 123 insertions(+), 0 deletions(-)
15 diff --git a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
16 index 385b0ab..f1f0a0a 100644
17 --- a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
18 +++ b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
19 @@ -25,6 +25,7 @@
20 #include <errno.h>
21 #include <sys/times.h>
22 #include <sys/stat.h>
23 +#include <sys/types.h>
25 /* errno definition */
26 #undef errno
27 @@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
28 return 0;
31 +void * memset(void * s,int c,size_t count)
33 + char *xs = (char *) s;
35 + while (count--)
36 + *xs++ = c;
38 + return s;
42 +size_t strlen(const char * s)
44 + const char *sc;
46 + for (sc = s; *sc != '\0'; ++sc)
47 + /* nothing */;
48 + return sc - s;
51 +void * memcpy(void * dest,const void *src,size_t count)
53 + char *tmp = (char *) dest, *s = (char *) src;
55 + while (count--)
56 + *tmp++ = *s++;
58 + return dest;
62 +/* Dummy functions to avoid linker complaints */
63 +void __aeabi_unwind_cpp_pr0(void)
65 +};
67 +void raise(void)
69 +};
71 #endif /*__GNUC__*/
72 diff --git a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
73 index 385b0ab..f1f0a0a 100644
74 --- a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
75 +++ b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
76 @@ -25,6 +25,7 @@
77 #include <errno.h>
78 #include <sys/times.h>
79 #include <sys/stat.h>
80 +#include <sys/types.h>
82 /* errno definition */
83 #undef errno
84 @@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
85 return 0;
88 +void * memset(void * s,int c,size_t count)
90 + char *xs = (char *) s;
92 + while (count--)
93 + *xs++ = c;
95 + return s;
99 +size_t strlen(const char * s)
101 + const char *sc;
103 + for (sc = s; *sc != '\0'; ++sc)
104 + /* nothing */;
105 + return sc - s;
108 +void * memcpy(void * dest,const void *src,size_t count)
110 + char *tmp = (char *) dest, *s = (char *) src;
112 + while (count--)
113 + *tmp++ = *s++;
115 + return dest;
119 +/* Dummy functions to avoid linker complaints */
120 +void __aeabi_unwind_cpp_pr0(void)
124 +void raise(void)
128 #endif /*__GNUC__*/
129 diff --git a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
130 index cfdb674..6b50c60 100644
131 --- a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
132 +++ b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
133 @@ -25,6 +25,7 @@
134 #include <errno.h>
135 #include <sys/times.h>
136 #include <sys/stat.h>
137 +#include <sys/types.h>
139 /* errno definition */
140 #undef errno
141 @@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
142 return 0;
145 +void * memset(void * s,int c,size_t count)
147 + char *xs = (char *) s;
149 + while (count--)
150 + *xs++ = c;
152 + return s;
156 +size_t strlen(const char * s)
158 + const char *sc;
160 + for (sc = s; *sc != '\0'; ++sc)
161 + /* nothing */;
162 + return sc - s;
165 +void * memcpy(void * dest,const void *src,size_t count)
167 + char *tmp = (char *) dest, *s = (char *) src;
169 + while (count--)
170 + *tmp++ = *s++;
172 + return dest;
176 +/* Dummy functions to avoid linker complaints */
177 +void __aeabi_unwind_cpp_pr0(void)
181 +void raise(void)
185 #endif /*__GNUC__*/
187 1.7.7.3