File tree 5 files changed +28
-27
lines changed
actions/6-integration-test
runtime/druntime/test/shared
5 files changed +28
-27
lines changed Original file line number Diff line number Diff line change 15
15
run : |
16
16
set -eux
17
17
cd ..
18
- if type -P apk &>/dev/null; then
19
- exit 0 # Alpine: no shared libs
20
- fi
21
18
if [[ '${{ runner.os }}' == Windows ]]; then
22
19
# add druntime/Phobos DLL dir to PATH
23
20
export PATH="$PWD/installed/bin:$PATH"
Original file line number Diff line number Diff line change 61
61
# TSan and XRay do not work.
62
62
extra_cmake_flags : >-
63
63
-DBUILD_LTO_LIBS=ON
64
- -DBUILD_SHARED_LIBS=OFF
65
64
-DLLVM_IS_SHARED=OFF
66
65
-DLDC_ENABLE_PLUGINS=OFF
67
66
-DLDC_DYNAMIC_COMPILE=OFF
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ LINK_SHARED:=$(SHARED)
4
4
include ../common.mak # affected by LINK_SHARED!
5
5
6
6
ifneq (,$(LINK_SHARED ) )
7
- # LDC: disable 3 tests on Mac, 1 on Windows
7
+ # LDC: disable 2 tests on Mac, 1 on Windows
8
8
ifeq (,$(findstring ldmd2,$(DMD)))
9
9
# TODO: enable tests on Windows
10
10
ifeq (windows,$(OS))
@@ -14,20 +14,18 @@ ifneq (,$(LINK_SHARED))
14
14
link_linkdep load_linkdep link_loaddep load_loaddep load_13414
15
15
endif
16
16
else
17
- TESTS: =link load linkD linkDR loadDR dynamiccast \
17
+ TESTS: =link load linkD linkDR loadDR finalize dynamiccast \
18
18
link_linkdep link_loaddep load_loaddep load_13414
19
19
ifneq ($(OS),osx)
20
20
# * `host` loads two modules with the same name, which is currently disallowed
21
21
# by the (potentially overly eager) module collision detection on OS X.
22
- # * `finalize` fails starting with macOS 10.13, as .dylibs with TLS can't be
23
- # unloaded anymore (https://github.com/ldc-developers/ldc/issues/3002).
24
22
# * FIXME: `load_linkdep`
25
23
# it might fail because of unimplemented `getDependencies()` in rt.sections_elf_shared
26
24
ifeq (windows,$(OS))
27
25
# LDC FIXME: disable `load_linkdep` on Windows - needs `getDependencies()`
28
- TESTS+ =host finalize
26
+ TESTS+ =host
29
27
else
30
- TESTS+ =host finalize load_linkdep
28
+ TESTS+ =host load_linkdep
31
29
endif
32
30
endif
33
31
endif
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ void main(string[] args)
45
45
auto nf1 = new NoFinalize;
46
46
auto nf2 = new NoFinalizeBig;
47
47
48
- shared size_t finalizeCounter;
48
+ shared static size_t finalizeCounter;
49
49
SetFinalizeCounter setFinalizeCounter;
50
50
loadSym(h, setFinalizeCounter, " setFinalizeCounter" );
51
51
setFinalizeCounter(&finalizeCounter);
@@ -58,8 +58,20 @@ void main(string[] args)
58
58
auto r = Runtime .unloadLibrary(h);
59
59
if (! r)
60
60
assert (0 );
61
- if (finalizeCounter != 4 )
62
- assert (0 );
61
+ version (darwin )
62
+ {
63
+ // Fails starting with macOS 10.13, as .dylibs with TLS can't be
64
+ // unloaded anymore (https://github.com/ldc-developers/ldc/issues/3002).
65
+ }
66
+ else version (CRuntime_Musl )
67
+ {
68
+ // On Musl, dlclose is a no-op
69
+ }
70
+ else
71
+ {
72
+ if (finalizeCounter != 4 )
73
+ assert (0 );
74
+ }
63
75
if (nf1._finalizeCounter)
64
76
assert (0 );
65
77
if (nf2._finalizeCounter)
Original file line number Diff line number Diff line change @@ -22,25 +22,20 @@ void runTest(string name)
22
22
* pLibSharedStaticDtorHook = &sharedStaticDtorHook;
23
23
24
24
const unloaded = Runtime .unloadLibrary(h);
25
- version (CRuntime_Musl )
25
+ assert (unloaded);
26
+ assert (tlsDtor == 1 );
27
+ version (LDC_darwin)
26
28
{
27
- // On Musl, unloadLibrary is a no-op because dlclose is a no-op
28
- assert (! unloaded);
29
- assert (tlsDtor == 0 );
29
+ // Since 10.13: https://github.com/ldc-developers/ldc/issues/3002
30
30
assert (dtor == 0 );
31
31
}
32
- else
32
+ else version ( CRuntime_Musl )
33
33
{
34
- assert (unloaded);
35
- assert (tlsDtor == 1 );
36
- version (LDC_darwin)
37
- {
38
- // Since 10.13: https://github.com/ldc-developers/ldc/issues/3002
39
- assert (dtor == 0 );
40
- }
41
- else
42
- assert (dtor == 1 );
34
+ // On Musl, dlclose is a no-op
35
+ assert (dtor == 0 );
43
36
}
37
+ else
38
+ assert (dtor == 1 );
44
39
}
45
40
46
41
void main (string [] args)
You can’t perform that action at this time.
0 commit comments