diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index a2c311f9c..6fcb4e5ef 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -19,12 +19,12 @@ jobs: tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 env: TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - + # ideally we should've used meson and ninja here but it complains about coverage or something - - run: cov-analysis-linux64/bin/cov-build --dir cov-int clang src/hb-*.cc -DHAVE_FREETYPE -DHAVE_GRAPHITE2 -DHAVE_GLIB -DHAVE_ICU `pkg-config --cflags freetype2 graphite2 glib-2.0 icu-uc` -DHAVE_INTEL_ATOMIC_PRIMITIVES -DHAVE_ROUNDF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHAVE_GETPAGESIZE -DHB_EXPERIMENTAL_API -c + - run: cov-analysis-linux64/bin/cov-build --dir cov-int clang src/hb-*.cc -DHAVE_FREETYPE -DHAVE_GRAPHITE2 -DHAVE_GLIB -DHAVE_ICU `pkg-config --cflags freetype2 graphite2 glib-2.0 icu-uc` -DHAVE_ROUNDF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHAVE_GETPAGESIZE -DHB_EXPERIMENTAL_API -c - run: tar czvf harfbuzz.tgz cov-int - + - name: submit to coverity run: | curl \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 11118595f..9c290ff12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,20 +407,6 @@ if (HB_HAVE_GOBJECT) endif () ## Atomic ops availability detection -file(WRITE "${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c" -" void memory_barrier (void) { __sync_synchronize (); } - int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } - int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } - void mutex_unlock (int *m) { __sync_lock_release (m); } - int main () { return 0; } -") -try_compile(HB_HAVE_INTEL_ATOMIC_PRIMITIVES - ${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives - ${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c) -if (HB_HAVE_INTEL_ATOMIC_PRIMITIVES) - add_definitions(-DHAVE_INTEL_ATOMIC_PRIMITIVES) -endif () - file(WRITE "${PROJECT_BINARY_DIR}/try_compile_solaris_atomic_ops.c" " #include /* This requires Solaris Studio 12.2 or newer: */ diff --git a/configure.ac b/configure.ac index de22f5185..eeb9a5090 100644 --- a/configure.ac +++ b/configure.ac @@ -417,22 +417,6 @@ AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext) dnl =========================================================================== -AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [ - hb_cv_have_intel_atomic_primitives=false - AC_TRY_LINK([ - void memory_barrier (void) { __sync_synchronize (); } - int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } - int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } - void mutex_unlock (int *m) { __sync_lock_release (m); } - ], [], hb_cv_have_intel_atomic_primitives=true - ) -]) -if $hb_cv_have_intel_atomic_primitives; then - AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, [Have Intel __sync_* atomic primitives]) -fi - -dnl =========================================================================== - AC_CACHE_CHECK([for Solaris atomic operations], hb_cv_have_solaris_atomic_ops, [ hb_cv_have_solaris_atomic_ops=false AC_TRY_LINK([ diff --git a/meson-cc-tests/intel-atomic-primitives-test.c b/meson-cc-tests/intel-atomic-primitives-test.c deleted file mode 100644 index a5c804091..000000000 --- a/meson-cc-tests/intel-atomic-primitives-test.c +++ /dev/null @@ -1,6 +0,0 @@ -void memory_barrier (void) { __sync_synchronize (); } -int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } -int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } -void mutex_unlock (int *m) { __sync_lock_release (m); } - -int main(void) { return 0;} diff --git a/meson.build b/meson.build index 71073e26e..343c06bf3 100644 --- a/meson.build +++ b/meson.build @@ -334,10 +334,6 @@ foreach check : check_funcs endif endforeach -if cpp.links(files('meson-cc-tests/intel-atomic-primitives-test.c'), name: 'Intel atomics') - conf.set('HAVE_INTEL_ATOMIC_PRIMITIVES', 1) -endif - if cpp.links(files('meson-cc-tests/solaris-atomic-operations.c'), name: 'Solaris atomic ops') conf.set('HAVE_SOLARIS_ATOMIC_OPS', 1) endif diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index b3fb296b4..60717c236 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -123,15 +123,6 @@ static_assert ((sizeof (LONG) == sizeof (int)), ""); #define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((P), (N), (O)) == (O)) -#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) - -#define _hb_memory_barrier() __sync_synchronize () - -#define hb_atomic_int_impl_add(AI, V) __sync_fetch_and_add ((AI), (V)) - -#define hb_atomic_ptr_impl_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N)) - - #elif !defined(HB_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS) #include