Add libgcc_s build

This commit is contained in:
Lubos Dolezel 2015-11-03 15:33:33 +01:00
parent 9dc2ca57eb
commit d07dff95de
4 changed files with 29 additions and 0 deletions

View File

@ -10,5 +10,6 @@
/usr/lib/libz.dylib=libz.so
/usr/lib/libbz2.1.0.dylib=libbz2.so
/usr/lib/libbz2=libbz2.so
/usr/lib/libgcc_s.1.dylib=libgcc_s.so
/usr/lib/libobjc.A.dylib=libobjc.so

View File

@ -56,6 +56,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/duct/include")
add_subdirectory(libc)
add_subdirectory(libm)
add_subdirectory(libgcc)
add_subdirectory(libinfo)
add_subdirectory(libmalloc)
add_subdirectory(libunwind)

24
src/libgcc/CMakeLists.txt Normal file
View File

@ -0,0 +1,24 @@
project(libgcc)
cmake_minimum_required(VERSION 2.4.0)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,--version-script=${DARLING_TOP_DIRECTORY}/darwin.map")
set(libgcc_sources
dummy.c
)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${SUFFIX}/darling")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_library(gcc_s SHARED ${libgcc_sources})
# target_link_libraries(gcc_s -lgcc)
# TODO: link against libcompiler_rt
install(TARGETS gcc_s DESTINATION lib${SUFFIX}/darling)

3
src/libgcc/dummy.c Normal file
View File

@ -0,0 +1,3 @@
// For binary compatibility only
void mach_init_routine() {}