Skip to content

Commit 25481c9

Browse files
committed
[k2] allow -fvisibility=hidden for k2-lib mode
1 parent 777ce7d commit 25481c9

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

compiler/compiler-settings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ void CompilerSettings::init() {
336336
if (is_k2_mode) {
337337
// for now k2-component must be compiled with clang and statically linked libc++
338338
ss << " -stdlib=libc++";
339-
// TODO support hidden visibility for k2-lib
340-
if (!dynamic_incremental_linkage.get() && mode.get() != "k2-lib") {
339+
if (!dynamic_incremental_linkage.get()) {
341340
ss << " -fvisibility=hidden";
342341
}
343342
// Temporary solution. Required for allocator functions replacement in timelib

tests/python/tests/libs/test_libs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
class TestLibs(KphpCompilerAutoTestCase):
1010
def test_raw_php_libs(self):
11-
self.build_and_compare_with_php("php/lib_user.php")
11+
self.build_and_compare_with_php("php/lib_user.php", kphp_env={
12+
"KPHP_DYNAMIC_INCREMENTAL_LINKAGE": "0" if self.should_use_k2() else "1",
13+
})
1214

1315
def test_compiled_libs(self):
1416
lib_build_env = {
@@ -29,6 +31,7 @@ def test_compiled_libs(self):
2931
kphp_runner = self.build_and_compare_with_php("php/lib_user.php", kphp_env={
3032
"KPHP_INCLUDE_DIR": self.web_server_working_dir,
3133
"KPHP_VERBOSITY": "3",
34+
"KPHP_DYNAMIC_INCREMENTAL_LINKAGE": "0" if self.should_use_k2() else "1",
3235
})
3336
with open(kphp_runner.kphp_build_stderr_artifact.file, "rb") as f:
3437
build_log = f.read()

0 commit comments

Comments
 (0)