Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/ChakraCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
-Wl,--no-whole-archive
-Wl,--end-group
)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(LINKER_START_GROUP -Wl,-force_load,)
endif()

# common link deps
Expand Down
14 changes: 12 additions & 2 deletions bin/ChakraCore/ChakraCoreDllFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#include "Base/VTuneChakraProfile.h"
#endif

#ifdef __APPLE__
// dummy usage of JSRT to force export JSRT on dylib
#include "ChakraCore.h"
void DummyJSRTCall() {
JsRuntimeHandle *runtime;
JsRuntimeAttributes attr;
JsCreateRuntime(attr, nullptr, runtime);
}
#endif

extern HANDLE g_hInstance;
#ifdef _WIN32
static ATOM lockedDll = 0;
Expand Down Expand Up @@ -61,7 +71,7 @@ static BOOL AttachProcess(HANDLE hmod)
#endif
#ifdef VTUNE_PROFILING
VTuneChakraProfile::Register();
#endif
#endif
ValueType::Initialize();
ThreadContext::GlobalInitialize();

Expand Down Expand Up @@ -166,7 +176,7 @@ EXTERN_C BOOL WINAPI DllMain(HINSTANCE hmod, DWORD dwReason, PVOID pvReserved)
#endif
#ifdef VTUNE_PROFILING
VTuneChakraProfile::UnRegister();
#endif
#endif

// don't do anything if we are in forceful shutdown
// try to clean up handles in graceful shutdown
Expand Down
10 changes: 8 additions & 2 deletions lib/Jsrt/ChakraCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,16 @@ typedef BYTE* ChakraBytePtr;
#define CHAKRA_CALLBACK
#endif // __i386__

#ifndef _WIN32
#define SET_API_VISIBILITY __attribute__((visibility("default")))
#else
#define SET_API_VISIBILITY
#endif

#ifdef __cplusplus
#define CHAKRA_API extern "C" JsErrorCode
#define CHAKRA_API SET_API_VISIBILITY extern "C" JsErrorCode
#else
#define CHAKRA_API JsErrorCode
#define CHAKRA_API SET_API_VISIBILITY extern JsErrorCode
#endif

#include <stddef.h> // for size_t
Expand Down