configure: Add --enable-compiler-atomic-builtins option If the toolchain supports atomic builtins and the user ask for atomic builtins, use them for the uatomic API. This requires that the toolchains used to compile the library and the user application supports such builtins. The advantage of using these builtins is that they are well known synchronization primitives by several tools such as TSAN. However, they may introduce redundant memory barriers, mainly on strongly ordered architectures. Change-Id: Ia8e97112681f744f17816dbc4cbbec805a483331 Co-authored-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Olivier Dion <odion@efficios.com> Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Build system: use SPDX identifiers The SPDX identifiers [1] are a legally binding shorthand, which can be used instead of the full boiler plate text. This is the first step towards implementing the full REUSE spec [2] to help with copyright and licensing audits and compliance. This will reduce a lot a manual work required for the licensing audit required in Debian on each update. For files that lacked copyright and licensing information, I used the following guidelines. If a clear author could be determined from the git history use it, otherwise use 'EfficiOS Inc.'. For build system files, use 'MIT', for documentation 'CC-BY-4.0' and for data files 'CC-1.0'. [1] https://spdx.org/ids-how [2] https://reuse.software/tutorial/ Change-Id: Ie507130c00b95606dc439616fda4fd9b1d35353d Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix: remove autoconf features default value in help message The default values of yes|no can be confusing combined with the --enable / --disable switches of autoconf, remove them from the help message. Change-Id: Id9c4036b2fa50e1144a43f68f71a24f0c11434eb Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Build and run regression and unit tests as C++ programs Build and run all tests under tests/regression and tests/unit as C++ programs in addition to C. This helps get confidence that urcu, when used from a C++ program, behaves well. Change-Id: Iacaa42dddbcbf59eff8e327edfd0352cce0b74b7 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix: we used weak symbols not weak aliases Remove the configure test for weak aliases since we don't use them and they are not supported on macOs. Change-Id: If245dfe02c9ec990e16e1a90983ba9d8f1eb9f4b Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure: enable extended compiler warnings Import the compiler warning flag detection system from Babeltrace and enable extended compiler warnings. Change-Id: Ia3ef4d37640fb3384dc76778ed88d0519f9b7e25 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Introduce AE_FEATURE to manage configure features The new AE_FEATURE set of macros are wrappers over autoconf's AC_ARG_ENABLE. The main objective is to make the m4sh code more readable to the less seasoned autotools enthusiast among us and reduce the duplication of code with its associated bugs. The AE prefix was chosen to mean "Autotools EfficiOS" and is part of an effort to standardize our custom macros across all our autotools based projects. Change-Id: Ief565473b38150fe2104492c6339bac73efba895 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure: regroup and expand C compiler checks This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: I7d6f93c738334c6c0d9851924296a537cb076360 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: configure: support Autoconf 2.70 The newly-released autoconf 2.70 introduces a number of breaking changes [1] and is being rolled-out by some distros. Amongst those changes, the AC_PROG_CC_STDC macro is marked as obsolete and was merged into AC_PROG_CC, which we already use. On 2.70, this results in a warning which we handle as an error. A version check is added to invoke the AC_PROG_CC_STDC macro only when running a pre-2.70 version of autoconf, fixing the issue. Also, the AX_PTHREAD macro makes use of the $as_echo built-in shell variable which no longer exists in 2.70. A patch was submitted to the GNU Autoconf archive in March, but there have been no signs of life given since then [2]. As such, our local copy is updated to the latest version and the patch (which looks fairly straight-forward / safe) is applied. This should minimize changes once we go back to an "official" version of the macro. [1] https://lwn.net/Articles/839395/ [2] https://savannah.gnu.org/patch/?9906 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: Id57ad87e63c2d398e3d8b81129f9b867b878e01f
Fix: tls-compat.h exposes compiler-dependent public configuration Exposing the storage class chosen by ax_tls.m4 in a public header is a bad idea, because if a recent gcc is used when configuring liburcu, thus detecting C11, it will choose _Thread_local. Then, if an external project uses urcu/tls-compat.h with an older gcc (e.g. 4.8), it will fail to build, because that storage class is unknown, and __thread should be used instead. Therefore, use a preprocessor conditional on __cplusplus to detect C++11 (and use thread_local). Else, the STDC version is used to select _Thread_local. Else check if _MSC_VER is defined to select __declspec(thread), or else rely on __thread as fallback. Remove ax_tls.m4 because it is now unused. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Port: Fixes to build system for portability Move our own m4 scripts to m4/. Scripts in this directory are automatically included. Make nproc command configurable. Make grep command configurable. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>