summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-08-15 22:23:22 +0100
committerSam James <sam@gentoo.org>2024-08-15 22:24:05 +0100
commit1f754863ff91dc4dca11e6a5217ffd449f39c74c (patch)
tree4b6c1e88fb523daa2b11f0f4b68d12e1b9f31831 /eclass
parentdev-util/uglifyjs: Bump to 3.19.2, drop old 3.18.0 (diff)
downloadgentoo-1f754863ff91dc4dca11e6a5217ffd449f39c74c.tar.gz
gentoo-1f754863ff91dc4dca11e6a5217ffd449f39c74c.tar.bz2
gentoo-1f754863ff91dc4dca11e6a5217ffd449f39c74c.zip
go-env.eclass: improve debug workaround
Use what Ionen did in x11-terms/kitty to avoid touching flags for non-Go parts of the build. Bug: https://bugs.gentoo.org/847991 Bug: https://bugs.gentoo.org/924436 Bug: https://bugs.gentoo.org/924496 Bug: https://bugs.gentoo.org/929219 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/go-env.eclass16
1 files changed, 10 insertions, 6 deletions
diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index a4394161cb0b..11fdf943e774 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -42,16 +42,20 @@ go-env_set_compile_environment() {
# XXX: Hack for checking ICE (bug #912152, gcc PR113204)
has_version -b "sys-devel/gcc[debug]" && filter-lto
- # bug #929219
- if tc-is-gcc ; then
- replace-flags -g3 -g
- replace-flags -ggdb3 -ggdb
- fi
-
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"
export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}"
+
+ # bug #929219
+ if tc-is-gcc ; then
+ CGO_CFLAGS=$(
+ CFLAGS=${CGO_CFLAGS}
+ replace-flags -g3 -g
+ replace-flags -ggdb3 -ggdb
+ printf %s "${CFLAGS}"
+ )
+ fi
}
# @FUNCTION: go-env_goos