diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | third_party/newlib/string/local.h | 6 | ||||
-rw-r--r-- | third_party/newlib/string/memcmp.c | 4 | ||||
-rw-r--r-- | third_party/newlib/string/memcpy.c | 4 | ||||
-rw-r--r-- | third_party/newlib/string/memmove.c | 4 | ||||
-rw-r--r-- | third_party/newlib/string/memset.c | 4 |
6 files changed, 21 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f952ce0..5d89e4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,10 @@ target_compile_options(${PROJECT_NAME} PRIVATE -Wcast-align -Wshadow -Wlogical-op + -Os + -fno-builtin-printf + -fno-builtin-fprintf + -fno-builtin-_exit ) target_link_options(${PROJECT_NAME} PRIVATE diff --git a/third_party/newlib/string/local.h b/third_party/newlib/string/local.h index a96bdf1..3c35e1a 100644 --- a/third_party/newlib/string/local.h +++ b/third_party/newlib/string/local.h @@ -4,9 +4,5 @@ calls. This is used to avoid recursive calls in memset and memmove default implementations. */ -#ifdef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL -# define __inhibit_loop_to_libcall \ +#define __inhibit_loop_to_libcall \ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) -#else -# define __inhibit_loop_to_libcall -#endif diff --git a/third_party/newlib/string/memcmp.c b/third_party/newlib/string/memcmp.c index 342fb9f..4d47656 100644 --- a/third_party/newlib/string/memcmp.c +++ b/third_party/newlib/string/memcmp.c @@ -42,6 +42,10 @@ QUICKREF /* Threshhold for punting to the byte copier. */ #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) +#if defined(memcmp) +#undef memcmp +#endif + int memcmp (const void *m1, const void *m2, diff --git a/third_party/newlib/string/memcpy.c b/third_party/newlib/string/memcpy.c index 52f716b..fe8467c 100644 --- a/third_party/newlib/string/memcpy.c +++ b/third_party/newlib/string/memcpy.c @@ -44,6 +44,10 @@ QUICKREF /* Threshhold for punting to the byte copier. */ #define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) +#if defined(memcpy) +#undef memcpy +#endif + void * __inhibit_loop_to_libcall memcpy (void *__restrict dst0, diff --git a/third_party/newlib/string/memmove.c b/third_party/newlib/string/memmove.c index da5dfdb..fc6acf1 100644 --- a/third_party/newlib/string/memmove.c +++ b/third_party/newlib/string/memmove.c @@ -47,6 +47,10 @@ QUICKREF /* Threshhold for punting to the byte copier. */ #define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) +#if defined(memmove) +#undef memmove +#endif + /*SUPPRESS 20*/ void * __inhibit_loop_to_libcall diff --git a/third_party/newlib/string/memset.c b/third_party/newlib/string/memset.c index e8e667a..8814b76 100644 --- a/third_party/newlib/string/memset.c +++ b/third_party/newlib/string/memset.c @@ -33,6 +33,10 @@ QUICKREF #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) +#if defined(memset) +#undef memset +#endif + void * __inhibit_loop_to_libcall memset (void *m, |