Skip to content

Commit

Permalink
xcpsim: disable address sanitizer (debug build)
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Aug 14, 2022
1 parent 0ea4731 commit 318c2a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/xcpsim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ else()
if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -D_DEBUG -Og -UNDEBUG -fno-omit-frame-pointer -fno-optimize-sibling-calls")
if (NOT CMAKE_HOST_WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -fstack-check -fsanitize=address -fsanitize=undefined ")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -fstack-check -fsanitize=address -fsanitize=undefined ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -fstack-check -fsanitize=undefined ")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wthread-safety")
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/xcpsim/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void parse_options(int argc, char **argv, Xcp_OptionsType *options);
void AppTask(void);

int main(int argc, char **argv) {
assert(sizeof(void *) == 4);
// assert(sizeof(void *) == 4);

parse_options(argc, argv, &Xcp_Options);
FlsEmu_Init(&FlsEmu_Config);
Expand Down
4 changes: 2 additions & 2 deletions flsemu/posix/flsemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void FlsEmu_ClosePersitentArray(FlsEmu_PersistentArrayType const* persist
FLSEMU_ASSERT_INITIALIZED();

FlsEmu_UnmapAddress(persistentArray->mappingAddress, size);
close((int)persistentArray->fileHandle);
close((uint32_t)persistentArray->fileHandle);
}

static void FlsEmu_MapAddress(void* mappingAddress, int offset, uint32_t size, int fd) {
Expand Down Expand Up @@ -171,7 +171,7 @@ void FlsEmu_SelectPage(uint8_t segmentIdx, uint8_t page) {
/* printf("page# %u offset: %x\n", page, offset); */
FlsEmu_UnmapAddress(segment->persistentArray->mappingAddress, segment->memSize);
FlsEmu_MapAddress(segment->persistentArray->mappingAddress, offset, segment->memSize,
(int)segment->persistentArray->fileHandle);
(uint32_t)segment->persistentArray->fileHandle);
/*
if (FlsEmu_MapView(segment, offset, segment->pageSize)) {
segment->currentPage = page;
Expand Down

0 comments on commit 318c2a3

Please sign in to comment.