isoalloc icon indicating copy to clipboard operation
isoalloc copied to clipboard

Remove FORTIFY_SOURCE=0 for MacOS with sanity builds

Open struct opened this issue 3 years ago • 0 comments

When compiling with MEMSET_SANITY or MEMCPY_SANITY on MacOS we currently disable FORTIFY_SOURCE so it can build properly. This only disabled FORTIFY_SOURCE for IsoAlloc and not other code that pulls it in. Still this is less than ideal and should be fixed. cc @jvoisin

See comment thread here: https://github.com/struct/isoalloc/pull/117

Here is the build error:

src/libc_hook.c:8:20: error: expected parameter declarator
EXTERNAL_API void *memcpy(void *restrict dest, const void *restrict src, size_t n) {
                   ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:63:46: note: expanded from macro 'memcpy'
                __builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                              ^
src/libc_hook.c:8:20: error: expected ')'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:63:46: note: expanded from macro 'memcpy'
                __builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                              ^
src/libc_hook.c:8:20: note: to match this '('
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:63:46: note: expanded from macro 'memcpy'
                __builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_common.h:38:54: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)

struct avatar Aug 01 '22 12:08 struct