forked from Bananymous/banan-os
LibC: Compile with -O2 optimizations
I have no idea why libc had no optimizations enabled. Weird thing is that memcpy optimized to infinite loop if I kept the __restrict__ attributes in pointers. I don't think there was any ub.
This commit is contained in:
parent
5f640da166
commit
c4186bd5f0
|
@ -47,7 +47,7 @@ add_custom_target(crtx-install
|
|||
add_library(libc ${LIBC_SOURCES})
|
||||
add_dependencies(libc headers crtx-install)
|
||||
|
||||
target_compile_options(libc PRIVATE -g -Wstack-usage=512)
|
||||
target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512)
|
||||
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
|
||||
|
||||
add_custom_target(libc-install
|
||||
|
|
|
@ -17,7 +17,7 @@ int memcmp(const void* s1, const void* s2, size_t n)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void* memcpy(void* __restrict__ dstp, const void* __restrict__ srcp, size_t n)
|
||||
void* memcpy(void* dstp, const void* srcp, size_t n)
|
||||
{
|
||||
unsigned char* dst = static_cast<unsigned char*>(dstp);
|
||||
const unsigned char* src = static_cast<const unsigned char*>(srcp);
|
||||
|
|
Loading…
Reference in New Issue