Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955028 - dev-build/gn: project flags interfere with make.conf CFLAGS (LTO flags, -Werror=format-security)
Summary: dev-build/gn: project flags interfere with make.conf CFLAGS (LTO flags, -Werr...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matt Jolly
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-28 14:58 UTC by Eli Schwartz
Modified: 2025-04-28 14:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Schwartz gentoo-dev 2025-04-28 14:58:37 UTC
https://gn.googlesource.com/gn/+/5da62d5e9d0f10cb8ece7c30563a6a214c78b68d%5E%21/



+          '-Wno-format',             # Use of %llx, which is supported by _UCRT, false positive
+          '-Wno-strict-aliasing',    # Dereferencing punned pointer

These are supposedly mingw specific. Deleting them via sed in src_prepare() still produces a warning-free build.


The former causes emerge to fail with:


[1/200] x86_64-pc-linux-gnu-g++ -MMD -MF src/base/files/file_path_constants.o.d -I../src -I. -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -DNDEBUG -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -std=c++20 -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -c ../src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o
FAILED: src/base/files/file_path_constants.o 
x86_64-pc-linux-gnu-g++ -MMD -MF src/base/files/file_path_constants.o.d -I../src -I. -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -DNDEBUG -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -std=c++20 -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -c ../src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o
cc1plus: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]
cc1plus: some warnings being treated as errors



The latter prevents https://wiki.gentoo.org/wiki/LTO#Enabling_LTO_System-wide from verifying that there are no LTO runtime problems.