omit frame pointers for libc code

This commit is contained in:
Amos Bird 2019-12-09 21:25:54 +08:00
parent e69c0a0126
commit 30a085db7e
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,9 @@ if (GLIBC_COMPATIBILITY)
list(APPEND glibc_compatibility_sources libcxxabi/cxa_thread_atexit.cpp)
endif()
# Need to omit frame pointers to match the performance of glibc
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer")
add_library(glibc-compatibility STATIC ${glibc_compatibility_sources})
target_include_directories(glibc-compatibility PRIVATE libcxxabi ${musl_arch_include_dir})

View File

@ -58,7 +58,7 @@ __attribute__((constructor)) static void auxv_init()
void *__vdsosym(const char *vername, const char *name)
{
size_t i;
if (!eh) return 0;
Phdr *ph = (void *)((char *)eh + eh->e_phoff);
size_t *dynv=0, base=-1;
for (i=0; i<eh->e_phnum; i++, ph=(void *)((char *)ph+eh->e_phentsize)) {