mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
link with -latomic when needed
Some architecture such as sparc and some flavors of arm needs -latomic to avoid the following build failure: gthread-posix.c:(.text+0xda8): undefined reference to `__atomic_compare_exchange_4' Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
parent
da9545baaf
commit
4e6dc4dee0
@ -419,6 +419,7 @@ libglib = library('glib-2.0',
|
|||||||
include_directories : configinc,
|
include_directories : configinc,
|
||||||
link_with: [charset_lib, gnulib_lib],
|
link_with: [charset_lib, gnulib_lib],
|
||||||
dependencies : [
|
dependencies : [
|
||||||
|
atomic_dep,
|
||||||
gnulib_libm_dependency,
|
gnulib_libm_dependency,
|
||||||
libiconv,
|
libiconv,
|
||||||
libintl_deps,
|
libintl_deps,
|
||||||
|
@ -2233,6 +2233,15 @@ libffi_dep = dependency('libffi', version : '>= 3.0.0')
|
|||||||
|
|
||||||
libz_dep = dependency('zlib')
|
libz_dep = dependency('zlib')
|
||||||
|
|
||||||
|
libatomic_test_code = '''
|
||||||
|
int main (int argc, char ** argv) {
|
||||||
|
return 0;
|
||||||
|
}'''
|
||||||
|
atomic_dep = []
|
||||||
|
if cc.links(libatomic_test_code, args : '-latomic', name : 'check for -latomic')
|
||||||
|
atomic_dep = cc.find_library('atomic')
|
||||||
|
endif
|
||||||
|
|
||||||
# First check in libc, fallback to libintl, and as last chance build
|
# First check in libc, fallback to libintl, and as last chance build
|
||||||
# proxy-libintl subproject.
|
# proxy-libintl subproject.
|
||||||
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
|
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
|
||||||
|
Loading…
x
Reference in New Issue
Block a user