diff --git a/compiler/compiler-settings.cpp b/compiler/compiler-settings.cpp index d020f87916..4376284a13 100644 --- a/compiler/compiler-settings.cpp +++ b/compiler/compiler-settings.cpp @@ -336,8 +336,7 @@ void CompilerSettings::init() { if (is_k2_mode) { // for now k2-component must be compiled with clang and statically linked libc++ ss << " -stdlib=libc++"; - // TODO support hidden visibility for k2-lib - if (!dynamic_incremental_linkage.get() && mode.get() != "k2-lib") { + if (!dynamic_incremental_linkage.get()) { ss << " -fvisibility=hidden"; } // Temporary solution. Required for allocator functions replacement in timelib diff --git a/tests/python/tests/libs/test_libs.py b/tests/python/tests/libs/test_libs.py index b080fd2e86..55c61e72b6 100644 --- a/tests/python/tests/libs/test_libs.py +++ b/tests/python/tests/libs/test_libs.py @@ -8,7 +8,9 @@ class TestLibs(KphpCompilerAutoTestCase): def test_raw_php_libs(self): - self.build_and_compare_with_php("php/lib_user.php") + self.build_and_compare_with_php("php/lib_user.php", kphp_env={ + "KPHP_DYNAMIC_INCREMENTAL_LINKAGE": "0" if self.should_use_k2() else "1", + }) def test_compiled_libs(self): lib_build_env = { @@ -29,6 +31,7 @@ def test_compiled_libs(self): kphp_runner = self.build_and_compare_with_php("php/lib_user.php", kphp_env={ "KPHP_INCLUDE_DIR": self.web_server_working_dir, "KPHP_VERBOSITY": "3", + "KPHP_DYNAMIC_INCREMENTAL_LINKAGE": "0" if self.should_use_k2() else "1", }) with open(kphp_runner.kphp_build_stderr_artifact.file, "rb") as f: build_log = f.read()