kumquat-buildroot/boot/lpc32xxcdl/0003-libnosys_gnu.patch
Ricardo Martincoski 8bca032e19 boot/lpc32xxcdl: rename patches with the proper naming convention
As reported by check-package (by calling it directly):
use name <number>-<description>.patch

Output of:
make lpc32xxcdl-dirclean lpc32xxcdl-patch | grep 'Patching\|Applying'

Before:
>>> lpc32xxcdl 2.11 Patching
Applying lpc32xxcdl-2.11-compiler_name.patch using patch:
Applying lpc32xxcdl-2.11-delete_redundant_files.patch using patch:
Applying lpc32xxcdl-2.11-libnosys_gnu.patch using patch:
Applying lpc32xxcdl-2.11-slashes.patch using patch:

After:
>>> lpc32xxcdl 2.11 Patching
Applying 0001-compiler_name.patch using patch:
Applying 0002-delete_redundant_files.patch using patch:
Applying 0003-libnosys_gnu.patch using patch:
Applying 0004-slashes.patch using patch:

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-12-11 20:48:58 +01:00

189 lines
4.0 KiB
Diff

Fix compilation and eabi issues
Since we are not linking with libc anymore, we need to define our own memset,
strlen and memcpy. Also, as we are using a *libc compiler, we need to "handle"
exceptions (mostly division by 0) by defining raise() and
__aeabi_unwind_cpp_pr0.
Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
---
csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c | 41 +++++++++++++++++++++++
3 files changed, 123 insertions(+), 0 deletions(-)
diff --git a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <sys/times.h>
#include <sys/stat.h>
+#include <sys/types.h>
/* errno definition */
#undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
return 0;
}
+void * memset(void * s,int c,size_t count)
+{
+ char *xs = (char *) s;
+
+ while (count--)
+ *xs++ = c;
+
+ return s;
+}
+
+
+size_t strlen(const char * s)
+{
+ const char *sc;
+
+ for (sc = s; *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
#endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <sys/times.h>
#include <sys/stat.h>
+#include <sys/types.h>
/* errno definition */
#undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
return 0;
}
+void * memset(void * s,int c,size_t count)
+{
+ char *xs = (char *) s;
+
+ while (count--)
+ *xs++ = c;
+
+ return s;
+}
+
+
+size_t strlen(const char * s)
+{
+ const char *sc;
+
+ for (sc = s; *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
#endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
index cfdb674..6b50c60 100644
--- a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <sys/times.h>
#include <sys/stat.h>
+#include <sys/types.h>
/* errno definition */
#undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
return 0;
}
+void * memset(void * s,int c,size_t count)
+{
+ char *xs = (char *) s;
+
+ while (count--)
+ *xs++ = c;
+
+ return s;
+}
+
+
+size_t strlen(const char * s)
+{
+ const char *sc;
+
+ for (sc = s; *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
#endif /*__GNUC__*/
--
1.7.7.3