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:
+3
-2
@@ -205,8 +205,9 @@ endif()
|
|||||||
|
|
||||||
if(USING_GCC OR USING_CLANG)
|
if(USING_GCC OR USING_CLANG)
|
||||||
jerry_add_compile_flags(-std=c99 -pedantic)
|
jerry_add_compile_flags(-std=c99 -pedantic)
|
||||||
# Turn off stack protector
|
if(JERRY_MATH)
|
||||||
jerry_add_compile_flags(-fno-builtin -fno-stack-protector)
|
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_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)
|
jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ if(JERRY_MATH)
|
|||||||
set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math)
|
set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math)
|
||||||
else()
|
else()
|
||||||
if(USING_GCC OR USING_CLANG)
|
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()
|
endif()
|
||||||
check_library_exists(m sin "" HAVE_M_LIB)
|
check_library_exists(m sin "" HAVE_M_LIB)
|
||||||
if(HAVE_M_LIB)
|
if(HAVE_M_LIB)
|
||||||
|
|||||||
Reference in New Issue
Block a user