Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/haproxy/
Date: Sat, 23 May 2020 19:19:42
Message-Id: 1590261557.510215752be59ccf102d6ec51bf54d23de27d476.mattst88@gentoo
commit:     510215752be59ccf102d6ec51bf54d23de27d476
Author:     Sam James (sam_c) <sam <AT> cmpct <DOT> info>
AuthorDate: Fri May  8 03:01:18 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat May 23 19:19:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51021575

net-proxy/haproxy: Fix 32-bit build

Links against libatomic on 32-bit non-x86 arches.

Closes: https://bugs.gentoo.org/668002
Closes: https://github.com/gentoo/gentoo/pull/15704
Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 net-proxy/haproxy/haproxy-2.0.14-r1.ebuild | 7 ++++++-
 net-proxy/haproxy/haproxy-2.1.4-r1.ebuild  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/net-proxy/haproxy/haproxy-2.0.14-r1.ebuild b/net-proxy/haproxy/haproxy-2.0.14-r1.ebuild
index 7e2cb38725c..d1c45681b56 100644
--- a/net-proxy/haproxy/haproxy-2.0.14-r1.ebuild
+++ b/net-proxy/haproxy/haproxy-2.0.14-r1.ebuild
@@ -97,12 +97,17 @@ src_compile() {
 	# For now, until the strict-aliasing breakage will be fixed
 	append-cflags -fno-strict-aliasing
 
+	# Bug #668002
+	if use ppc || use arm || use hppa; then
+		TARGET_LDFLAGS=-latomic
+	fi
+
 	if use prometheus-exporter; then
 		EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
 	fi
 
 	# HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
-	emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" ${args[@]}
+	emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
 	emake -C contrib/systemd SBINDIR=/usr/sbin
 
 	if use tools ; then

diff --git a/net-proxy/haproxy/haproxy-2.1.4-r1.ebuild b/net-proxy/haproxy/haproxy-2.1.4-r1.ebuild
index 7e2cb38725c..d1c45681b56 100644
--- a/net-proxy/haproxy/haproxy-2.1.4-r1.ebuild
+++ b/net-proxy/haproxy/haproxy-2.1.4-r1.ebuild
@@ -97,12 +97,17 @@ src_compile() {
 	# For now, until the strict-aliasing breakage will be fixed
 	append-cflags -fno-strict-aliasing
 
+	# Bug #668002
+	if use ppc || use arm || use hppa; then
+		TARGET_LDFLAGS=-latomic
+	fi
+
 	if use prometheus-exporter; then
 		EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
 	fi
 
 	# HAProxy really needs some of those "SPEC_CFLAGS", like -fno-strict-aliasing
-	emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" ${args[@]}
+	emake CFLAGS="${CFLAGS} \$(SPEC_CFLAGS)" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) EXTRA_OBJS="${EXTRA_OBJS}" TARGET_LDFLAGS="${TARGET_LDFLAGS}" ${args[@]}
 	emake -C contrib/systemd SBINDIR=/usr/sbin
 
 	if use tools ; then