From 7cb4165189537ebdc2de12effa916e2a45a7c1e2 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Mon, 22 Feb 2016 06:42:19 -0800 Subject: [PATCH] Set _FORTIFY_SOURCE to 0 when compiling with clang Summary:public When compiling projects with this macro set to 1 (which is default on my mac), infer couldn't get specs for some calls. They were replaced with different functions by preprocessor. Reviewed By: ddino Differential Revision: D2944618 fb-gh-sync-id: df8b457 shipit-source-id: df8b457 --- infer/lib/clang_wrappers/clang_wrapper | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infer/lib/clang_wrappers/clang_wrapper b/infer/lib/clang_wrappers/clang_wrapper index b088f54cd..eca5f3517 100755 --- a/infer/lib/clang_wrappers/clang_wrapper +++ b/infer/lib/clang_wrappers/clang_wrapper @@ -39,4 +39,11 @@ done # compiler can't elevate them to error level. COMMAND+=("-Wno-everything") + +# set _FORTIFY_SOURCE to 0 to prevent it from changing some function prototypes +# https://securityblog.redhat.com/2014/03/26/fortify-and-you/ +# We always do it when building models so we should do same thing +# when building any source code +COMMAND+=("-D_FORTIFY_SOURCE=0") + "${COMMAND[@]}"