Compare commits

...

5 Commits

Author SHA1 Message Date
Jarred Sumner
b8f4782dc1 Update BuildBun.cmake 2025-02-22 23:50:26 -08:00
Jarred Sumner
89b63bc9a2 Update BuildBun.cmake 2025-02-22 23:09:15 -08:00
Jarred Sumner
7beb6730b8 Update BuildBun.cmake 2025-02-22 22:43:57 -08:00
Jarred Sumner
12c8307a47 wip 2025-02-22 22:43:32 -08:00
Jarred Sumner
368a5fc392 Generate .dwp files 2025-02-22 22:38:52 -08:00
4 changed files with 47 additions and 5 deletions

1
.gitignore vendored
View File

@@ -27,6 +27,7 @@
*.db
*.dmg
*.dSYM
*.dwo
*.generated.ts
*.jsb
*.lib

View File

@@ -78,7 +78,7 @@ if(WIN32)
DESCRIPTION "Enable debug symbols (.pdb)"
/Z7
)
elseif(APPLE)
elseif(APPLE OR LINUX)
register_compiler_flags(
DESCRIPTION "Enable debug symbols (.dSYM)"
-gdwarf-4

View File

@@ -513,8 +513,6 @@ WEBKIT_ADD_SOURCE_DEPENDENCIES(
${CODEGEN_PATH}/ZigGlobalObject.lut.h
)
WEBKIT_ADD_SOURCE_DEPENDENCIES(
${CWD}/src/bun.js/bindings/InternalModuleRegistry.cpp
${CODEGEN_PATH}/InternalModuleRegistryConstants.h
@@ -827,7 +825,6 @@ if(DEBUG AND NOT CI)
)
endif()
# --- Compiler options ---
if(NOT WIN32)
@@ -838,6 +835,13 @@ if(NOT WIN32)
-fno-pie
-faddrsig
)
if(LINUX AND CMAKE_DWP_PROGRAM)
target_compile_options(${bun} PUBLIC
-gsplit-dwarf
)
endif()
if(DEBUG)
# TODO: this shouldn't be necessary long term
if (NOT ABI STREQUAL "musl")
@@ -953,6 +957,7 @@ if(LINUX)
-Wl,--wrap=logf
-Wl,--wrap=pow
-Wl,--wrap=powf
-Wl,--gdb-index
)
else()
target_link_options(${bun} PUBLIC
@@ -961,6 +966,7 @@ if(LINUX)
-Wl,--wrap=log2f
-Wl,--wrap=logf
-Wl,--wrap=powf
-Wl,--gdb-index
)
endif()
endif()
@@ -1148,6 +1154,11 @@ if(NOT BUN_CPP_ONLY)
endif()
if(bunStrip)
if(LINUX)
# For split DWARF, we need to keep the .gnu_debuglink section
set(CMAKE_STRIP_FLAGS ${CMAKE_STRIP_FLAGS} --keep-section=.gnu_debuglink)
endif()
register_command(
TARGET
${bun}
@@ -1233,6 +1244,25 @@ if(NOT BUN_CPP_ONLY)
)
endif()
if(LINUX AND CMAKE_DWP_PROGRAM)
register_command(
TARGET
${bun}
TARGET_PHASE
POST_BUILD
COMMENT
"Generating ${bun}.dwp"
COMMAND
${CMAKE_DWP_PROGRAM}
-e ${bun}
-o ${bun}.dwp
CWD
${BUILD_PATH}
OUTPUTS
${BUILD_PATH}/${bun}.dwp
)
endif()
if(CI)
set(bunTriplet bun-${OS}-${ARCH})
if(LINUX AND ABI STREQUAL "musl")
@@ -1247,13 +1277,16 @@ if(NOT BUN_CPP_ONLY)
list(APPEND bunFiles ${bun}.pdb)
elseif(APPLE)
list(APPEND bunFiles ${bun}.dSYM)
elseif(LINUX AND CMAKE_DWP_PROGRAM)
file(GLOB DWO_FILES "${BUILD_PATH}/*.dwo")
list(APPEND bunFiles ${DWO_FILES})
list(APPEND bunFiles ${bun}.dwp)
endif()
if(APPLE OR LINUX)
list(APPEND bunFiles ${bun}.linker-map)
endif()
register_command(
TARGET
${bun}

View File

@@ -123,6 +123,14 @@ else()
REQUIRED
ON
)
find_command(
VARIABLE
CMAKE_DWP_PROGRAM
COMMAND
llvm-dwp
REQUIRED
OFF
)
else()
find_llvm_command(CMAKE_STRIP llvm-strip)
endif()