Skip to content

Commit

Permalink
Merge pull request #476 from gofractally/fix-clang-16-build
Browse files Browse the repository at this point in the history
fixes clang-16 wasi-sdk-20 build
  • Loading branch information
James-Mart authored Aug 17, 2023
2 parents d9fa7ea + 0d4d0ea commit 50d37ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions libraries/psibase/service/src/simple_malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ extern "C"
return nullptr;
}

void* aligned_alloc(size_t alignment, size_t size)
{
if (size % alignment != 0)
return nullptr;

void* ptr;
if (posix_memalign(&ptr, alignment, size) == 0)
return ptr;

return nullptr;
}

void free(void* ptr) {}

// Define these to satisfy musl references.
Expand Down
2 changes: 1 addition & 1 deletion wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ endif()
if(NOT EXISTS ${DEP_PREFIX}/lib/libssl.a)
download(${DEP_URL}/${OPENSSL_ARCHIVE} ${DEP_PREFIX}/${OPENSSL_ARCHIVE} ${OPENSSL_SHA256})
message("building openssl")
set(OPENSSL_BUILD_FLAGS "--sysroot=${CMAKE_SYSROOT} --target=wasm32-wasi -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS -DNO_SYSLOG -DOPENSSL_NO_SECURE_MEMORY")
set(OPENSSL_BUILD_FLAGS "--sysroot=${CMAKE_SYSROOT} --target=wasm32-wasi -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS -DNO_SYSLOG -DOPENSSL_NO_SECURE_MEMORY -Wno-error=implicit-function-declaration")
execute_process(
WORKING_DIRECTORY ${DEP_PREFIX}
COMMAND bash -c "\
Expand Down

0 comments on commit 50d37ce

Please sign in to comment.