Commit fd2e50c (Add check for -latomic) fixed a bug for 32-bit
PowerPC systems, where the compiler would generate calls to
functions implemented by libatomic, such as '__atomic_load_8'.

Nonetheless, it passes '-latomic' to all files that get compiled
and that isn't necessary, so add it only for 'test-atomic.c'.

Signed-off-by: Cosmin Paraschiv <cosmin.parasc...@freescale.com>
---
 configure.ac      | 1 -
 m4/openvswitch.m4 | 6 ------
 tests/automake.mk | 2 +-
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 09e01fb..6f72934 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,6 @@ OVS_CHECK_XENSERVER_VERSION
 OVS_CHECK_GROFF
 OVS_CHECK_GNU_MAKE
 OVS_CHECK_TLS
-OVS_CHECK_ATOMIC_LIBS
 OVS_CHECK_GCC4_ATOMICS
 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 7a0465b..76eae75 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -318,12 +318,6 @@ static thread_local int var;], [return var;])],
      fi
    fi])
 
-dnl OVS_CHECK_ATOMIC_LIBS
-dnl
-dnl Check to see if -latomic is need for GCC atomic built-ins.
-AC_DEFUN([OVS_CHECK_ATOMIC_LIBS],
-   [AC_SEARCH_LIBS([__atomic_load_8], [atomic])])
-
 dnl OVS_CHECK_GCC4_ATOMICS
 dnl
 dnl Checks whether the compiler and linker support GCC 4.0+ atomic built-ins.
diff --git a/tests/automake.mk b/tests/automake.mk
index 739d79e..1d245f3 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -185,7 +185,7 @@ tests_test_aes128_LDADD = lib/libopenvswitch.la
 
 noinst_PROGRAMS += tests/test-atomic
 tests_test_atomic_SOURCES = tests/test-atomic.c
-tests_test_atomic_LDADD = lib/libopenvswitch.la
+tests_test_atomic_LDADD = lib/libopenvswitch.la -latomic
 
 noinst_PROGRAMS += tests/test-bundle
 tests_test_bundle_SOURCES = tests/test-bundle.c
-- 
1.8.3.2


_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to