Skip to content

Commit 4541524

Browse files
authored
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 [email protected]
1 parent 7558624 commit 4541524

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ endif()
205205

206206
if(USING_GCC OR USING_CLANG)
207207
jerry_add_compile_flags(-std=c99 -pedantic)
208-
# Turn off stack protector
209-
jerry_add_compile_flags(-fno-builtin -fno-stack-protector)
208+
if(JERRY_MATH)
209+
jerry_add_compile_flags(-fno-builtin)
210+
endif()
210211
jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition)
211212
jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror)
212213
endif()

jerry-core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ if(JERRY_MATH)
714714
set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math)
715715
else()
716716
if(USING_GCC OR USING_CLANG)
717-
set(CMAKE_REQUIRED_FLAGS "-Wno-error=strict-prototypes")
717+
set(CMAKE_REQUIRED_FLAGS "-Wno-error -Wno-error=strict-prototypes")
718718
endif()
719719
check_library_exists(m sin "" HAVE_M_LIB)
720720
if(HAVE_M_LIB)

0 commit comments

Comments
 (0)