Skip to content

Commit

Permalink
Changes [build image]
Browse files Browse the repository at this point in the history
  • Loading branch information
Electroid committed Nov 14, 2024
1 parent 4ba9704 commit 190b5bc
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions cmake/targets/BuildBun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ if(NOT WIN32)
if(DEBUG)
# TODO: this shouldn't be necessary long term
if (NOT ABI STREQUAL "musl")
set(ABI_PUBLIC_FLAGS
target_compile_options(${bun} PUBLIC
-fsanitize=null
-fsanitize-recover=all
-fsanitize=bounds
Expand All @@ -771,14 +771,9 @@ if(NOT WIN32)
-fsanitize=returns-nonnull-attribute
-fsanitize=unreachable
)
set(ABI_PRIVATE_FLAGS
target_link_libraries(${bun} PRIVATE
-fsanitize=null
)
else()
set(ABI_PUBLIC_FLAGS
)
set(ABI_PRIVATE_FLAGS
)
endif()

target_compile_options(${bun} PUBLIC
Expand All @@ -796,10 +791,6 @@ if(NOT WIN32)
-Wno-unused-function
-Wno-nullability-completeness
-Werror
${ABI_PUBLIC_FLAGS}
)
target_link_libraries(${bun} PRIVATE
${ABI_PRIVATE_FLAGS}
)
else()
# Leave -Werror=unused off in release builds so we avoid errors from being used in ASSERT
Expand Down Expand Up @@ -852,13 +843,13 @@ elseif(APPLE)
-fno-keep-static-consts
)
else()
if (ARCH STREQUAL "aarch64")
set(ARCH_WRAP_FLAGS
if(ARCH STREQUAL "aarch64")
target_link_options(${bun} PUBLIC
-Wl,--wrap=fcntl64
-Wl,--wrap=statx
)
elseif(ARCH STREQUAL "x64")
set(ARCH_WRAP_FLAGS
target_link_options(${bun} PUBLIC
-Wl,--wrap=fcntl
-Wl,--wrap=fcntl64
-Wl,--wrap=fstat
Expand All @@ -874,13 +865,9 @@ else()
-Wl,--wrap=statx
)
endif()
else()
set(ARCH_WRAP_FLAGS
)
endif()

if (NOT ABI STREQUAL "musl")
set(ABI_WRAP_FLAGS
if(NOT ABI STREQUAL "musl")
target_link_options(${bun} PUBLIC
-Wl,--wrap=cosf
-Wl,--wrap=exp
-Wl,--wrap=expf
Expand All @@ -897,9 +884,6 @@ else()
-Wl,--wrap=sinf
-Wl,--wrap=tanf
)
else()
set(ABI_WRAP_FLAGS
)
endif()

target_link_options(${bun} PUBLIC
Expand All @@ -912,8 +896,6 @@ else()
-Wl,--as-needed
-Wl,--gc-sections
-Wl,-z,stack-size=12800000
${ARCH_WRAP_FLAGS}
${ABI_WRAP_FLAGS}
-Wl,--compress-debug-sections=zlib
-Wl,-z,lazy
-Wl,-z,norelro
Expand Down

0 comments on commit 190b5bc

Please sign in to comment.