Skip to content

Commit

Permalink
configure: Conditionally include -flto
Browse files Browse the repository at this point in the history
As some systems fail to create working binaries with when linked with
lto, perform a check during configure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39114
  • Loading branch information
Marcus Meissner authored and Chris Wilson committed Apr 14, 2012
1 parent 25abe58 commit d486ea3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion build/configure.ac.warnings
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \

dnl We also abuse the warning-flag facility to enable other compiler
dnl options. Namely, the following:
MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common -flto"

dnl -flto working really needs a test link, not just a compile

safe_MAYBE_WARN="$MAYBE_WARN"
MAYBE_WARN="$MAYBE_WARN -flto"
AC_TRY_LINK([],[
int main(int argc, char **argv) { return 0; }
],[],[
MAYBE_WARN="$safe_MAYBE_WARN"
])

MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"

dnl Also to turn various gcc/glibc-specific preprocessor checks
MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
Expand Down

0 comments on commit d486ea3

Please sign in to comment.