Enable FORTIFY in unoptimized builds
GCC's FORTIFY required optimizations to be enabled in order to function
properly. Clang's FORTIFY doesn't have this limitation, so it seems
pointless to keep it disabled due to a GCC-specific limitation.
Bug: 12231437
Test: Checkbuild on bullhead internal master + CtsBionicTestCases. No
new failures.
Change-Id: I74aa35f9d3f3d2a6b11a7adfe72a787e3d7f7f36
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index a094818..8a8e00a 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -119,7 +119,14 @@
cmd.push_back("-DANDROID");
cmd.push_back("-D__ANDROID_API__="s + std::to_string(type.api_level));
+ // FIXME: Re-enable FORTIFY properly once our clang in external/ is new enough
+ // to support diagnose_if without giving us syntax errors.
+#if 0
cmd.push_back("-D_FORTIFY_SOURCE=2");
+#else
+ cmd.push_back("-D_FORTIFY_SOURCE=0");
+ cmd.push_back("-D__BIONIC_DECLARE_FORTIFY_HELPERS");
+#endif
cmd.push_back("-D_GNU_SOURCE");
cmd.push_back("-D_FILE_OFFSET_BITS="s + std::to_string(type.file_offset_bits));