QuickJSR 1.8.0 undefined atomic_fetch_add symbol with Rv4.5.0
I cannot figure out why this module will not install on R v4.5.0 with gcc v12.2.0 on rhel9.
$ R CMD INSTALL QuickJSR_1.8.0.tar.gz
- installing to library ‘/nas/rhel9/apps/r/4.5.0/lib64/R/library’
- installing source package ‘QuickJSR’ ...
** this is package ‘QuickJSR’ version ‘1.8.0’
** package ‘QuickJSR’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘gcc (GCC) 12.2.0’
using C++ compiler: ‘g++ (GCC) 12.2.0’
gcc -I"/nas/rhel9/apps/r/4.5.0/lib64/R/include" -DNDEBUG -I"../inst/include/" -I"quickjs" -D_GNU_SOURCE -I/usr/local/include -fpic -g -O2 -funsigned-char -std=gnu11 -c libquickjs.c
In file included from libquickjs.c:5:
quickjs/quickjs.c: In function ‘js_atomics_op’:
quickjs/quickjs.c:56641:17: warning: implicit declaration of function ‘atomic_fetch_add’ [-Wimplicit-function-declaration]
56641 | OP(ADD, atomic_fetch_add)
| ^~~~~~~~~~~~~~~~
quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’
56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56642:17: warning: implicit declaration of function ‘atomic_fetch_and’ [-Wimplicit-function-declaration] 56642 | OP(AND, atomic_fetch_and) | ^~~~~~~~~~~~~~~~ quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’ 56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56643:16: warning: implicit declaration of function ‘atomic_fetch_or’ [-Wimplicit-function-declaration] 56643 | OP(OR, atomic_fetch_or) | ^~~~~~~~~~~~~~~ quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’ 56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56644:17: warning: implicit declaration of function ‘atomic_fetch_sub’ [-Wimplicit-function-declaration] 56644 | OP(SUB, atomic_fetch_sub) | ^~~~~~~~~~~~~~~~ quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’ 56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56645:17: warning: implicit declaration of function ‘atomic_fetch_xor’ [-Wimplicit-function-declaration] 56645 | OP(XOR, atomic_fetch_xor) | ^~~~~~~~~~~~~~~~ quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’ 56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56646:22: warning: implicit declaration of function ‘atomic_exchange’ [-Wimplicit-function-declaration] 56646 | OP(EXCHANGE, atomic_exchange) | ^~~~~~~~~~~~~~~ quickjs/quickjs.c:56630:12: note: in definition of macro ‘OP’ 56630 | a = func_name((_Atomic uint8_t *)ptr, v);
| ^~~~~~~~~ quickjs/quickjs.c:56650:13: warning: implicit declaration of function ‘atomic_load’ [-Wimplicit-function-declaration] 56650 | a = atomic_load((_Atomic uint8_t *)ptr); | ^~~~~~~~~~~ quickjs/quickjs.c:56664:13: warning: implicit declaration of function ‘atomic_compare_exchange_strong’ [-Wimplicit-function-declaration] 56664 | atomic_compare_exchange_strong((_Atomic uint8_t *)ptr, &v1, rep_val); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quickjs/quickjs.c: In function ‘js_atomics_store’: quickjs/quickjs.c:56749:9: warning: implicit declaration of function ‘atomic_store’; did you mean ‘js_atomics_store’? [-Wimplicit-function-declaration] 56749 | atomic_store((_Atomic uint64_t *)ptr, v64); | ^~~~~~~~~~~~ | js_atomics_store g++ -std=gnu++17 -I"/nas/rhel9/apps/r/4.5.0/lib64/R/include" -DNDEBUG -I"../inst/include/" -I"quickjs" -D_GNU_SOURCE -I/usr/local/include -fpic -g -O2 -c quickjsr.cpp -o quickjsr.o g++ -std=gnu++17 -I"/nas/rhel9/apps/r/4.5.0/lib64/R/include" -DNDEBUG -I"../inst/include/" -I"quickjs" -D_GNU_SOURCE -I/usr/local/include -fpic -g -O2 -c init.cpp -o init.o g++ -std=gnu++17 -shared -L/nas/rhel9/apps/r/4.5.0/lib64/R/lib -L/usr/local/lib64 -o QuickJSR.so quickjsr.o init.o libquickjs.o -L/nas/rhel9/apps/r/4.5.0/lib64/R/lib -lR installing to /nas/rhel9/apps/r/4.5.0/lib64/R/library/00LOCK-QuickJSR/00new/QuickJSR/libs ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location Error: package or namespace load failed for ‘QuickJSR’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/nas/rhel9/apps/r/4.5.0/lib64/R/library/00LOCK-QuickJSR/00new/QuickJSR/libs/QuickJSR.so': /nas/rhel9/apps/r/4.5.0/lib64/R/library/00LOCK-QuickJSR/00new/QuickJSR/libs/QuickJSR.so: undefined symbol: atomic_fetch_add Error: loading failed Execution halted ERROR: loading failed - removing ‘/nas/rhel9/apps/r/4.5.0/lib64/R/library/QuickJSR’
When I manually compile the code works fine. And the atomic_fetch_add symbol is there.
$ nm QuickJSR.so | \grep atomic_fetch U atomic_fetch_add U atomic_fetch_and U atomic_fetch_or U atomic_fetch_sub U atomic_fetch_xor
Hmm very odd. I've just added RHEL9 to the CI and it all builds and passes tests without issue, so I think it might a configuration issue or something else system-specific: https://github.com/andrjohns/QuickJSR/actions/runs/16495175725/job/46639078160
Those declarations would be in stdatomic.h, is your compiler able to include it:
echo "#include <stdatomic.h>" | gcc -E -dM -
$ module list Currently Loaded Modules:
- gcc/12.2.0 2) openmpi/5.0.6-gcc_12.2.0 3) r/4.5.0
$ echo "#include <stdatomic.h>" | gcc -E -dM - #define DBL_MIN_EXP (-1021) #define UINT_LEAST16_MAX 0xffff #define FLT16_HAS_QUIET_NAN 1 #define __ATOMIC_ACQUIRE 2 #define FLT128_MAX_10_EXP 4932 #define FLT_MIN 1.17549435082228750796873653722224568e-38F #define __GCC_IEC_559_COMPLEX 2 #define UINT_LEAST8_TYPE unsigned char #define SIZEOF_FLOAT80 16 #define __INTMAX_C(c) c ## L #define CHAR_BIT 8 #define UINT8_MAX 0xff #define SCHAR_WIDTH 8 #define WINT_MAX 0xffffffffU #define FLT32_MIN_EXP (-125) #define ORDER_LITTLE_ENDIAN 1234 #define SIZE_MAX 0xffffffffffffffffUL #define WCHAR_MAX 0x7fffffff #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 #define __GCC_ATOMIC_CHAR_LOCK_FREE 2 #define __GCC_IEC_559 2 #define FLT32X_DECIMAL_DIG 17 #define FLT_EVAL_METHOD 0 #define FLT64_DECIMAL_DIG 17 #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 #define UINT_FAST64_MAX 0xffffffffffffffffUL #define SIG_ATOMIC_TYPE int #define DBL_MIN_10_EXP (-307) #define FINITE_MATH_ONLY 0 #define FLT32X_MAX_EXP 1024 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define FLT32_HAS_DENORM 1 #define UINT_FAST8_MAX 0xff #define FLT32_MAX_10_EXP 38 #define DEC64_MAX_EXP 385 #define __INT8_C(c) c #define INT_LEAST8_WIDTH 8 #define UINT_LEAST64_MAX 0xffffffffffffffffUL #define SHRT_MAX 0x7fff #define LDBL_MAX 1.18973149535723176502126385303097021e+4932L #define FLT64X_MAX_10_EXP 4932 #define LDBL_IS_IEC_60559 2 #define FLT64X_HAS_QUIET_NAN 1 #define UINT_LEAST8_MAX 0xff #define __GCC_ATOMIC_BOOL_LOCK_FREE 2 #define FLT128_DENORM_MIN 6.47517511943802511092443895822764655e-4966F128 #define UINTMAX_TYPE long unsigned int #define __linux 1 #define DEC32_EPSILON 1E-6DF #define FLT_EVAL_METHOD_TS_18661_3 0 #define __unix 1 #define UINT32_MAX 0xffffffffU #define DBL_DENORM_MIN ((double)4.94065645841246544176568792868221372e-324L) #define FLT128_MIN_EXP (-16381) #define WINT_MIN 0U #define FLT128_MIN_10_EXP (-4931) #define FLT32X_IS_IEC_60559 2 #define INT_LEAST16_WIDTH 16 #define SCHAR_MAX 0x7f #define FLT128_MANT_DIG 113 #define WCHAR_MIN (-WCHAR_MAX - 1) #define __INT64_C(c) c ## L #define __GCC_ATOMIC_POINTER_LOCK_FREE 2 #define FLT32X_MANT_DIG 53 #define FLT64X_EPSILON 1.08420217248550443400745280086994171e-19F64x #define STDC_HOSTED 1 #define DEC64_MIN_EXP (-382) #define DBL_DIG 15 #define FLT32_DIG 6 #define FLT_EPSILON 1.19209289550781250000000000000000000e-7F #define SHRT_WIDTH 16 #define FLT32_IS_IEC_60559 2 #define LDBL_MIN 3.36210314311209350626267781732175260e-4932L #define STDC_UTF_16 1 #define DBL_IS_IEC_60559 2 #define DEC32_MAX 9.999999E96DF #define FLT64X_DENORM_MIN 3.64519953188247460252840593361941982e-4951F64x #define FLT32X_HAS_INFINITY 1 #define INT32_MAX 0x7fffffff #define FLT16_DIG 3 #define unix 1 #define INT_WIDTH 32 #define SIZEOF_LONG 8 #define STDC_IEC_559 1 #define STDC_ISO_10646 201706L #define __UINT16_C(c) c #define DECIMAL_DIG 21 #define STDC_IEC_559_COMPLEX 1 #define FLT64_EPSILON 2.22044604925031308084726333618164062e-16F64 #define gnu_linux 1 #define FLT128_IS_IEC_60559 2 #define FLT64X_MIN_10_EXP (-4931) #define LDBL_HAS_QUIET_NAN 1 #define FLT16_MIN_EXP (-13) #define FLT64_MANT_DIG 53 #define FLT64X_MANT_DIG 64 #define GNUC 12 #define MMX 1 #define FLT_HAS_DENORM 1 #define SIZEOF_LONG_DOUBLE 16 #define BIGGEST_ALIGNMENT 16 #define FLT64_MAX_10_EXP 308 #define FLT16_MAX_10_EXP 4 #define DBL_MAX ((double)1.79769313486231570814527423731704357e+308L) #define INT_FAST32_MAX 0x7fffffffffffffffL #define DBL_HAS_INFINITY 1 #define SIZEOF_FLOAT 4 #define __HAVE_SPECULATION_SAFE_VALUE 1 #define _GLIBCXX_STDATOMIC_H #define DEC32_MIN_EXP (-94) #define INTPTR_WIDTH 64 #define FLT64X_HAS_INFINITY 1 #define UINT_LEAST32_MAX 0xffffffffU #define FLT32X_HAS_DENORM 1 #define INT_FAST16_TYPE long int #define MMX_WITH_SSE 1 #define LDBL_HAS_DENORM 1 #define __SEG_GS 1 #define FLT128_HAS_INFINITY 1 #define DEC32_MIN 1E-95DF #define DBL_MAX_EXP 1024 #define WCHAR_WIDTH 32 #define FLT32_MAX 3.40282346638528859811704183484516925e+38F32 #define DEC128_EPSILON 1E-33DL #define FLT16_DECIMAL_DIG 5 #define SSE2_MATH 1 #define __ATOMIC_HLE_RELEASE 131072 #define PTRDIFF_MAX 0x7fffffffffffffffL #define __amd64 1 #define __ATOMIC_HLE_ACQUIRE 65536 #define LONG_LONG_MAX 0x7fffffffffffffffLL #define SIZEOF_SIZE_T 8 #define FLT64X_MIN_EXP (-16381) #define SIZEOF_WINT_T 4 #define LONG_LONG_WIDTH 64 #define FLT32_MAX_EXP 128 #define __GXX_ABI_VERSION 1017 #define FLT_MIN_EXP (-125) #define __GCC_HAVE_DWARF2_CFI_ASM 1 #define INT16_MAX 0x7fff #define __x86_64 1 #define INT_FAST64_TYPE long int #define FLT64_DENORM_MIN 4.94065645841246544176568792868221372e-324F64 #define DBL_MIN ((double)2.22507385850720138309023271733240406e-308L) #define FLT16_DENORM_MIN 5.96046447753906250000000000000000000e-8F16 #define FLT128_EPSILON 1.92592994438723585305597794258492732e-34F128 #define FLT64X_NORM_MAX 1.18973149535723176502126385303097021e+4932F64x #define SIZEOF_POINTER 8 #define LP64 1 #define DBL_HAS_QUIET_NAN 1 #define FLT32X_EPSILON 2.22044604925031308084726333618164062e-16F32x #define DECIMAL_BID_FORMAT 1 #define FLT64_MIN_EXP (-1021) #define FLT64_MIN_10_EXP (-307) #define FLT16_MIN_10_EXP (-4) #define FLT64X_DECIMAL_DIG 21 #define DEC128_MIN 1E-6143DL #define REGISTER_PREFIX #define UINT16_MAX 0xffff #define DBL_HAS_DENORM 1 #define LDBL_HAS_INFINITY 1 #define FLT32_MIN 1.17549435082228750796873653722224568e-38F32 #define UINT8_TYPE unsigned char #define FLT_DIG 6 #define NO_INLINE 1 #define DEC_EVAL_METHOD 2 #define DEC128_MAX 9.999999999999999999999999999999999E6144DL #define FLT_MANT_DIG 24 #define LDBL_DECIMAL_DIG 21 #define VERSION "12.2.0" #define __UINT64_C(c) c ## UL #define _STDC_PREDEF_H 1 #define INT_LEAST32_MAX 0x7fffffff #define __GCC_ATOMIC_INT_LOCK_FREE 2 #define FLT128_MAX_EXP 16384 #define FLT32_MANT_DIG 24 #define FLOAT_WORD_ORDER ORDER_LITTLE_ENDIAN #define FLT32X_MIN_EXP (-1021) #define FLT128_HAS_DENORM 1 #define FLT32_DECIMAL_DIG 9 #define FLT128_DIG 33 #define __INT32_C(c) c #define DEC64_EPSILON 1E-15DD #define ORDER_PDP_ENDIAN 3412 #define DEC128_MIN_EXP (-6142) #define INT_FAST32_TYPE long int #define UINT_LEAST16_TYPE short unsigned int #define unix 1 #define SIZE_TYPE long unsigned int #define UINT64_MAX 0xffffffffffffffffUL #define FLT_IS_IEC_60559 2 #define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE" #define FLT64X_DIG 18 #define INT8_TYPE signed char #define ELF 1 #define GCC_ASM_FLAG_OUTPUTS 1 #define UINT32_TYPE unsigned int #define FLT_RADIX 2 #define INT_LEAST16_TYPE short int #define LDBL_EPSILON 1.08420217248550443400745280086994171e-19L #define __UINTMAX_C(c) c ## UL #define SSE_MATH 1 #define __k8 1 #define FLT32X_MIN 2.22507385850720138309023271733240406e-308F32x #define SIG_ATOMIC_MAX 0x7fffffff #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 #define USER_LABEL_PREFIX #define SIZEOF_PTRDIFF_T 8 #define LDBL_DIG 18 #define FLT64_IS_IEC_60559 2 #define x86_64 1 #define FLT16_IS_IEC_60559 2 #define FLT16_MAX_EXP 16 #define DEC32_SUBNORMAL_MIN 0.000001E-95DF #define INT_FAST16_MAX 0x7fffffffffffffffL #define __GCC_CONSTRUCTIVE_SIZE 64 #define FLT64_DIG 15 #define UINT_FAST32_MAX 0xffffffffffffffffUL #define UINT_LEAST64_TYPE long unsigned int #define FLT16_EPSILON 9.76562500000000000000000000000000000e-4F16 #define FLT_HAS_QUIET_NAN 1 #define FLT_MAX_10_EXP 38 #define LONG_MAX 0x7fffffffffffffffL #define FLT64X_HAS_DENORM 1 #define DEC128_SUBNORMAL_MIN 0.000000000000000000000000000000001E-6143DL #define FLT_HAS_INFINITY 1 #define __GNUC_EXECUTION_CHARSET_NAME "UTF-8" #define UINT_FAST16_TYPE long unsigned int #define DEC64_MAX 9.999999999999999E384DD #define INT_FAST32_WIDTH 64 #define CHAR16_TYPE short unsigned int #define __PRAGMA_REDEFINE_EXTNAME 1 #define SIZE_WIDTH 64 #define __SEG_FS 1 #define INT_LEAST16_MAX 0x7fff #define FLT16_NORM_MAX 6.55040000000000000000000000000000000e+4F16 #define DEC64_MANT_DIG 16 #define INT64_MAX 0x7fffffffffffffffL #define FLT32_DENORM_MIN 1.40129846432481707092372958328991613e-45F32 #define SIG_ATOMIC_WIDTH 32 #define INT_LEAST64_TYPE long int #define INT16_TYPE short int #define INT_LEAST8_TYPE signed char #define FLT16_MAX 6.55040000000000000000000000000000000e+4F16 #define STDC_VERSION 201710L #define SIZEOF_INT 4 #define DEC32_MAX_EXP 97 #define INT_FAST8_MAX 0x7f #define FLT128_MAX 1.18973149535723176508575932662800702e+4932F128 #define INTPTR_MAX 0x7fffffffffffffffL #define linux 1 #define FLT64_HAS_QUIET_NAN 1 #define FLT32_MIN_10_EXP (-37) #define FLT32X_DIG 15 #define PTRDIFF_WIDTH 64 #define LDBL_MANT_DIG 64 #define FLT64_HAS_INFINITY 1 #define FLT64X_MAX 1.18973149535723176502126385303097021e+4932F64x #define FLT16_HAS_INFINITY 1 #define SIG_ATOMIC_MIN (-SIG_ATOMIC_MAX - 1) #define code_model_small 1 #define __GCC_ATOMIC_LONG_LOCK_FREE 2 #define DEC32_MANT_DIG 7 #define FLT16_MANT_DIG 11 #define k8 1 #define INTPTR_TYPE long int #define UINT16_TYPE short unsigned int #define WCHAR_TYPE int #define UINTPTR_MAX 0xffffffffffffffffUL #define INT_FAST64_WIDTH 64 #define INT_FAST64_MAX 0x7fffffffffffffffL #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 #define FLT_NORM_MAX 3.40282346638528859811704183484516925e+38F #define FLT32_HAS_INFINITY 1 #define FLT64X_MAX_EXP 16384 #define UINT_FAST64_TYPE long unsigned int #define INT_MAX 0x7fffffff #define linux 1 #define INT64_TYPE long int #define FLT_MAX_EXP 128 #define ORDER_BIG_ENDIAN 4321 #define DBL_MANT_DIG 53 #define SIZEOF_FLOAT128 16 #define INT_LEAST64_MAX 0x7fffffffffffffffL #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 #define DEC64_MIN 1E-383DD #define WINT_TYPE unsigned int #define UINT_LEAST32_TYPE unsigned int #define SIZEOF_SHORT 2 #define FLT32_NORM_MAX 3.40282346638528859811704183484516925e+38F32 #define SSE 1 #define LDBL_MIN_EXP (-16381) #define FLT64_MAX 1.79769313486231570814527423731704357e+308F64 #define amd64 1 #define WINT_WIDTH 32 #define INT_LEAST8_MAX 0x7f #define INT_LEAST64_WIDTH 64 #define LDBL_MAX_EXP 16384 #define FLT32X_MAX_10_EXP 308 #define SIZEOF_INT128 16 #define FLT16_MIN 6.10351562500000000000000000000000000e-5F16 #define FLT64X_IS_IEC_60559 2 #define LDBL_MAX_10_EXP 4932 #define __ATOMIC_RELAXED 0 #define DBL_EPSILON ((double)2.22044604925031308084726333618164062e-16L) #define FLT128_MIN 3.36210314311209350626267781732175260e-4932F128 #define _LP64 1 #define __UINT8_C(c) c #define FLT64_MAX_EXP 1024 #define INT_LEAST32_TYPE int #define SIZEOF_WCHAR_T 4 #define UINT64_TYPE long unsigned int #define GNUC_PATCHLEVEL 0 #define FLT128_NORM_MAX 1.18973149535723176508575932662800702e+4932F128 #define FLT64_NORM_MAX 1.79769313486231570814527423731704357e+308F64 #define FLT128_HAS_QUIET_NAN 1 #define INTMAX_MAX 0x7fffffffffffffffL #define INT_FAST8_TYPE signed char #define FLT64X_MIN 3.36210314311209350626267781732175260e-4932F64x #define GNUC_STDC_INLINE 1 #define FLT64_HAS_DENORM 1 #define FLT32_EPSILON 1.19209289550781250000000000000000000e-7F32 #define FLT16_HAS_DENORM 1 #define DBL_DECIMAL_DIG 17 #define STDC_UTF_32 1 #define INT_FAST8_WIDTH 8 #define FXSR 1 #define FLT32X_MAX 1.79769313486231570814527423731704357e+308F32x #define DBL_NORM_MAX ((double)1.79769313486231570814527423731704357e+308L) #define BYTE_ORDER ORDER_LITTLE_ENDIAN #define __GCC_DESTRUCTIVE_SIZE 64 #define INTMAX_WIDTH 64 #define __UINT32_C(c) c ## U #define FLT_DENORM_MIN 1.40129846432481707092372958328991613e-45F #define INT8_MAX 0x7f #define LONG_WIDTH 64 #define UINT_FAST32_TYPE long unsigned int #define FLT32X_NORM_MAX 1.79769313486231570814527423731704357e+308F32x #define CHAR32_TYPE unsigned int #define FLT_MAX 3.40282346638528859811704183484516925e+38F #define SSE2 1 #define INT32_TYPE int #define SIZEOF_DOUBLE 8 #define FLT_MIN_10_EXP (-37) #define FLT64_MIN 2.22507385850720138309023271733240406e-308F64 #define INT_LEAST32_WIDTH 32 #define INTMAX_TYPE long int #define DEC128_MAX_EXP 6145 #define FLT32X_HAS_QUIET_NAN 1 #define __ATOMIC_CONSUME 1 #define GNUC_MINOR 2 #define INT_FAST16_WIDTH 64 #define UINTMAX_MAX 0xffffffffffffffffUL #define FLT32X_DENORM_MIN 4.94065645841246544176568792868221372e-324F32x #define DBL_MAX_10_EXP 308 #define LDBL_DENORM_MIN 3.64519953188247460252840593361941982e-4951L #define __INT16_C(c) c #define STDC 1 #define PTRDIFF_TYPE long int #define __ATOMIC_SEQ_CST 5 #define FLT32X_MIN_10_EXP (-307) #define UINTPTR_TYPE long unsigned int #define DEC64_SUBNORMAL_MIN 0.000000000000001E-383DD #define DEC128_MANT_DIG 34 #define LDBL_MIN_10_EXP (-4931) #define SIZEOF_LONG_LONG 8 #define FLT128_DECIMAL_DIG 36 #define __GCC_ATOMIC_LLONG_LOCK_FREE 2 #define FLT32_HAS_QUIET_NAN 1 #define FLT_DECIMAL_DIG 9 #define UINT_FAST16_MAX 0xffffffffffffffffUL #define LDBL_NORM_MAX 1.18973149535723176502126385303097021e+4932L #define __GCC_ATOMIC_SHORT_LOCK_FREE 2 #define UINT_FAST8_TYPE unsigned char #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_RELEASE 3
atomic_fetch_add is expected to be provided by GCC - check what symbols it provides:
$ readelf -Ws --dyn-syms /nas//rhel9/apps/gcc/12.2.0/lib64/libatomic.so | grep "atomic_fetch_add" 65: 61: 00000000000031d0 11 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_1@@LIBATOMIC_1.0 67: 63: 0000000000003370 12 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_2@@LIBATOMIC_1.0 69: 65: 0000000000003510 11 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_4@@LIBATOMIC_1.0 71: 67: 0000000000003b30 87 IFUNC GLOBAL DEFAULT 13 __atomic_fetch_add_16@@LIBATOMIC_1.0 75: 71: 00000000000036b0 13 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_8@@LIBATOMIC_1.0 447: 331: 0000000000003370 12 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_2 466: 350: 0000000000003510 11 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_4 467: 351: 00000000000036b0 13 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_8 495: 379: 0000000000003b30 87 IFUNC GLOBAL DEFAULT 13 __atomic_fetch_add_16 501: 385: 00000000000031d0 11 FUNC GLOBAL DEFAULT 13 __atomic_fetch_add_1
Also check the system library: $ readelf -Ws --dyn-syms /usr/lib64/libatomic.so.1 | grep "atomic_fetch_add" 66: 62: 0000000000003110 11 FUNC GLOBAL DEFAULT 14 __atomic_fetch_add_1@@LIBATOMIC_1.0 68: 64: 00000000000032b0 12 FUNC GLOBAL DEFAULT 14 __atomic_fetch_add_2@@LIBATOMIC_1.0 70: 66: 0000000000003450 11 FUNC GLOBAL DEFAULT 14 __atomic_fetch_add_4@@LIBATOMIC_1.0 72: 68: 0000000000003870 73 FUNC GLOBAL DEFAULT 14 __atomic_fetch_add_16@@LIBATOMIC_1.0 76: 72: 00000000000035f0 13 FUNC GLOBAL DEFAULT 14 __atomic_fetch_add_8@@LIBATOMIC_1.0 From: Andrew Johnson @.> Sent: Thursday, July 24, 2025 7:36 AM To: andrjohns/QuickJSR @.> Cc: Fishback, Steven C @.>; Author @.> Subject: Re: [andrjohns/QuickJSR] QuickJSR 1.8.0 undefined atomic_fetch_add symbol with Rv4.5.0 (Issue #89)
[https://avatars.githubusercontent.com/u/27717896?s=20&v=4]andrjohns left a comment (andrjohns/QuickJSR#89)https://github.com/andrjohns/QuickJSR/issues/89#issuecomment-3113114801
Hmm very odd. I've just added RHEL9 to the CI and it all builds and passes tests without issue, so I think it might a configuration issue or something else system-specific: https://github.com/andrjohns/QuickJSR/actions/runs/16495175725/job/46639078160
Those declarations would be in stdatomic.h, is your compiler able to include it:
echo "#include <stdatomic.h>" | gcc -E -dM -
Reply to this email directly, view it on GitHubhttps://github.com/andrjohns/QuickJSR/issues/89#issuecomment-3113114801, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAOK2EIOWKFM7RQBWNJIW3D3KDAIJAVCNFSM6AAAAACCEAZM4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMJTGEYTIOBQGE. You are receiving this because you authored the thread.Message ID: @.@.>>