when building python bindings extensions using Cython, we first perform
sanity checks by building an executable and linking it against the
shared library of the C language binding. if the executable builds,
we consider the sanity test passes.
before this change, we don't add `LDFLAGS` specified in environmental
variable to the ldflags when building the executable. but we need to
link against libasan, so that the symbols used by, for instance,
librados.so, can be found by the executable.
in this change, we always check `LDFLAGS`, and add it to the ldflags
when building the executable for testing, if it's set.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
extra_preargs=['-iquote{path}'.format(path=os.path.join(CEPH_SRC_DIR, 'include'))]
)
+ if ldflags := os.environ.get('LDFLAGS'):
+ extra_postargs = ldflags.split()
+ else:
+ extra_postargs = None
compiler.link_executable(
objects=link_objects,
output_progname=os.path.join(tmp_dir, 'cephfs_dummy'),
libraries=['cephfs'],
+ extra_postargs=extra_postargs,
output_dir=tmp_dir,
)
sources=[tmp_file],
output_dir=tmp_dir
)
+ if ldflags := os.environ.get('LDFLAGS'):
+ extra_postargs = ldflags.split()
+ else:
+ extra_postargs = None
compiler.link_executable(
objects=link_objects,
output_progname=os.path.join(tmp_dir, 'rados_dummy'),
libraries=['rados'],
+ extra_postargs=extra_postargs,
output_dir=tmp_dir,
)
output_dir=tmp_dir
)
+ if ldflags := os.environ.get('LDFLAGS'):
+ extra_postargs = ldflags.split()
+ else:
+ extra_postargs = None
compiler.link_executable(
objects=link_objects,
output_progname=os.path.join(tmp_dir, 'rbd_dummy'),
libraries=['rbd', 'rados'],
+ extra_postargs=extra_postargs,
output_dir=tmp_dir,
)
output_dir=tmp_dir,
)
+ if ldflags := os.environ.get('LDFLAGS'):
+ extra_postargs = ldflags.split()
+ else:
+ extra_postargs = None
compiler.link_executable(
objects=link_objects,
output_progname=os.path.join(tmp_dir, 'rgw_dummy'),
libraries=['rgw', 'rados'],
+ extra_postargs=extra_postargs,
output_dir=tmp_dir,
)