diff options
| author | Yong He <yonghe@outlook.com> | 2021-03-11 09:14:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-11 09:14:30 -0800 |
| commit | a07455c175db33d8d95bc5cd83738808d74cd105 (patch) | |
| tree | 02660537db912b7d48f34c751dc5731b88daa0db /source | |
| parent | 6cbd9d68a03f0a22305d4e224a3da7633b23de38 (diff) | |
Add Linux support to `platform` and `gfx`. (#1744)
Diffstat (limited to 'source')
| -rw-r--r-- | source/core/slang-downstream-compiler.cpp | 5 | ||||
| -rw-r--r-- | source/core/slang-platform.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-check.cpp | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/source/core/slang-downstream-compiler.cpp b/source/core/slang-downstream-compiler.cpp index b9b5a059d..1a81fcac8 100644 --- a/source/core/slang-downstream-compiler.cpp +++ b/source/core/slang-downstream-compiler.cpp @@ -610,6 +610,11 @@ static SlangResult _locateFXCCompilers(const String& path, ISlangSharedLibraryLo static SlangResult _locateGlslangCompilers(const String& path, ISlangSharedLibraryLoader* loader, DownstreamCompilerSet* set) { +#if SLANG_UNIX_FAMILY + // On unix systems we need to ensure pthread is loaded first. + ComPtr<ISlangSharedLibrary> pthreadLibrary; + DefaultSharedLibraryLoader::load(loader, path, "pthread", pthreadLibrary.writeRef()); +#endif ComPtr<ISlangSharedLibrary> sharedLibrary; if (SLANG_SUCCEEDED(DefaultSharedLibraryLoader::load(loader, path, "slang-glslang", sharedLibrary.writeRef()))) { diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp index 20dfed5a8..e46851095 100644 --- a/source/core/slang-platform.cpp +++ b/source/core/slang-platform.cpp @@ -171,7 +171,7 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY); { handleOut = nullptr; - void* h = dlopen(platformFileName, RTLD_NOW | RTLD_LOCAL); + void* h = dlopen(platformFileName, RTLD_NOW | RTLD_GLOBAL); if(!h) { #if 0 diff --git a/source/slang/slang-check.cpp b/source/slang/slang-check.cpp index 7f378f7b7..cfc8c504c 100644 --- a/source/slang/slang-check.cpp +++ b/source/slang/slang-check.cpp @@ -146,7 +146,7 @@ namespace Slang if (SLANG_FAILED(locator(m_downstreamCompilerPaths[int(type)], m_sharedLibraryLoader, m_downstreamCompilerSet))) { // If the locator reported a failure the first time we invoked - // it, then we will invoke it against with a wrapper shared librar + // it, then we will invoke it against with a wrapper shared library // loader that reported library load failures to our diagnost `sink`. // // This means that in the case of failure the user will see a listing |
