This commit is contained in:
Patrick 2024-08-08 17:44:11 +02:00
parent ef199a07cd
commit fade965277
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 31 additions and 5 deletions

18
.gdb_history Normal file
View file

@ -0,0 +1,18 @@
br z_cbvprintf_impl
r
ni
br z_cbvprintf_impl
r
ni
x/200i $rip
x/2000i $rip
ni
ni
br z_cbvprintf_impl
r
ni
ni
r
ni
r
vmmap

View file

@ -159,9 +159,10 @@ endif()
# (supported by current gcc's as well)
#
if(CONFIG_CFI)
zephyr_compile_options(-flto -fvisibility=hidden)
target_compile_options(native_simulator INTERFACE "-flto -fvisibility=hidden -fno-sanitize-trap=cfi")
target_link_options(native_simulator INTERFACE "-flto")
zephyr_compile_options(-flto -fvisibility=hidden -fno-sanitize-trap=cfi -fsanitize-ignorelist=/home/patrick/repos/uni/idp/zephyrtest/zephyr/ignore_list.txt)
target_link_options(native_simulator INTERFACE "-flto -fvisibility=hidden -fno-sanitize-trap=cfi -fsanitize-ignorelist=/home/patrick/repos/uni/idp/zephyrtest/zephyr/ignore_list.txt")
target_compile_options(native_simulator INTERFACE "-flto -fvisibility=hidden -fno-sanitize-trap=cfi -fsanitize-ignorelist=/home/patrick/repos/uni/idp/zephyrtest/zephyr/ignore_list.txt")
zephyr_link_libraries("-flto")
list(APPEND LLVM_SANITIZERS "cfi")
endif()

2
ignore_list.txt Normal file
View file

@ -0,0 +1,2 @@
src:*/native_simulator/*
fun:z_cbvprintf_impl

6
main.c Normal file
View file

@ -0,0 +1,6 @@
#include <stdio.h>
int main()
{
printf("lololol");
}

View file

@ -2,7 +2,6 @@ CONFIG_GPIO=y
#CONFIG_ASAN=y
CONFIG_CFI=y
CONFIG_LLVM_USE_LLD=y
CONFIG_COMPILER_RT_RTLIB=y
#CONFIG_DEBUG=y
#CONFIG_DEBUG_INFO=y

View file

@ -134,7 +134,7 @@ ${NSI_EXE}: ${NSI_BUILD_PATH}/${RUNNER_LIB} ${LOCALIZED_EMBSW} ${NSI_EXTRA_LIBS}
-B /nix/store/dbwp0scbb0rk78m636sb7cvycz8xzgyh-glibc-2.39-52/lib \
-B /nix/store/qfqjymymsd2x29yknsgllfiq1h64s3f4-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0/ \
-L /nix/store/qfqjymymsd2x29yknsgllfiq1h64s3f4-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0/ \
-lclang_rt.ubsan_standalone-x86_64
-lclang_rt.ubsan_standalone
Makefile: ;