Skip to content

Commit

Permalink
Use symbolic and sectioned builds if supported by the toolchain.
Browse files Browse the repository at this point in the history
These help both shared lib size, as well as app size when statically linking. STR #3097


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10230 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
clbr committed Aug 21, 2014
1 parent 3a5f3f1 commit 3113727
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions configure.in
Expand Up @@ -1165,6 +1165,30 @@ if test -n "$GCC"; then
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"

# See if ld supports -Bsymbolic-functions...
AC_MSG_CHECKING(if ld supports -Bsymbolic-functions)
OLDLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
AC_TRY_LINK(,,
[DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions"]
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
LDFLAGS="$OLDLDFLAGS"

# See if toolchain supports a sectioned build...
AC_MSG_CHECKING(if toolchain supports sections)
OLDLDFLAGS="$LDFLAGS"
OLDCFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS -Wl,-gc-sections"
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
AC_TRY_LINK(,,
[DSOFLAGS="$DSOFLAGS -Wl,-gc-sections"
OPTIM="$OPTIM -ffunction-sections -fdata-sections"]
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
LDFLAGS="$OLDLDFLAGS"
CFLAGS="$OLDCFLAGS"

# See if we are running Solaris; if so, try the -fpermissive option...
# This option is required on some versions of Solaris to work around
# bugs in the X headers up through Solaris 7.
Expand Down

0 comments on commit 3113727

Please sign in to comment.