lingjf / h2unit

Light-weight (as light as hydrogen) unit test framework for C/C++, since 2012
Apache License 2.0
10 stars 6 forks source link

STUB not works with xcode 11.3 #9

Closed lingjf closed 4 years ago

lingjf commented 4 years ago

STUB/MOCK not works with xcode 11.3 toolchain, but works with xcode 10.3.

lingjf commented 4 years ago

otool -x a.11.3.out otool -x a.10.3.out 比较两个otool的输出发现text段的maxprot不一样分别是rx,rwx。 man ld -segprot segname max_prot init_prot Specifies the maximum and initial virtual memory protection of the named segment, name, to be max and init ,respectively. The values for max and init are any combination of the characters r' (for read),w' (for write), x' (for execute) and-' (no access).

lingjf commented 4 years ago

-Wl,-segprot,__TEXT,rwx,rwx 加入Linker选项,解决问题。