Can't use --enable-warnings-as-errors on Fedora 30
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
Details
(Keywords: in-triage)
Attachments
(1 file)
When I try to use a mozconfig with
ac_add_options --enable-optimize="-Og"
ac_add_options --enable-warnings-as-errors
I get an error:
0:01.76 /usr/include/features.h:382:4: error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings]
Maybe it is possible to let --enable-warnings-as-errors
set _FORTIFY_SOURCE
only if --enable-optimize
has a compatible settings?
Comment 1•4 years ago
|
||
I wasn't able to re-produce this on my machine, can you provide more info about your clang/sysroot or other mozconfig options you might have?
Assignee | ||
Comment 2•4 years ago
|
||
I tried various variants, and I now found that with this mozconfig (nothing else in there):
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-linker=lld
ac_add_options --enable-warnings-as-errors
doesn't work either, with the same error:
0:35.28 In file included from /home/simon/work/refactor/memory/replace/dmd/test/SmokeDMD.cpp:16:
0:35.28 In file included from /home/simon/work/refactor/obj-x86_64-pc-linux-gnu/dist/system_wrappers/errno.h:3:
0:35.28 In file included from /usr/include/errno.h:25:
0:35.28 In file included from /home/simon/work/refactor/obj-x86_64-pc-linux-gnu/dist/system_wrappers/features.h:3:
0:35.28 /usr/include/features.h:382:4: error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings]
0:35.28 # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
0:35.28 ^
I am on Fedora 30, the clang is the one from .mozbuild, currently clang version 9.0.0
. /usr/include/features.h
is from glibc-headers-2.29-27.fc30
.
Comment 3•4 years ago
|
||
SmokeDMD.cpp is force-built with -O0 per memory/replace/dmd/test/moz.build. The check in features.h is kind of controversial, actually, as it has caused multiple problems. You found one more. It was removed in Debian, but stays in Fedora. I guess we could work around with #undef _FORTIFY_SOURCE at the beginning of SmokeDMD.cpp. It's not like it matters in that file.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Adding #undef _FORTIFY_SOURCE
fixes the issue, and since you say this doesn't matter I will submit a patch to add that.
Assignee | ||
Comment 5•4 years ago
|
||
This is required on some systems such as Fedora to allow
building with -O0 together with --warnings-as-errors due to
a check in /usr/include/features.h
Updated•4 years ago
|
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3dc9cd6dfb53 Undef _FORTIFY_SOURCE to fix build with --warnings-on-errors. r=glandium
Comment 7•4 years ago
|
||
bugherder |
Description
•