@@ -4,6 +4,36 @@ project(MetaCallPoC VERSION 1.0)
4
4
set (CMAKE_C_STANDARD 99)
5
5
set (CMAKE_CXX_STANDARD 11)
6
6
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
7
+ set (CMAKE_VERBOSE_MAKEFILE ON )
8
+
9
+ # TODO: -O3 generates a segmentation fault on Linux
10
+ #
11
+ # METACALL load from normal executable
12
+ # should_not_call_init constructor has been called and it should not
13
+ # NORMAL EXECUTABLE enum symbols node_loader (1): fflush -> 0x4864018
14
+ # ...
15
+ # NORMAL EXECUTABLE enum symbols node_loader (11): __cxa_finalize -> 0x4863ff8
16
+ # INSIDE NODE LOADER (before string_function call): (nil)
17
+ # ==12635== Jump to the invalid address stated on the next line
18
+ # ==12635== at 0x0: ???
19
+ # ==12635== by 0x4861188: node_loader (in /metacall-plthook-poc/build/libnode_loader.so)
20
+ # ==12635== by 0x4856638: load_normal_executable (in /metacall-plthook-poc/build/libmetacall.so)
21
+ # ==12635== by 0x4896564: (below main) (libc-start.c:332)
22
+ # ==12635== Address 0x0 is not stack'd, malloc'd or (recently) free'd
23
+ # ==12635==
24
+ # ==12635== Process terminating with default action of signal 11 (SIGSEGV)
25
+ # ==12635== Bad permissions for mapped region at address 0x0
26
+ # ==12635== at 0x0: ???
27
+ # ==12635== by 0x4861188: node_loader (in /metacall-plthook-poc/build/libnode_loader.so)
28
+ # ==12635== by 0x4856638: load_normal_executable (in /metacall-plthook-poc/build/libmetacall.so)
29
+ # ==12635== by 0x4896564: (below main) (libc-start.c:332)
30
+ string (REGEX MATCH "Linux" PROJECT_OS_LINUX ${CMAKE_SYSTEM_NAME} )
31
+
32
+ if (PROJECT_OS_LINUX)
33
+ # Use -O2 by now until we can find why string_function is NULL
34
+ set (CMAKE_C_FLAGS_RELEASE "-O2" )
35
+ set (CMAKE_CXX_FLAGS_RELEASE "-O2" )
36
+ endif ()
7
37
8
38
# Default build type
9
39
if (NOT CMAKE_BUILD_TYPE )
0 commit comments