mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-20 11:40:33 +01:00
Remove support for -Wl,--gc-sections altogether
Packagers should only enable this flag if they have confirmed that it actually works on their toolchain (it's the sort of rarely used feature that frequently regresses on obscure architectures/OSs without anyone noticing), and also confirmed that it is actually a significant size win for their configuration. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33466 Reviewed-by: Colin Walters <walters@verbum.org>
This commit is contained in:
parent
add71e5d7a
commit
ff2047a75a
2 changed files with 4 additions and 32 deletions
|
|
@ -89,7 +89,7 @@ dbus_daemon_LDADD= \
|
|||
$(EFENCE) \
|
||||
$(DBUS_BUS_LIBS)
|
||||
|
||||
dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
|
||||
dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@
|
||||
|
||||
LAUNCH_HELPER_SOURCES= \
|
||||
$(XML_SOURCES) \
|
||||
|
|
@ -115,7 +115,7 @@ dbus_daemon_launch_helper_LDADD= \
|
|||
$(top_builddir)/dbus/libdbus-internal.la \
|
||||
$(DBUS_LAUNCHER_LIBS)
|
||||
|
||||
dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
|
||||
dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
|
||||
|
||||
## we build another binary so we can do the launch testing without root privs.
|
||||
## DO NOT INSTALL THIS FILE
|
||||
|
|
@ -127,7 +127,7 @@ dbus_daemon_launch_helper_test_LDADD= \
|
|||
$(top_builddir)/dbus/libdbus-internal.la \
|
||||
$(DBUS_LAUNCHER_LIBS)
|
||||
|
||||
dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
|
||||
dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
|
||||
dbus_daemon_launch_helper_test_CPPFLAGS= -DDBUS_STATIC_BUILD \
|
||||
-DACTIVATION_LAUNCHER_TEST
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ bus_test_launch_helper_LDADD= \
|
|||
$(top_builddir)/dbus/libdbus-internal.la \
|
||||
$(DBUS_LAUNCHER_LIBS)
|
||||
|
||||
bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
|
||||
bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
|
||||
bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
|
||||
-DACTIVATION_LAUNCHER_TEST \
|
||||
-DACTIVATION_LAUNCHER_DO_OOM
|
||||
|
|
|
|||
28
configure.ac
28
configure.ac
|
|
@ -1168,34 +1168,6 @@ dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
|
|||
dnl is the next best thing
|
||||
CFLAGS="$WARNING_CFLAGS $CFLAGS"
|
||||
|
||||
# Disabling gc-sections makes our binaries bigger, but some toolchains
|
||||
# have known-broken support for it which discards sections that are needed.
|
||||
# See https://bugs.freedesktop.org/show_bug.cgi?id=33466
|
||||
SECTION_LDFLAGS=
|
||||
AC_ARG_ENABLE([gc-sections],
|
||||
[AS_HELP_STRING([--disable-gc-sections],
|
||||
[disable --gc-sections to work around broken toolchains])],
|
||||
[enable_gc_sections=$enableval],
|
||||
[enable_gc_sections=yes])
|
||||
if test "x$GCC,$enable_gc_sections,$dbus_win" = xyes,yes,no; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
AC_MSG_CHECKING([for ability to link with --gc-sections])
|
||||
CFLAGS="-ffunction-sections -fdata-sections"
|
||||
LDFLAGS="-Wl,--gc-sections"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||
[rc=yes],
|
||||
[rc=no])
|
||||
AC_MSG_RESULT([$rc])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
if test "x$rc" = xyes; then
|
||||
SECTION_LDFLAGS="-Wl,--gc-sections"
|
||||
CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([SECTION_LDFLAGS])
|
||||
|
||||
case $host_os in
|
||||
solaris*)
|
||||
# Solaris' C library apparently needs these runes to be threadsafe...
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue