summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-02-17 13:38:46 -0800
committerJan Kotas <jkotas@microsoft.com>2016-02-17 13:38:46 -0800
commit6ad35ca6638ed7b57bbbf21aa9d082e3f39f1d6b (patch)
treeab65d82df7b7933d73e0f063933ac2bc303f8cbb /src/pal
parent38bfba8bb44aa09abad5de3605b1e53e57fc49f4 (diff)
parent6952d90ad3edfc461ecbe081f121419f4072326c (diff)
downloadcoreclr-6ad35ca6638ed7b57bbbf21aa9d082e3f39f1d6b.tar.gz
coreclr-6ad35ca6638ed7b57bbbf21aa9d082e3f39f1d6b.tar.bz2
coreclr-6ad35ca6638ed7b57bbbf21aa9d082e3f39f1d6b.zip
Merge pull request #3189 from krytarowski/netbsd-support-49
Enforce compiler version of alloca(3) on NetBSD
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal.h5
-rw-r--r--src/pal/src/CMakeLists.txt1
-rw-r--r--src/pal/src/include/pal/palinternal.h8
3 files changed, 4 insertions, 10 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index cb39a885a5..4c0c30fb6e 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -6320,11 +6320,6 @@ PALIMPORT char * __cdecl _strdup(const char *);
#endif //_MSC_VER
#if defined(__GNUC__) && defined(PLATFORM_UNIX)
-// we set -fno-builtin on the command line. This requires that if
-// we use alloca, with either have to call __builtin_alloca, or
-// ensure that the alloca call doesn't happen in code which is
-// modifying the stack (such as "memset (alloca(x), y, z)"
-
#define alloca __builtin_alloca
#endif // __GNUC__
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt
index d77fbc8ea4..5cb92bbd20 100644
--- a/src/pal/src/CMakeLists.txt
+++ b/src/pal/src/CMakeLists.txt
@@ -70,7 +70,6 @@ endif()
# turn off capability to remove unused functions (which was enabled in debug build with sanitizers)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-gc-sections")
-add_compile_options(-fno-builtin)
add_compile_options(-fPIC)
if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
index 070ffdf240..5b19ae6f1a 100644
--- a/src/pal/src/include/pal/palinternal.h
+++ b/src/pal/src/include/pal/palinternal.h
@@ -337,15 +337,15 @@ function_name() to call the system's implementation
#undef _BitScanForward64
#endif
-/* pal.h does "#define alloca _alloca", but we need access to the "real"
- alloca */
-#undef alloca
+/* pal.h defines alloca(3) as a compiler builtin.
+ Redefining it to native libc will result in undefined breakage because
+ a compiler is allowed to make assumptions about the stack and frame
+ pointers. */
/* Undef all functions and types previously defined so those functions and
types could be mapped to the C runtime and socket implementation of the
native OS */
#undef exit
-#undef alloca
#undef atexit
#undef div
#undef div_t