Build dSYM files for all binaries

This commit is contained in:
Lubos Dolezel
2018-07-30 12:22:45 +02:00
parent 28db9e6f55
commit b4ebfa955f
8 changed files with 20 additions and 6 deletions
+2
View File
@@ -34,6 +34,8 @@ endif (${CMAKE_C_COMPILER_ID} STREQUAL "Clang" AND NOT ${CMAKE_C_COMPILER_VERSIO
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IGNORED_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNORED_WARNINGS}")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb")
enable_language(ASM-ATT)
+4
View File
@@ -16,5 +16,9 @@ FUNCTION(add_darling_executable exe)
use_ld64(${exe})
target_link_libraries(${exe} system)
add_dependencies(${exe} csu)
if (NOT NO_DSYM)
dsym(${exe})
endif (NOT NO_DSYM)
ENDFUNCTION(add_darling_executable)
+5
View File
@@ -5,6 +5,7 @@ endif(COMMAND cmake_policy)
include(use_ld64)
include(CMakeParseArguments)
include(dsym)
FUNCTION(add_darling_library name)
foreach(f IN LISTS ARGN)
@@ -39,6 +40,10 @@ FUNCTION(add_darling_library name)
endif (DYLIB_CURRENT_VERSION)
use_ld64(${name})
if (NOT NO_DSYM)
dsym(${name})
endif (NOT NO_DSYM)
ENDFUNCTION(add_darling_library)
FUNCTION(make_fat)
+5 -3
View File
@@ -1,11 +1,13 @@
function(dsym target)
if (DSYMUTIL_EXE)
if (DSYMUTIL_EXE AND CMAKE_BUILD_TYPE MATCHES DEBUG)
set(ENV{PATH} "${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/misc:$ENV{PATH}") # for lipo
add_custom_command(OUTPUT "${target}.dSYM" COMMAND ${CMAKE_COMMAND} -E env
"PATH=${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/misc:$ENV{PATH}"
"${DSYMUTIL_EXE}" "-flat" "-o" "${target}.dSYM" "$<TARGET_FILE:${target}>")
add_custom_command(OUTPUT "${target}.dSYM" COMMAND "${DSYMUTIL_EXE}" "-flat" "-o" "${target}.dSYM" "$<TARGET_FILE:${target}>")
add_custom_target("${target}-dSYM" ALL DEPENDS "${target}" "${target}.dSYM" getuuid lipo)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM" DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Caches/dsym/files")
install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Caches/dsym/uuid")
+1
View File
@@ -30,6 +30,7 @@
#define _REASON_H_
#include <stdint.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
+1 -1
View File
@@ -19,6 +19,6 @@ set(csu_SRCS
crt1.10.6.S
)
add_darling_library(csu STATIC ${csu_SRCS})
add_darling_static_library(csu SOURCES ${csu_SRCS})
make_fat(csu)
+1 -1
View File
@@ -13,7 +13,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(emulation/linux)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3 -w -fblocks -ggdb")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3 -w -fblocks -ffreestanding")
# Why -bind_at_load is necessary:
# I couldn't find something like -Bsymbolic in Apple's ld