]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
admin/build-doc: add optional "_" prefix before function names to match
authorKefu Chai <kchai@redhat.com>
Sun, 15 Mar 2020 03:08:47 +0000 (11:08 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 15 Mar 2020 04:50:45 +0000 (12:50 +0800)
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 <kchai@redhat.com>
admin/build-doc

index 225de0907ff6ebfb4efc5b6778204a36c2f222c9..b69c0aceb129fd8fc81de0e493cbe25fabeb0b1f 100755 (executable)
@@ -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