LibC: Add compile option to libc to stop optimizing string.h

This commit is contained in:
Bananymous 2024-01-17 19:44:29 +01:00
parent a5660b95b2
commit 2c471a89d0
2 changed files with 1 additions and 3 deletions

View File

@ -48,7 +48,7 @@ add_custom_target(crtx-install
add_library(libc ${LIBC_SOURCES})
add_dependencies(libc headers crtx-install)
target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512)
target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns)
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
add_custom_target(libc-install

View File

@ -17,7 +17,6 @@ int memcmp(const void* s1, const void* s2, size_t n)
return 0;
}
__attribute__((optimize("-O0")))
void* memcpy(void* __restrict__ dstp, const void* __restrict__ srcp, size_t n)
{
unsigned char* dst = static_cast<unsigned char*>(dstp);
@ -46,7 +45,6 @@ void* memmove(void* destp, const void* srcp, size_t n)
return destp;
}
__attribute__((optimize("-O0")))
void* memset(void* s, int c, size_t n)
{
unsigned char* p = static_cast<unsigned char*>(s);