From a07455c175db33d8d95bc5cd83738808d74cd105 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 11 Mar 2021 09:14:30 -0800 Subject: Add Linux support to `platform` and `gfx`. (#1744) --- source/core/slang-downstream-compiler.cpp | 5 +++++ source/core/slang-platform.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'source/core') 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 pthreadLibrary; + DefaultSharedLibraryLoader::load(loader, path, "pthread", pthreadLibrary.writeRef()); +#endif ComPtr 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 -- cgit v1.2.3