| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
It is needed to make sure vector unaligned load/store aren't inserted
when the riscv cpu does not allow them.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115789
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
|
|
|
|
|
|
|
|
| |
The whole -m/-mno-* situation needs to be improved in the eclass but
let's do this for now for the benefit of Chromium (see 754d6f5226a532ed086afa276b48e89ffafe0484).
Bug: https://bugs.gentoo.org/931623
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It curently uses some magic test to decide whether handcrafted code
works with or without -latomic. But it can claim that -latomic is not
needed for that case, while it is still needed for other cases.
> okay so append-atomic-flags does not work for me in this case
> noise-suppression-for-voice is doing `struct RnNoiseStats { uint32_t a, b, c, d; }; std::atomic<RnNoiseStats> m_stats;`
> not just a single large integer
It is simplest to always add -latomic when an ebuild gets that deep
feeling that yeah, it would like some atomics please. The downsides to
listing a linker library are exactly:
- it might be unavailable
- it might be unneeded
And the former case is trivial to solve -- this function already does so
-- while the latter case has a sanctioned approach that is already used
for other intrinsic compiler libraries, but not for atomic "because the
build system would have a hard time if we had to build atomic early on"
which isn't a very good reason to break ebuilds which aren't building
sys-devel/gcc.
As a side benefit, we now handle -latomic such that a package which
requires it, but only for parts of the installed package, does not
overlink to libatomic in *all* binaries/libraries, even if the default
LDFLAGS are overridden and the global -Wl,--as-needed disappears.
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
Bug: https://bugs.gentoo.org/820101
Bug: https://bugs.gentoo.org/925672
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
This fixes commit cf366abd1bd50a33755734bbfb8c0e8a49a5480e and is a proper
revert of cf366abd1bd50a33755734bbfb8c0e8a49a5480e and fad75a344cbaada57ae490c3e8f88cdd5b35dadc.
Bug: https://gcc.gnu.org/PR112782
Bug: https://sourceware.org/PR13509
Closes: https://bugs.gentoo.org/921104
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit cf366abd1bd50a33755734bbfb8c0e8a49a5480e.
This reverts commit fad75a344cbaada57ae490c3e8f88cdd5b35dadc.
There's a bug in gas where it messes up labels in the presence
of some of these errata flags.
Bug: https://gcc.gnu.org/PR112782
Bug: https://sourceware.org/PR13509
Closes: https://bugs.gentoo.org/921104
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Reported by leio. We need this for e.g. Clang to produce output that debugedit
is happy with.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
Most arches have this set anyway but amd64 is likely to switch to gnu2 finally
as well [0] so let's allow testing with it (and reverting to the old default
once it changes) by allowing -mtls-dialect=* through the filter.
[0] https://inbox.sourceware.org/gcc/871qbqp4of.fsf@oldenburg.str.redhat.com/
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Reviewed-by: David Seifert <soap@gentoo.org>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* We were missing 24k, r5900, vr4120, vr4130, sb1 [0].
* Chuck in -Wa,-mfix-loongson2f-nop while at it. The topic of -Wa,* is an interesting
one, as we currently allow -Wl,*, so we should probably do the same for the assembler,
but punt that to another time.
Note that we use r5900 and -Wa,-mfix-loongson2f-nop for building stages...
Prompted by discussion with immolo (see also fad75a344cbaada57ae490c3e8f88cdd5b35dadc).
[0] https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-mfix-24k (and below)
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Reported by immolo.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
We set this for x86 multilib profiles.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Spectre-style mitigation.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
-mincoming-stack-boundary=*
Wine may use this and it's in the same league as -mstackrealign in that
it affects ABI.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
We may want to gate these just for Clang but they (at least --stdlib) affect
ABI so we shouldn't be filtering these.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Newer arm64 HW has this.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Just like -fno-omit-frame-pointer.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
_filter-hardened
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
_filter-hardened is used by filter-flags to negate defaults, e.g. it makes
filter-flags -fstack-protector correctly then disable -fstack-protector as well
if the toolchain enables SSP by default.
Modernise the tests it uses with the tc-enables-* functions rather than
just gcc-specs-*. We haven't done hardening via specs for ages.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
None of the ebuilds inheriting flag-o-matic in EAPI 7 needs any of the
remaining eutils features.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
|
|
|
|
|
|
|
| |
Ionen rightly points out that people might have -flto by default and
-fno-lto in package.env.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
We already allow -Os and -Oz is just a more aggressive version of that.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
LTO is pretty safe nowadays and packages broken with it should really use
filter-lto specifically instead.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
whitelist)
-fstack-check is _not_ a safe flag:
* https://developers.redhat.com/blog/2017/09/25/stack-clash-mitigation-gcc-background
* https://developers.redhat.com/blog/2019/04/30/stack-clash-mitigation-in-gcc-why-fstack-check-is-not-the-answer
Nobody is really interested in maintaining this functionality upstream in GCC
anymore for this reason, it's not IIRC supported in Clang, and we're not testing
it either.
Please use the far superior -fstack-clash-protection instead.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
-O3 is perfectly safe in the absence of UB. And with UB, -O2 and friends can
easily break with new compiler versions and such anyway.
In addition, I'd say that -O/-O1 is probably as risky as -O3 nowadays, if not
more, because if nothing else, you don't get a bunch of hardening.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
Rename _test-compile-PROG to test-compile and expose externally for
ebuilds to consume if desired.
Bug: https://bugs.gentoo.org/897976
Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A number of configure checks used by CMake and autoconf (and probably
other build systems) relies on warning-free compiler runs. A combination
of compiler and flags that always generates warnings can cause
misconfiguration and/or build failures.
Since commit ae9870d9f6b1394ede86176443770b36d7e60ac1, flags that
generate warnings that could be suppressed with -Qunused-arguments
are accepted anyway to avoid stripping all linker flags (#627474).
But commit 28d6437fc7009002f98f28e8900e994109927726 added linker
invocation for linker flags tests, so the workaround shouldn't be
necessary any more.
Drop the extra -Qunused-arguments check and reject all flags that
generate warnings to avoid configuration issues.
If it turns out that stripping these unused flags is still problematic,
we could accept them and actually add -Qunused-arguments to the
relevant *FLAGS to silence the warnings, but that would require
bigger changes, so let's try the simpler and cleaner solution first.
Bug: https://bugs.gentoo.org/627474
Bug: https://bugs.gentoo.org/714742
Bug: https://bugs.gentoo.org/862798
Signed-off-by: Alexander Miller <alex.miller@gmx.de>
Closes: https://github.com/gentoo/gentoo/pull/26773
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/832377
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
To ensure we pay attention to these if changing in future (like I've been wondering
about)
Bug: https://bugs.gentoo.org/712488
Bug: https://bugs.gentoo.org/714742
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My take on implementing bug 820101 as conservatively as possible. This
will append -latomic only when absolutely necessary (even though it's
probably not required to be that conservative due to our use of
--as-needed).
This will take flags into account when testing as well. For example, if
you compile with -march=i386, this would require linking libatomic even
if the same toolchain with a higher -march level would not require it.
So rebuilding the same package with the same flags may change whether
-latomic is linked at build time if the CFLAGS change. Another instance
might be switching from GCC to clang - the former requires explicitly
linking -latomic, while the latter does not even HAVE libatomic (see bug
820095) as all atomic intrinsics are built-in internally. This function
would safely detect this and not append -latomic.
There is an optional parameter [bytes]. You can use this if you want to
be specific about what size atomic support is required. For example,
there are several platforms like MIPS where the 32-bit version has 1-,
2-, and 4-byte atomics builtin but requires libatomic linkage for 8-byte
atomics. If your program only requires, say, 4-byte atomics, you can use
append-atomic-flags 4 and this will then not attempt to link libatomic
on 32-bit MIPS.
I tested using this to solve bug 688574 on 32-bit SPARC.
Bug: https://bugs.gentoo.org/688574
Bug: https://bugs.gentoo.org/820095
Closes: https://bugs.gentoo.org/820101
Closes: https://github.com/gentoo/gentoo/pull/26334
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/618550
Closes: https://github.com/gentoo/gentoo/pull/26036
Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
In Clang, -frecord-gcc-switches does the same as this anyway.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
-fstack-clash-protection suggested by Arfrever.
Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
Needed for shadow stack bits on ARM64.
Closes: https://bugs.gentoo.org/800533
Thanks-to: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
We already allow -ggdb for GDB and this is the analogue for LLDB.
Bug: https://bugs.gentoo.org/800533
Reported-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/646076
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
No functional change.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
Both of these options are useful for automated reports and should
be harmless.
Closes: https://bugs.gentoo.org/830534
Reported-by: Agostino Sarubbo <ago@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
glibc only allows _TIME_BITS=64 when _FILE_OFFSET_BITS=64.
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
| |
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
We already allow -fsanitize* options. Sometimes it's useful to enable
-fsanitize= globally and disable ir in a few ebuilds.
The change allows passing -fno-sanitize=all an similar to achieve that
effect.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|