1 |
commit: 7ea2cf10a9f26e915cada4262066dacd87513a62 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 28 02:58:13 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 28 02:59:31 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ea2cf10 |
7 |
|
8 |
net-misc/dhcp: avoid undefined/broken runtime behaviour with -O3 |
9 |
|
10 |
-fstrict-aliasing (enabled by -O3) breaks code within dhcp |
11 |
which violates the no-strict-aliasing rule. So, let's tag on |
12 |
an option to avoid assuming that rule / avoid the optimisation |
13 |
which is unsafe here. |
14 |
|
15 |
Bug: https://bugs.gentoo.org/787935 |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
net-misc/dhcp/{dhcp-4.4.2_p1.ebuild => dhcp-4.4.2_p1-r1.ebuild} | 4 ++++ |
19 |
1 file changed, 4 insertions(+) |
20 |
|
21 |
diff --git a/net-misc/dhcp/dhcp-4.4.2_p1.ebuild b/net-misc/dhcp/dhcp-4.4.2_p1-r1.ebuild |
22 |
similarity index 98% |
23 |
rename from net-misc/dhcp/dhcp-4.4.2_p1.ebuild |
24 |
rename to net-misc/dhcp/dhcp-4.4.2_p1-r1.ebuild |
25 |
index 4b86781a388..57fd8dd47f4 100644 |
26 |
--- a/net-misc/dhcp/dhcp-4.4.2_p1.ebuild |
27 |
+++ b/net-misc/dhcp/dhcp-4.4.2_p1-r1.ebuild |
28 |
@@ -159,6 +159,10 @@ src_configure() { |
29 |
#define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid" |
30 |
EOF |
31 |
|
32 |
+ # Breaks with -O3 because of reliance on undefined behaviour |
33 |
+ # bug #787935 |
34 |
+ append-flags -fno-strict-aliasing |
35 |
+ |
36 |
# https://bugs.gentoo.org/720806 |
37 |
if use ppc || use arm || use hppa; then |
38 |
append-libs -latomic |