mirror of
https://github.com/AuxXxilium/kmod.git
synced 2025-02-20 08:26:55 +07:00
build: enable LTO and _FORTIFY_SOURCE with optimization
If building with optimization enabled, enable LTO.
This commit is contained in:
parent
88f6ffe449
commit
27bcc9111b
12
configure.ac
12
configure.ac
@ -226,8 +226,18 @@ CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
|
||||
-fvisibility=hidden \
|
||||
-ffunction-sections \
|
||||
-fdata-sections])
|
||||
AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
|
||||
|
||||
AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
|
||||
[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
|
||||
-flto -ffat-lto-objects])],
|
||||
[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
|
||||
|
||||
AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
|
||||
[CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
|
||||
-Wp,-D_FORTIFY_SOURCE=2])],
|
||||
[AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
|
||||
|
||||
AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
|
||||
|
||||
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
|
||||
-Wl,--as-needed \
|
||||
|
Loading…
Reference in New Issue
Block a user