]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: pass cflags to disutils using CC instead of CFLAGS
authorKefu Chai <kchai@redhat.com>
Mon, 22 Oct 2018 04:28:01 +0000 (12:28 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Oct 2018 06:40:03 +0000 (14:40 +0800)
commit38e7686a37373e993210b0c6554d52e281d95c19
treee723cdf433bc1837fd9919e77c19be5a12789dcb
parent3ac8c8dca7689a2c72636855c90c494618063a58
cmake: pass cflags to disutils using CC instead of CFLAGS

in python's distutils.ccompiler, linker_exe is composed using CC instead
of LDFLAGS. the latter only effects how it builds (shared) library.

and put CMAKE_C_FLAGS into the cflags for the compiler for building
python C extensions, it's more consistent this way. more importantly,
if we build with ASan enabled, the canary program, a.k.a. rados_dummy.c,
won't link without proper CFLAGS.

without this change, rados.so fails to build with errors like:

/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_stack_free_10'
/usr/bin/ld: /var/ssd/ceph/build/lib/librados.so: undefined reference to
`__asan_report_exp_store8'
...
...

clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Link Error: RADOS library not found
make[3]: ***
[src/pybind/rados/CMakeFiles/cython_rados.dir/build.make:57:
src/pybind/rados/CMakeFiles/cython_rados] Error 1

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Distutils.cmake