]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: do not preload libasan if it is not found
authorKefu Chai <kchai@redhat.com>
Wed, 29 May 2019 01:45:57 +0000 (09:45 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Nov 2019 15:02:24 +0000 (23:02 +0800)
before this change, `asan_lib_path` could be `None` when we check it to
see if it ends with `NOTFOUND`. this happens if WITH_SEASTAR=OFF or
WITH_ASAN=OFF, as in that case, find_package(Sanitizers) is not called,
hence `ASAN_LIBRARY` won't be set.

in this change, libasan is only preloaded if

- (WITH_SEASTAR=ON and CMAKE_BUILD_TYPE=Debug and ASAN_LIBRARY is found)
  or
- (WITH_ASAN)

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 538cf0f8e2bb959a2348d95db3d8162be762c351)

src/ceph.in

index b2e70529193e8879f38d9302942713e86de4a600..b97d9332a92c890a3267b6903610adb365b1e83e 100755 (executable)
@@ -125,9 +125,8 @@ if os.path.exists(os.path.join(MYPDIR, "CMakeCache.txt")) \
         pythonlib_path = os.path.join(lib_path,
                                       "cython_modules",
                                       get_pythonlib_dir())
-        if asan_lib_path.endswith('NOTFOUND'):
-            with_asan = False
-        elif with_seastar and build_type == 'Debug':
+        if (with_seastar and build_type == 'Debug' and
+            not asan_lib_path.endswith('NOTFOUND')):
             with_asan = True
         respawn_in_path(lib_path, pybind_path, pythonlib_path,
                         asan_lib_path if with_asan else None)