Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 12.2.0/gentoo/
Date: Sun, 29 Jan 2023 08:50:33
Message-Id: 1674982226.9e2e3b4fd87a92e5b8d379e3312a57c6986f9004.sam@gentoo
1 commit: 9e2e3b4fd87a92e5b8d379e3312a57c6986f9004
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 29 02:47:23 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 29 08:50:26 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9e2e3b4f
7
8 12.2.0: drop upstreamed 76_all_driver_environ_putenv_PR106624.patch
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 .../76_all_driver_environ_putenv_PR106624.patch | 44 ----------------------
13 12.2.0/gentoo/README.history | 3 ++
14 2 files changed, 3 insertions(+), 44 deletions(-)
15
16 diff --git a/12.2.0/gentoo/76_all_driver_environ_putenv_PR106624.patch b/12.2.0/gentoo/76_all_driver_environ_putenv_PR106624.patch
17 deleted file mode 100644
18 index 16fb131..0000000
19 --- a/12.2.0/gentoo/76_all_driver_environ_putenv_PR106624.patch
20 +++ /dev/null
21 @@ -1,44 +0,0 @@
22 -https://bugs.gentoo.org/885501
23 -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106624
24 -https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2b403297b111c990c331b5bbb6165b061ad2259b
25 -
26 -From 2b403297b111c990c331b5bbb6165b061ad2259b Mon Sep 17 00:00:00 2001
27 -From: Sergei Trofimovich <siarheit@××××××.com>
28 -Date: Tue, 16 Aug 2022 12:35:07 +0100
29 -Subject: [PATCH 1/1] driver: fix environ corruption after putenv() [PR106624]
30 -
31 -The bug appeared afte r13-2010-g1270ccda70ca09 "Factor out
32 -jobserver_active_p" slightly changed `putenv()` use from allocating
33 -to non-allocating:
34 -
35 - -xputenv (concat ("MAKEFLAGS=", dup, NULL));
36 - +xputenv (jinfo.skipped_makeflags.c_str ());
37 -
38 -`xputenv()` (and `putenv()`) don't copy strings and only store the
39 -pointer in the `environ` global table. As a result `environ` got
40 -corrupted as soon as `jinfo.skipped_makeflags` store got deallocated.
41 -
42 -This started causing bootstrap crashes in `execv()` calls:
43 -
44 - xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2': execv: Bad address
45 -
46 -The change restores memory allocation for `xputenv()` argument.
47 -
48 -gcc/
49 -
50 - PR driver/106624
51 - * gcc.cc (driver::detect_jobserver): Allocate storage xputenv()
52 - argument using xstrdup().
53 ---- a/gcc/gcc.cc
54 -+++ b/gcc/gcc.cc
55 -@@ -9182,7 +9182,7 @@ driver::detect_jobserver () const
56 - {
57 - jobserver_info jinfo;
58 - if (!jinfo.is_active && !jinfo.skipped_makeflags.empty ())
59 -- xputenv (jinfo.skipped_makeflags.c_str ());
60 -+ xputenv (xstrdup (jinfo.skipped_makeflags.c_str ()));
61 - }
62 -
63 - /* Determine what the exit code of the driver should be. */
64 ---
65 -2.31.1
66
67 diff --git a/12.2.0/gentoo/README.history b/12.2.0/gentoo/README.history
68 index e3e0bf4..940ed88 100644
69 --- a/12.2.0/gentoo/README.history
70 +++ b/12.2.0/gentoo/README.history
71 @@ -1,3 +1,6 @@
72 +11 29 Jan 2022
73 + - 76_all_driver_environ_putenv_PR106624.patch
74 +
75 10 23 Jan 2022
76 + 76_all_driver_environ_putenv_PR106624.patch