LibC: Remove global -fno-tree-loop-distribute-patterns flag

This is only really needed for string.cpp where mem* and str* functions
are defined
This commit is contained in:
Bananymous 2025-01-14 18:35:33 +02:00
parent 4b2c303873
commit d62a67502e
2 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,7 @@ set(LIBC_SOURCES
add_library(objlibc OBJECT ${LIBC_SOURCES}) add_library(objlibc OBJECT ${LIBC_SOURCES})
target_compile_definitions(objlibc PRIVATE __arch=${BANAN_ARCH}) 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=) target_compile_options(objlibc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
function(add_crtx crtx) function(add_crtx crtx)

View File

@ -8,6 +8,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#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) void* memccpy(void* __restrict s1, const void* __restrict s2, int c, size_t n)
{ {
unsigned char* dst = static_cast<unsigned char*>(s1); unsigned char* dst = static_cast<unsigned char*>(s1);