Index: libcxx/test/lit.site.cfg.in =================================================================== --- libcxx/test/lit.site.cfg.in +++ libcxx/test/lit.site.cfg.in @@ -28,6 +28,7 @@ config.executor = "@LIBCXX_EXECUTOR@" config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@" config.compiler_rt = "@LIBCXX_USE_COMPILER_RT@" +config.builtins_library = "@LIBCXX_BUILTINS_LIBRARY@" config.has_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@" config.use_libatomic = "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@" config.debug_build = "@LIBCXX_DEBUG_BUILD@" Index: libcxx/utils/libcxx/test/target_info.py =================================================================== --- libcxx/utils/libcxx/test/target_info.py +++ libcxx/utils/libcxx/test/target_info.py @@ -253,7 +253,11 @@ else: flags += ['-lgcc_s'] compiler_rt = self.full_config.get_lit_bool('compiler_rt', False) - if not compiler_rt: + if compiler_rt: + builtins_lib = self.full_config.get_lit_conf('builtins_library') + if builtins_lib: + flags += [builtins_lib] + else: flags += ['-lgcc'] use_libatomic = self.full_config.get_lit_bool('use_libatomic', False) if use_libatomic: