Skip to content

Commit

Permalink
Add check for -latomic
Browse files Browse the repository at this point in the history
Later versions of gcc on some architectures push atomic functions
out into a separate atomic library; add a check to see when this
is required and add it to LIBS if need be.

Specifically the problem was observed on GCC 4.8.2 on powerpc
architecture for Ubuntu 14.04:

https://launchpadlibrarian.net/155235096/buildlog_ubuntu-trusty-powerpc.openvswitch_2.0.0-0ubuntu1_FAILEDTOBUILD.txt.gz

Signed-off-by: James Page <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
javacruft authored and blp committed Dec 5, 2013
1 parent fabbb97 commit fd2e50c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ 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)
Expand Down
6 changes: 6 additions & 0 deletions m4/openvswitch.m4
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ 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.
Expand Down

0 comments on commit fd2e50c

Please sign in to comment.