diff --git a/CMakeLists.txt b/CMakeLists.txt index caa2093..2fa6b5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ add_framework(Photon STATIC SOURCES ${photon_libc_sources} ${photon_libc_headers} HEADERS ${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include/*) -bundle_compile_options(Photon PRIVATE -ffreestanding -nostdlib -fPIC) +bundle_compile_options(Photon PRIVATE -ffreestanding -nostdlib -fPIC -fPIE) bundle_link_libraries(Photon ${photon_platform_libs}) bundle_link_frameworks(Photon ${photon_platform_frameworks}) diff --git a/photon/libc/sys/magenta/heap.c b/photon/libc/sys/magenta/heap.c index a3bf783..95d78cc 100644 --- a/photon/libc/sys/magenta/heap.c +++ b/photon/libc/sys/magenta/heap.c @@ -13,6 +13,7 @@ static mx_handle_t heap_segment = MX_NULL_HANDLE; int __heap_init(struct __proc_start_info *info) { +#if 0 heap_start = (uintptr_t)info->heap_map_base; heap_end = (uintptr_t)info + sizeof(*info); ROUND_UP(heap_end, 0x1000); @@ -21,12 +22,14 @@ int __heap_init(struct __proc_start_info *info) unsigned long sz = 0; mx_segment_get_size(heap_segment, &sz); heap_sz = sz; +#endif return 0; } void *__extend_heap(size_t sz) { +#if 0 if (sz == 0) { return (void *)(heap_end + 1); } @@ -39,4 +42,6 @@ void *__extend_heap(size_t sz) heap_sz += sz; heap_end += sz; return (void *)ret; +#endif + return NULL; }