-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass -Wno-error to linker in case of LTO builds #719
Pass -Wno-error to linker in case of LTO builds #719
Conversation
Do you have link for this issue? |
Please, see at issue #718 , as mentioned above. |
I've pushed a patch on top of the original to show the approach suggested by @ruben-ayrapetyan in #718 . The patches are intentionally not squashed for now so that we can compare and discuss the different approaches. And yes, this also solves the problem. The warning is printed during release link but it causes no error. |
fd7845e
to
af8ee7c
Compare
I've improved the PR with macros to make the handling of warnings more compact and easier to maintain. Some of the macros could be utilized elsewhere in the CMakeLists.txt file as well but the changes are kept intentionally local for now. |
add_jerry_compile_warnings(conversion sign-conversion format-security) | ||
add_jerry_compile_warnings(missing-declarations) | ||
add_jerry_compile_flags(-Wno-attributes) | ||
add_jerry_compile_flags(-Wfatal-errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you, please, merge the above lists into two - for warnings and for other flags?
Looks good to me |
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 introduces some helper macros and lists all warnings explicitly with `-Werror=xxx` instead of covering all warnings with the `-Werror` flag. This way, warnings enabled by command line flags do cause errors, but those raised by warning attributes (which cannot be suppressed by any `-Wno-error=xxx` flags) don't. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
4ee8482
to
8006635
Compare
LGTM |
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.)
fixes #718