diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index cf7ec1fc..be012951 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -52,7 +52,7 @@ set(LIBC_SOURCES add_library(objlibc OBJECT ${LIBC_SOURCES}) target_compile_definitions(objlibc PRIVATE __arch=${BANAN_ARCH}) -target_compile_options(objlibc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns -fno-exceptions -fpic -nolibc) +target_compile_options(objlibc PRIVATE -O2 -g -Wstack-usage=512 -fno-exceptions -fpic -nolibc) target_compile_options(objlibc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=) function(add_crtx crtx) diff --git a/userspace/libraries/LibC/string.cpp b/userspace/libraries/LibC/string.cpp index 7a5b45b4..7c434d82 100644 --- a/userspace/libraries/LibC/string.cpp +++ b/userspace/libraries/LibC/string.cpp @@ -8,6 +8,10 @@ #include #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC optimize "no-tree-loop-distribute-patterns" +#endif + void* memccpy(void* __restrict s1, const void* __restrict s2, int c, size_t n) { unsigned char* dst = static_cast(s1);