Skip to content

Commit

Permalink
Merge pull request #6497 from garlick/issue#6496
Browse files Browse the repository at this point in the history
build: use -Wl,--gc-sections when appropriate
  • Loading branch information
mergify[bot] authored Dec 10, 2024
2 parents 7cd6705 + ff1a93f commit 3cae472
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@ AC_PATH_PROGS(SSH, [rsh ssh], [/usr/bin/rsh])
AC_DEFINE_UNQUOTED([PATH_SSH], "$SSH",
[Define remote shell program to be used by the ssh:// connector])

# macos linker doesn't support --gc-sections
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="-Wl,--gc-sections $LDFLAGS"
AC_MSG_CHECKING([whether ld supports --gc-sections])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [
AC_MSG_RESULT([yes])
ld_gc_sections="-Wl,--gc-sections"
AS_VAR_SET(ld_gc_sections, $ld_gc_sections)
AC_SUBST(ld_gc_sections)
],[
AC_MSG_RESULT([no])
])
LDFLAGS=$saved_LDFLAGS

LT_INIT
AC_PROG_AWK

Expand Down

0 comments on commit 3cae472

Please sign in to comment.