Skip to content

Commit

Permalink
link with -latomic if needed
Browse files Browse the repository at this point in the history
numactl unconditionally uses __atomic_fetch_and but some architectures
(e.g. sparc) needs to link with -latomic to be able to use it. So check
if -latomic is needed and update numa.pc accordingly

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine authored and andikleen committed May 7, 2021
1 parent 93867c5 commit e0de0d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ SED_PROCESS = \
-e 's,@exec_prefix\@,$(exec_prefix),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@includedir\@,$(includedir),g' \
-e 's,@LIBS\@,$(LIBS),g' \
< $< > $@ || rm $@

%.pc: %.pc.in Makefile
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ AM_CONDITIONAL([HAVE_TREE_VECTORIZE], [test x"${tree_vectorize}" = x"true"])

AC_CONFIG_FILES([Makefile])

AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic])

# GCC tries to be "helpful" and only issue a warning for unrecognized
# attributes. So we compile the test with Werror, so that if the
# attribute is not recognized the compilation fails
Expand Down
1 change: 1 addition & 0 deletions numa.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Description: NUMA policy library
Version: @VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lnuma
Libs.Private: @LIBS@

0 comments on commit e0de0d9

Please sign in to comment.