Skip to content

Commit c9af37d

Browse files
committed
Fixed Linux CS:GO linker errors
- Added AsmJit include files (we will need them later to create C++ callbacks) - DynamicHooks is now compiled directly into the code
1 parent 95099ce commit c9af37d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+26226
-16
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ Set(SOURCEPYTHON_MEMORY_MODULE_SOURCES
252252
core/modules/memory/memory_tools.cpp
253253
core/modules/memory/memory_hooks.cpp
254254
core/modules/memory/memory_wrap_python.cpp
255+
thirdparty/DynamicHooks/asm.cpp
256+
thirdparty/DynamicHooks/utilities.cpp
257+
thirdparty/DynamicHooks/DynamicHooks.cpp
255258
)
256259

257260
# ------------------------------------------------------------------

src/core/modules/listeners/listenermanager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
//-----------------------------------------------------------------------------
1313
// Macros
1414
//-----------------------------------------------------------------------------
15-
// This creates a static manager and an inline function that returns a pointer
16-
// to the manager. Must be used in a *.cpp file!
15+
// This creates a static manager and a function that returns a pointer to the
16+
// manager. Must be used in a *.cpp file!
1717
#define DEFINE_MANAGER_ACCESSOR(name) \
1818
static CListenerManager s_##name; \
19-
inline CListenerManager* Get##name##ListenerManager() \
19+
CListenerManager* Get##name##ListenerManager() \
2020
{ return &s_##name; }
2121

2222
// Calls all listeners of the given manager

src/makefiles/linux/linux.base.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,12 @@ Set(SOURCEPYTHON_LINK_LIBRARIES_RELEASE
9595
${PYTHONSDK_LIB}/libpython3.3m.a
9696
${BOOSTSDK_LIB}/libboost_python.a
9797
${PYTHONSDK_LIB}/libpython3.3m.so.1.0
98-
${DYNAMICHOOKSSDK_LIB}/libAsmJit.a
99-
${DYNAMICHOOKSSDK_LIB}/libDynamicHooks.a
98+
${ASMJITSDK_LIB}/libAsmJit.a
10099
)
101100

102101
Set(SOURCEPYTHON_LINK_LIBRARIES_DEBUG
103102
${PYTHONSDK_LIB}/libpython3.3dm.a
104103
${BOOSTSDK_LIB}/libboost_python_d.a
105104
${PYTHONSDK_LIB}/libpython3.3dm.so.1.0
106-
${DYNAMICHOOKSSDK_LIB}/libAsmJit_d.a
107-
${DYNAMICHOOKSSDK_LIB}/libDynamicHooks_d.a
105+
${ASMJITSDK_LIB}/libAsmJit_d.a
108106
)

src/makefiles/shared.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ Set(DYNCALLSDK_LIB ${DYNCALLSDK}/lib)
4545
Set(PROTOBUF ${THIRDPARTY_DIR}/protobuf/protobuf-2.3.0)
4646
Set(PROTOBUF_INCLUDE ${PROTOBUF}/src)
4747

48+
# ------------------------------------------------------------------
49+
# AsmJit specific.
50+
# ------------------------------------------------------------------
51+
Set(ASMJITSDK ${THIRDPARTY_DIR}/AsmJit)
52+
Set(ASMJITSDK_INCLUDE ${ASMJITSDK}/include)
53+
Set(ASMJITSDK_LIB ${ASMJITSDK}/lib)
54+
4855
# ------------------------------------------------------------------
4956
# DynamicHooks specific.
5057
# ------------------------------------------------------------------
51-
Set(DYNAMICHOOKSSDK ${THIRDPARTY_DIR}/DynamicHooks)
52-
Set(DYNAMICHOOKSSDK_INCLUDE ${DYNAMICHOOKSSDK}/include)
53-
Set(DYNAMICHOOKSSDK_LIB ${DYNAMICHOOKSSDK}/lib)
58+
Set(DYNAMICHOOKSSDK ${THIRDPARTY_DIR}/DynamicHooks)
5459

5560
# ------------------------------------------------------------------
5661
# Include directories
@@ -67,7 +72,8 @@ Include_Directories(
6772
${DYNCALLSDK_INCLUDE}
6873
${BOOSTSDK_INCLUDE}
6974
${PROTOBUF_INCLUDE}
70-
${DYNAMICHOOKSSDK_INCLUDE}
75+
${ASMJITSDK_INCLUDE}
76+
${DYNAMICHOOKSSDK}
7177
${CMAKE_CURRENT_SOURCE_DIR}/core # Hack but required.
7278
)
7379

src/makefiles/win32/win32.base.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ Set(SOURCEPYTHON_LINK_LIBRARIES
6262
${DYNCALLSDK_LIB}/libdyncall_s.lib
6363
${DYNCALLSDK_LIB}/libdyncallback_s.lib
6464
${DYNCALLSDK_LIB}/libdynload_s.lib
65-
optimized ${DYNAMICHOOKSSDK_LIB}/AsmJit.lib
66-
optimized ${DYNAMICHOOKSSDK_LIB}/DynamicHooks.lib
67-
debug ${DYNAMICHOOKSSDK_LIB}/AsmJit_d.lib
68-
debug ${DYNAMICHOOKSSDK_LIB}/DynamicHooks_d.lib
65+
optimized ${ASMJITSDK_LIB}/AsmJit.lib
66+
debug ${ASMJITSDK_LIB}/AsmJit_d.lib
6967
)
7068

7169
# CSGO Engine adds in interfaces.lib

src/sdks/hl2sdk-csgo/public/eiface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ abstract_class IVEngineServer
208208
// Finish the EntityMessage and dispatch to network layer
209209
virtual void MessageEnd( void ) = 0;
210210

211-
virtual void SendUserMessage( IRecipientFilter &filter, int message, const google::protobuf::Message &msg );
211+
virtual void SendUserMessage( IRecipientFilter &filter, int message, const google::protobuf::Message &msg ) = 0;
212212

213213
// Print szMsg to the client console.
214214
virtual void ClientPrintf( edict_t *pEdict, const char *szMsg ) = 0;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// [AsmJit]
2+
// Complete JIT Assembler for C++ Language.
3+
//
4+
// [License]
5+
// Zlib - See COPYING file in this package.
6+
7+
// MSVC
8+
#if defined(_MSC_VER)
9+
10+
// Disable some warnings we know about
11+
#pragma warning(push)
12+
#pragma warning(disable: 4127) // conditional expression is constant
13+
#pragma warning(disable: 4251) // struct needs to have dll-interface to be used
14+
// by clients of struct ...
15+
#pragma warning(disable: 4275) // non dll-interface struct ... used as base for
16+
// dll-interface struct
17+
#pragma warning(disable: 4355) // this used in base member initializer list
18+
#pragma warning(disable: 4800) // forcing value to bool 'true' or 'false'
19+
20+
// Rename symbols.
21+
#define vsnprintf _vsnprintf
22+
#define snprintf _snprintf
23+
24+
#endif // _MSC_VER
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// [AsmJit]
2+
// Complete JIT Assembler for C++ Language.
3+
//
4+
// [License]
5+
// Zlib - See COPYING file in this package.
6+
7+
#if defined(_MSC_VER)
8+
9+
// Pop disabled warnings by ApiBegin.h
10+
#pragma warning(pop)
11+
12+
// Rename symbols back.
13+
#undef vsnprintf
14+
#undef snprintf
15+
16+
#endif // _MSC_VER

0 commit comments

Comments
 (0)