sysstat/honor-ldflags.patch
Lukáš Zaoral 10ed8bf6e6
Update to v12.5.6
* Build position independent executables
* Use systemd-rpm-macros
  * See https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_scriptlets

Resolves: #2059133
2022-04-04 12:30:30 +02:00

124 lines
3.5 KiB
Diff

From 28c490333f9cbaf1c656a786714e2d0b252270f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Thu, 31 Mar 2022 14:06:03 +0200
Subject: [PATCH 1/3] Makefile: honour LDFLAGS passed to ./configure
The configure script help says that the LDFLAGS environment variable can be
used to pass additional flags to linker during build.
However, Makefile.in did not mention this variable at all so the additional
flags were silently skipped.
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index db31aad..99c2e65 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -110,7 +110,7 @@ DFLAGS += $(TFLAGS)
endif
ifndef LFLAGS
-LFLAGS = @STRIP@
+LFLAGS = @STRIP@ @LDFLAGS@
endif
# Commands
--
2.35.1
From 4706c6d4ff06b8f565660f5b6801bf9efb652f88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Thu, 31 Mar 2022 14:33:08 +0200
Subject: [PATCH 2/3] configure: do not overwrite LDFLAGS in test for 32-bit
libsensors
---
configure | 4 +++-
configure.in | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index aa5af95..e999217 100755
--- a/configure
+++ b/configure
@@ -4783,7 +4783,8 @@ HAVE_SENSORS32="n"
if test $SENSORS_SUPPORT = "y"; then
CFLAGS_SAVE=$CFLAGS
CFLAGS+=" -m32"
- LDFLAGS=" -lsensors"
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS+=" -lsensors"
SENSORS=no
# Check for another function to avoid using cached result
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sensors_cleanup in -lsensors" >&5
@@ -4852,6 +4853,7 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENSORS" >&5
$as_echo "$SENSORS" >&6; }
CFLAGS=$CFLAGS_SAVE
+ LDFLAGS=$LDFLAGS_SAVE
fi
diff --git a/configure.in b/configure.in
index 279347a..11cb3a3 100644
--- a/configure.in
+++ b/configure.in
@@ -191,7 +191,8 @@ HAVE_SENSORS32="n"
if test $SENSORS_SUPPORT = "y"; then
CFLAGS_SAVE=$CFLAGS
CFLAGS+=" -m32"
- LDFLAGS=" -lsensors"
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS+=" -lsensors"
SENSORS=no
# Check for another function to avoid using cached result
AC_CHECK_LIB(sensors, sensors_cleanup, LFSENSORS32="-lsensors", HAVE_SENSORS32="n")
@@ -201,6 +202,7 @@ if test $SENSORS_SUPPORT = "y"; then
[[sensors_cleanup();]])], SENSORS=yes; HAVE_SENSORS32="y"; DFSENSORS32="-DHAVE_SENSORS32", HAVE_SENSORS32="n"; SENSORS=no)
AC_MSG_RESULT($SENSORS)
CFLAGS=$CFLAGS_SAVE
+ LDFLAGS=$LDFLAGS_SAVE
fi
AC_SUBST(HAVE_SENSORS32)
AC_SUBST(LFSENSORS32)
--
2.35.1
From 6ad29c2f4cfa7d5a3d3b02c4a4922fd8fa3bb103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Thu, 31 Mar 2022 14:36:59 +0200
Subject: [PATCH 3/3] configure: print LDFLAGS in final summary
---
configure | 1 +
configure.in | 1 +
2 files changed, 2 insertions(+)
diff --git a/configure b/configure
index e999217..5f9e57e 100755
--- a/configure
+++ b/configure
@@ -7052,4 +7052,5 @@ echo " Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
Man pages directory: $mandir
Compiler: $CC
Compiler flags: $CFLAGS
+ Linker flags: $LDFLAGS
"
diff --git a/configure.in b/configure.in
index 11cb3a3..2de5b38 100644
--- a/configure.in
+++ b/configure.in
@@ -803,4 +803,5 @@ echo " Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
Man pages directory: $mandir
Compiler: $CC
Compiler flags: $CFLAGS
+ Linker flags: $LDFLAGS
"
--
2.35.1