1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
From 4bdd215fd84e83a8119d0b971904221743a87a23 Mon Sep 17 00:00:00 2001
From: "Robin H. Johnson" <robbat2@gentoo.org>
Date: Wed, 24 Jul 2019 11:11:35 +0200
Subject: [PATCH] Add dynamic static ldflags
Forward-ported from 2.02.178 to 2.03.05
Forward-ported from 2.03.05 to 2.03.12
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---
configure.ac | 2 ++
daemons/dmeventd/Makefile.in | 2 +-
make.tmpl.in | 1 +
tools/Makefile.in | 2 +-
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1a49e7fe7e..354b53b5ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,7 @@ case "$host_os" in
linux*)
# equivalent to -rdynamic
ELDFLAGS="-Wl,--export-dynamic"
+ STATIC_LDFLAGS="-Wl,--no-export-dynamic"
# FIXME Generate list and use --dynamic-list=.dlopen.sym
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
@@ -1860,6 +1861,7 @@ AC_SUBST(SYSCONFDIR)
AC_SUBST(SYSTEMD_LIBS)
AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
+AC_SUBST(STATIC_LDFLAGS)
AC_SUBST(STATIC_LINK)
AC_SUBST(TESTSUITE_DATA)
AC_SUBST(THIN)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index af51198aae..f7896e581e 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -76,7 +76,7 @@ dmeventd: $(LIB_SHARED) dmeventd.o
dmeventd.static: $(LIB_STATIC) dmeventd.o
@echo " [CC] $@"
- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
+ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
ifeq ("@PKGCONFIG@", "yes")
diff --git a/make.tmpl.in b/make.tmpl.in
index 200ea2e05f..99f02e8b77 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -69,6 +69,7 @@ DEFS += @DEFS@
# FIXME set this only where it's needed, not globally?
CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
LDFLAGS ?= @LDFLAGS@
+STATIC_LDFLAGS += @STATIC_LDFLAGS@
CLDFLAGS += @CLDFLAGS@
ELDFLAGS += @ELDFLAGS@
LDDEPS += @LDDEPS@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index ec546ca632..cdede2a058 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -137,7 +137,7 @@ man-generator: man-generator.o
lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
@echo " [CC] $@"
- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
+ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
--
2.31.1
|