Drop -fno-... compiler flags from CMakeLists (#4457)

- `-fno-builtin` should not be necessary: a) by default, we assume
  that a libc exists on the system the project is compiled for, but
  b) even if the assumption does not hold, `-fno-builtin` can be
  passed as an external CFLAG to the build system, plus c) the use
  of builtins is expected to help both code size and performance.
  (Except when jerry-math is enabled.)
- `-fno-stack-protector` should not be necessary: it is the default
  not to instrument code with stack protection.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2021-01-14 10:31:59 +01:00
committed by GitHub
parent 75586242ba
commit 4541524256
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -205,8 +205,9 @@ endif()
if(USING_GCC OR USING_CLANG)
jerry_add_compile_flags(-std=c99 -pedantic)
# Turn off stack protector
jerry_add_compile_flags(-fno-builtin -fno-stack-protector)
if(JERRY_MATH)
jerry_add_compile_flags(-fno-builtin)
endif()
jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition)
jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror)
endif()
+1 -1
View File
@@ -714,7 +714,7 @@ if(JERRY_MATH)
set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math)
else()
if(USING_GCC OR USING_CLANG)
set(CMAKE_REQUIRED_FLAGS "-Wno-error=strict-prototypes")
set(CMAKE_REQUIRED_FLAGS "-Wno-error -Wno-error=strict-prototypes")
endif()
check_library_exists(m sin "" HAVE_M_LIB)
if(HAVE_M_LIB)