Skip to content

Commit 4ffc46c

Browse files
Merge pull request #73 from modelica/no_gnu_unique
Hint to -fno-gnu-unique
2 parents b91a3df + f9d65c4 commit 4ffc46c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fmi-guide/3___packaging.adoc

+6
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ Furthermore, in case of failure, automatic linking is unlikely to provide user-u
167167
Note that simple calls to `LoadLibrary` or `LoadLibraryEx` on Windows, without specifying the full path to the library are also not going to work in general, for the same reasons:
168168
The search path will be based on the location of the importer executable and not the FMU DLL.
169169

170+
Importers should consider using flags like `RTLD_LOCAL` on POSIX platforms with `dlopen`, to avoid symbols from loaded shared objects being resolved against other loaded shared objects (i.e. other FMUs) by accident.
171+
172+
Note that for POSIX platforms, like Linux, `dlclose` is not required to unload a shared object, but it can, as specified in IEEE Std 1003.1-2017 (and earlier).
173+
In particular, shared objects compiled with GCC without the flag `-fno-gnu-unique`, can be marked as unloadable, and thus will not generally be unloaded upon `dlclose`.
174+
In many instances shared objects loaded with `RTLD_GLOBAL` cannot unload until all relocations of other objects to symbols in the shared object have been unloaded.
175+
170176
=== Interaction between FMU and Importer
171177

172178
The FMU code will run in the process environment that the importer provides.

0 commit comments

Comments
 (0)