Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ set(CHEETAH_PEDIGREE_LIB_SOURCES
pedigree_lib.cpp
)

set(CHEETAH_PERSONALITY_C_SOURCES
personality-c.c
)

set(CHEETAH_PERSONALITY_CPP_SOURCES
personality-cpp.cpp
)

#set_source_files_properties(file.cpp PROPERTIES COMPILE_OPTIONS -...)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down Expand Up @@ -81,9 +73,6 @@ set(CHEETAH_BITCODE_ABI_COMPILE_DEFS ${CHEETAH_COMPILE_DEFS}
"CHEETAH_API_CONSUMER=1"
"CILK_DEBUG=0")

set(CHEETAH_PERSONALITY_COMPILE_DEFS ${CHEETAH_COMPILE_DEFS}
"CHEETAH_API_CONSUMER=1")

# Set compile flags, compile defs, and link flags for ASan build
set(CHEETAH_ASAN_COMPILE_FLAGS ${CHEETAH_COMPILE_FLAGS})
set(CHEETAH_ASAN_COMPILE_DEFS ${CHEETAH_COMPILE_DEFS} "CILK_ENABLE_ASAN_HOOKS=1")
Expand Down Expand Up @@ -112,9 +101,9 @@ set(CHEETAH_BITCODES "opencilk-abi")
set(CHEETAH_ASAN_BITCODES "opencilk-asan-abi")
set(CHEETAH_BITCODE_SOURCES "CHEETAH_ABI_SOURCE")
# List of libraries and corresponding sources
set(CHEETAH_LIBRARIES "opencilk" "opencilk-personality-c" "opencilk-personality-cpp" "opencilk-pedigrees")
set(CHEETAH_ASAN_LIBRARIES "opencilk-asan" "opencilk-asan-personality-c" "opencilk-asan-personality-cpp" "opencilk-pedigrees-asan")
set(CHEETAH_LIBRARY_SOURCES "CHEETAH_SOURCES" "CHEETAH_PERSONALITY_C_SOURCES" "CHEETAH_PERSONALITY_CPP_SOURCES" "CHEETAH_PEDIGREE_LIB_SOURCES")
set(CHEETAH_LIBRARIES "opencilk" "opencilk-pedigrees")
set(CHEETAH_ASAN_LIBRARIES "opencilk-asan" "opencilk-pedigrees-asan")
set(CHEETAH_LIBRARY_SOURCES "CHEETAH_SOURCES" "CHEETAH_PEDIGREE_LIB_SOURCES")

# Add all bitcode and library variants
if (APPLE)
Expand Down
24 changes: 2 additions & 22 deletions runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,19 @@ INCLUDES = -I../include/
DEFINES = $(REDUCER_DEF) $(ABI_DEF) $(ALERT_DEF)
OPTIONS = $(OPT) $(DBG) $(ARCH) -Werror -Wall -fpic $(DEFINES) $(INCLUDES) -gdwarf-4

PERSON_C = $(RTS_LIBDIR)/$(RTS_C_PERSONALITY_LIB)
PERSON_CPP = $(RTS_LIBDIR)/$(RTS_CXX_PERSONALITY_LIB)
PERSON_C_SRC = personality-c
PERSON_CPP_SRC = personality-cpp
PEDIGREE_LIB = $(RTS_LIBDIR)/$(RTS_PEDIGREE_LIB)
PEDIGREE_LIB_SRC = pedigree_lib

.PHONY: all clean build

all: build $(RTS_LIBDIR) $(MAIN).a $(MAIN).so $(PERSON_C).a $(PERSON_C).so $(PERSON_CPP).a $(PERSON_CPP).so $(BITCODE_ABI)
all: build $(RTS_LIBDIR) $(MAIN).a $(MAIN).so $(BITCODE_ABI)

$(MAIN).a: $(OBJS)
$(AR) rcs $@ $^

$(MAIN).so: $(OBJS)
$(CXX) -shared -o $@ $^

$(PERSON_C).a: build/$(PERSON_C_SRC).o
$(AR) rcs $@ $^

$(PERSON_C).so: $(RTS_LIBDIR)/libopencilk.so

$(PERSON_C).so: build/$(PERSON_C_SRC).o
$(CC) -shared -o $@ $^ -L$(RTS_LIBDIR) -lopencilk

$(PERSON_CPP).a: build/$(PERSON_CPP_SRC).o
$(AR) rcs $@ $^

$(PERSON_CPP).so: $(RTS_LIBDIR)/libopencilk.so

$(PERSON_CPP).so: ./build/$(PERSON_CPP_SRC).o
$(CXX) -shared -o $@ $^ -L$(RTS_LIBDIR) -lopencilk

$(PEDIGREE_LIB).a: build/$(PEDIGREE_LIB_SRC).o
$(AR) rcs $@ $^

Expand All @@ -73,5 +53,5 @@ $(BITCODE_ABI) : build/cilk2c_inlined.bc
cp $< $@

clean:
rm -f $(OBJS) build/$(PERSON_C_SRC).o build/$(PERSON_CPP_SRC).o $(RTS_LIBDIR)/*.a $(RTS_LIBDIR)/*.so $(RTS_LIBDIR)/*.bc *~
rm -f $(OBJS) $(RTS_LIBDIR)/*.a $(RTS_LIBDIR)/*.so $(RTS_LIBDIR)/*.bc *~
rm -f build/cilk2c_inlined.bc
33 changes: 0 additions & 33 deletions runtime/personality-c.c

This file was deleted.

34 changes: 0 additions & 34 deletions runtime/personality-cpp.cpp

This file was deleted.

39 changes: 39 additions & 0 deletions runtime/personality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ typedef _Unwind_Reason_Code (*__personality_routine)(
int version, _Unwind_Action actions, uint64_t exception_class,
_Unwind_Exception *exception_object, _Unwind_Context *context);

extern "C"
_Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions,
uint64_t exception_class,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context);
extern "C"
_Unwind_Reason_Code __gxx_personality_v0(int version, _Unwind_Action actions,
uint64_t exception_class,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context);


static char *get_cfa(_Unwind_Context *context) {
/* _Unwind_GetCFA is originally a gcc extension. FreeBSD has its
own library without that extension. */
Expand Down Expand Up @@ -314,3 +326,30 @@ extern "C" _Unwind_Reason_Code __cilk_personality_internal(
return _URC_FATAL_PHASE1_ERROR;
}
}

extern "C" {
_Unwind_Reason_Code __cilk_personality_c_v0(int version, _Unwind_Action actions,
uint64_t exception_class,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context) {
return __cilk_personality_internal(__gcc_personality_v0, version, actions,
exception_class, ue_header, context);
}

// Legacy name
_Unwind_Reason_Code __cilk_personality_v0(int version, _Unwind_Action actions,
uint64_t exception_class,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context) {
return __cilk_personality_c_v0(version, actions, exception_class, ue_header,
context);
}

_Unwind_Reason_Code __cilk_personality_cpp_v0(
int version, _Unwind_Action actions, uint64_t exception_class,
struct _Unwind_Exception *ue_header, struct _Unwind_Context *context) {
return __cilk_personality_internal(__gxx_personality_v0, version, actions,
exception_class, ue_header, context);
}

}
Loading