Skip to content
Snippets Groups Projects
Verified Commit c54cb4d2 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Build system: under Linux, do not try to statically link libgomp even with -Dprefer_static=true

Under Debian 12, it fails with:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/12/libgomp.a(team.o): réadressage R_X86_64_TPOFF32 vers symbole caché « gomp_tls_data » ne peut pas être utilisé en créant un objet partagé

(cherry picked from commit 88236b1c)
parent 57e8c52e
No related branches found
No related tags found
No related merge requests found
......@@ -294,9 +294,12 @@ if get_option('prefer_static')
# NB: constructing a dependency object with link_args : ['-Wl,-Bstatic', '-lgomp', '-Wl,-Bdynamic'] does not work,
# because it reorders the three arguments and puts -lgomp at the end
if host_machine.system() != 'linux'
# Under Debian 12, trying to link (static) libgomp.a in a MEX fails.
openmp_dep_tmp = cpp_compiler.find_library('gomp', static : true)
openmp_dep = declare_dependency(dependencies : [ openmp_dep, openmp_dep_tmp ])
endif
endif
# For use when creating intermediate static libraries to be incorporated in MEX files
static_library_kwargs = mex_kwargs + { 'name_prefix' : [], 'name_suffix' : [], 'link_args' : [], 'pic' : true, 'install' : false }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment