[systemd-commits] Makefile.am src/compat-libs

Kay Sievers kay at kemper.freedesktop.org
Sat Feb 22 12:37:50 PST 2014


 Makefile.am                   |   58 +++++++++++++++++++-----------------------
 src/compat-libs/linkwarning.h |    1 
 2 files changed, 27 insertions(+), 32 deletions(-)

New commits:
commit 03e37dd767e52908f30783d9b4c09fb6a4e865c7
Author: Kay Sievers <kay at vrfy.org>
Date:   Sat Feb 22 19:39:12 2014 +0100

    build-sys: build compat libs from sources, avoiding the not generally available ifunc wrapping

diff --git a/Makefile.am b/Makefile.am
index dd9ba96..feadc98 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4432,24 +4432,26 @@ clean-python:
 
 # ------------------------------------------------------------------------------
 if ENABLE_COMPAT_LIBS
-
 EXTRA_DIST += \
 	src/compat-libs/linkwarning.h
 
-define generate-fake-lib
+libsystemd-%.c: src/compat-libs/libsystemd-%.sym
 	$(AM_V_at)$(MKDIR_P) $(dir $@)
-	$(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/void new_\1(void);\n__asm__(".symver new_\1,\1 at LIBSYSTEMD_209");\nstatic void (*resolve_\1(void)) (void) {\n\treturn new_\1;\n}\nvoid \1(void) __attribute__((ifunc("resolve_\1")));\nobsolete_lib(\1,$(notdir $(basename $<)));\n/p' <$< >$@
-endef
+	$(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
+
+BUILT_SOURCES += \
+	libsystemd-journal.c \
+	libsystemd-login.c \
+	libsystemd-id128.c \
+	libsystemd-daemon.c
 
 libsystemd_journal_la_SOURCES = \
 	libsystemd-journal.c \
 	src/compat-libs/libsystemd-journal.sym
 
-libsystemd_journal_la_CFLAGS = \
+libsystemd_journal_la_CPPFLAGS = \
 	$(AM_CFLAGS) \
-	-fvisibility=default \
-	-imacros $(top_srcdir)/src/compat-libs/linkwarning.h \
-	-fno-lto
+	-imacros$(top_srcdir)/src/compat-libs/linkwarning.h
 
 libsystemd_journal_la_LDFLAGS = \
 	$(AM_LDFLAGS) \
@@ -4457,17 +4459,17 @@ libsystemd_journal_la_LDFLAGS = \
 	-Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
 
 libsystemd_journal_la_LIBADD = \
-	libsystemd.la
+	libsystemd-journal-internal.la \
+	libsystemd-internal.la \
+	libsystemd-shared.la
 
 libsystemd_login_la_SOURCES = \
 	libsystemd-login.c \
 	src/compat-libs/libsystemd-login.sym
 
-libsystemd_login_la_CFLAGS = \
+libsystemd_login_la_CPPFLAGS = \
 	$(AM_CFLAGS) \
-	-fvisibility=default \
-	-imacros $(top_srcdir)/src/compat-libs/linkwarning.h \
-	-fno-lto
+	-imacros$(top_srcdir)/src/compat-libs/linkwarning.h
 
 libsystemd_login_la_LDFLAGS = \
 	$(AM_LDFLAGS) \
@@ -4475,14 +4477,16 @@ libsystemd_login_la_LDFLAGS = \
 	-Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
 
 libsystemd_login_la_LIBADD = \
-	libsystemd.la
+	libsystemd-internal.la \
+	libsystemd-shared.la
 
 libsystemd_id128_la_SOURCES = \
 	libsystemd-id128.c \
 	src/compat-libs/libsystemd-id128.sym
 
-libsystemd_id128_la_CFLAGS = \
-	$(libsystemd_login_la_CFLAGS)
+libsystemd_id128_la_CPPFLAGS = \
+	$(AM_CFLAGS) \
+	-imacros$(top_srcdir)/src/compat-libs/linkwarning.h
 
 libsystemd_id128_la_LDFLAGS = \
 	$(AM_LDFLAGS) \
@@ -4490,14 +4494,16 @@ libsystemd_id128_la_LDFLAGS = \
 	-Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
 
 libsystemd_id128_la_LIBADD = \
-	libsystemd.la
+	libsystemd-internal.la \
+	libsystemd-shared.la
 
 libsystemd_daemon_la_SOURCES = \
 	libsystemd-daemon.c \
 	src/compat-libs/libsystemd-daemon.sym
 
-libsystemd_daemon_la_CFLAGS = \
-	$(libsystemd_login_la_CFLAGS)
+libsystemd_daemon_la_CPPFLAGS = \
+	$(AM_CFLAGS) \
+	-imacros$(top_srcdir)/src/compat-libs/linkwarning.h
 
 libsystemd_daemon_la_LDFLAGS = \
 	$(AM_LDFLAGS) \
@@ -4505,16 +4511,8 @@ libsystemd_daemon_la_LDFLAGS = \
 	-Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
 
 libsystemd_daemon_la_LIBADD = \
-	libsystemd.la
-
-BUILT_SOURCES += \
-	libsystemd-journal.c \
-	libsystemd-login.c \
-	libsystemd-id128.c \
-	libsystemd-daemon.c
-
-libsystemd-%.c: src/compat-libs/libsystemd-%.sym
-	$(generate-fake-lib)
+	libsystemd-internal.la \
+	libsystemd-shared.la
 
 lib_LTLIBRARIES += \
 	libsystemd-journal.la \
@@ -4543,7 +4541,6 @@ compat-lib-uninstall-hook:
 
 INSTALL_EXEC_HOOKS += compat-lib-install-hook
 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
-
 endif
 
 EXTRA_DIST += \
@@ -4972,7 +4969,6 @@ EXTRA_DIST += \
 	$(top_srcdir)/tools/check-includes.pl
 
 # Stupid test that everything purported to be exported really is
-
 define generate-sym-test
 	$(AM_V_at)$(MKDIR_P) $(dir $@)
 	$(AM_V_at)printf '#include <stdio.h>\n' > $@
diff --git a/src/compat-libs/linkwarning.h b/src/compat-libs/linkwarning.h
index b6a6ac2..a2e9534 100644
--- a/src/compat-libs/linkwarning.h
+++ b/src/compat-libs/linkwarning.h
@@ -18,7 +18,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #define __make_section_unallocated(section_string)      \
   asm (".section " section_string "\n\t.previous");
 



More information about the systemd-commits mailing list