From e73ccf45a3ff191ed09b53499884a6c2b7aa31e3 Mon Sep 17 00:00:00 2001 From: John Viega Date: Fri, 5 Jul 2024 21:50:37 -0400 Subject: [PATCH] Build in the proper order. --- dev | 26 ++++++++++++++++---------- include/con4m/gc.h | 2 +- meson.build | 15 +++++++++------ 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dev b/dev index 59543fd2..fe90b030 100755 --- a/dev +++ b/dev @@ -32,13 +32,7 @@ function log { echo $(color blue "[-- libcon4m --]" $@) } -function meson_build { - - echo ${1} > .meson_last - rm deps/local 2>/dev/null - ln -s ${PWD}/deps/${OS}-${ARCH} ${PWD}/deps/local - - +function meson_init_target { if [[ ! -d ${1} ]]; then if [[ -f ${1} ]]; then rm -rf ${1} @@ -47,6 +41,16 @@ function meson_build { log meson setup ${@} meson setup ${@} fi +} + +function meson_build { + + echo ${1} > .meson_last + rm deps/local 2>/dev/null + ln -s ${PWD}/deps/${OS}-${ARCH} ${PWD}/deps/local + + + meson_init_target ${@} cd ${1} log Compiling meson target ${1} @@ -178,12 +182,14 @@ case $1 in ;; build) meson_build build --buildtype=plain ;; - debug) meson_build debug --buildtype=debug + debug) meson_init_target debug --buildtype=debug meson configure debug -Duse_memcheck=true + meson_build debug debug_it ;; - testbuild) meson_build cicd --buildtype=debug - meson configure cicd -Duse_ubsan=true -Duse_asan=true -Duse_memcheck=true + testbuild) meson_init_target cicd --buildtype=debug + meson configure cicd -Duse_ubsan=true -Duse_asan=true -Duse_memcheck=true + meson_build cicd ;; release) meson_build release --buildtype=release ;; diff --git a/include/con4m/gc.h b/include/con4m/gc.h index c3ce9c83..6afd9bb9 100644 --- a/include/con4m/gc.h +++ b/include/con4m/gc.h @@ -340,7 +340,7 @@ void _c4m_memcheck_object(c4m_obj_t, char *, int); #endif #endif -#if defined(__SANITIZE_ADDRESS__) +#if defined(__SANITIZE_ADDRESS__) && defined(C4M_EXPERIMENTAL_POISONING) void __asan_poison_memory_region(void const volatile *addr, size_t size); void __asan_unpoison_memory_region(void const volatile *addr, size_t size); diff --git a/meson.build b/meson.build index 43818110..2ae10da9 100644 --- a/meson.build +++ b/meson.build @@ -73,11 +73,11 @@ endif if (get_option('use_ubsan') == true) c_args = c_args + ['-fsanitize=undefined', - '-fsanitize-recover=all' - ] + '-fsanitize-recover=all' + ] link_args = link_args + ['-fsanitize=undefined', - '-fsanitize-recover=all' - ] + '-fsanitize-recover=all' + ] endif if (get_option('use_memcheck') == true) @@ -211,8 +211,11 @@ lib_src = c4m_src + hat_primary test_src = ['src/tests/test.c'] threads = dependency('threads') -math = cc.find_library('m', required : false) -ffi = cc.find_library('ffi', required : true, dirs: meson.current_source_dir() + '/deps/local/') +math = cc.find_library('m', + required : false) +ffi = cc.find_library('ffi', + required : true, + dirs: meson.current_source_dir() + '/deps/local/') crypto = cc.find_library('crypto') ssl = cc.find_library('ssl')