File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ LDC: Apply dflags affecting symbol visibility to all deps
2
+
3
+ The `-fvisibility` (and, on Windows, `-dllimport` and `-link-defaultlib-shared`)
4
+ flags in effect for some root project are now passed down to all (direct and indirect)
5
+ dependencies of that root project - when using LDC. This is mainly important on
6
+ Windows, for executables linked against shared druntime/Phobos, as well as DLLs.
7
+
8
+ For Windows executables to be linked against the druntime/Phobos DLLs via
9
+ `-link-defaultlib-shared`, this means that all its static-library dub dependencies
10
+ are now automatically compiled with `-link-defaultlib-shared` too, thus defaulting to
11
+ `-dllimport=defaultLibsOnly`, which is a (Windows-specific) requirement for this
12
+ scenario.
13
+
14
+ With LDC, code ending up in a Windows DLL is compiled with `-fvisibility=public
15
+ -dllimport=all` by default (implicit flags added by dub). This can now be overridden
16
+ via e.g. `-fvisibility=hidden -dllimport=defaultLibsOnly` to generate a DLL exporting
17
+ only select symbols with explicit `export` visibility and linking all dub deps
18
+ statically (but druntime/Phobos dynamically). If you want to additionally link druntime
19
+ and Phobos statically into the DLL, use `-link-defaultlib-shared=false
20
+ -fvisibility=hidden -dllimport=none` instead.
You can’t perform that action at this time.
0 commit comments