Skip to content

Commit 4d1cc88

Browse files
committed
Pass -Wno-error to linker in case of LTO builds
When linking a release-built command line shell on Linux against default glibc with LTO enabled, a long-open gcc bug causes spurious warning to be emitted around a call to fread. The -Werror flag turns this into an error and the build process fails. Unfortunately, there is no way to selectively disable the warning with pragmas or -Wno-error=xxx flags. Thus, this patch passes -Wno-error to the linker in case of LTO builds. (But only to the linker. The compilation still applies the warnings-are-errors policy.) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
1 parent 7022aa2 commit 4d1cc88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ project (Jerry CXX C ASM)
230230
if(NOT ("${PLATFORM}" STREQUAL "DARWIN"))
231231
set(COMPILE_FLAGS_JERRY "${COMPILE_FLAGS_JERRY} -fno-fat-lto-objects")
232232
endif()
233-
set(LINKER_FLAGS_COMMON "${LINKER_FLAGS_COMMON} -flto")
233+
set(LINKER_FLAGS_COMMON "${LINKER_FLAGS_COMMON} -flto -Wno-error")
234234
endif()
235235

236236
# Turn off stack protector

0 commit comments

Comments
 (0)