From c20e074efa2d3b982e5190bc99d1909937df7f9b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 15 Mar 2020 11:08:47 +0800 Subject: [PATCH] admin/build-doc: add optional "_" prefix before function names to match as compilers targeting ELF does not add the leading "_" to symbol names, while clang on OSX always do this. and remove the underscore from the symbol name when generating the function name, as the compiler will add it back for us. Signed-off-by: Kefu Chai --- admin/build-doc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/build-doc b/admin/build-doc index 225de0907ff..b69c0aceb12 100755 --- a/admin/build-doc +++ b/admin/build-doc @@ -100,8 +100,8 @@ for bind in rados rbd cephfs rgw; do else func_prefix="(lib)?${bind}" fi - nm $lib_fn | grep -E "U ${func_prefix}" | \ - awk '{ print "void "$2"(void) {}" }' | \ + nm $lib_fn | grep -E "U (_)?${func_prefix}" | \ + awk '{ gsub(/^_/,"",$2); print "void "$2"(void) {}" }' | \ gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc - if [ ${bind} != rados ]; then rm -f $TOPDIR/src/pybind/${bind}/rados.pxd -- 2.39.5