build: bump m4 to use data-sections, func-sections
This commit is contained in:
parent
5674f2a2e9
commit
dc8fd96e4b
@ -7,6 +7,8 @@ AC_DEFUN([NC_OPTIMISATION],[
|
||||
AX_COMPILER_VENDOR
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Enable LTO
|
||||
|
||||
AC_ARG_ENABLE([lto], [
|
||||
AS_HELP_STRING([--enable-lto], [enable link-time optimisation])
|
||||
])
|
||||
@ -28,6 +30,8 @@ AC_DEFUN([NC_OPTIMISATION],[
|
||||
])
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Choose the most performant processor architecture and features
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AS_CASE([$host_cpu],
|
||||
@ -50,6 +54,9 @@ AC_DEFUN([NC_OPTIMISATION],[
|
||||
AX_APPEND_COMPILE_FLAGS([-mfpmath=sse], [], [-Werror])
|
||||
AX_APPEND_COMPILE_FLAGS([-msahf], [], [-Werror])
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Enable aggressive code generation optimisations
|
||||
|
||||
AS_IF([test "x$enable_debugging" != "xyes"], [
|
||||
AX_APPEND_COMPILE_FLAGS([-ftree-loop-distribute-patterns], [], [-Werror])
|
||||
AX_APPEND_COMPILE_FLAGS([-ftree-loop-if-convert-stores], [], [-Werror])
|
||||
@ -60,4 +67,15 @@ AC_DEFUN([NC_OPTIMISATION],[
|
||||
# performance than security.
|
||||
AX_APPEND_COMPILE_FLAGS([-fno-stack-protector], [], [-Werror])
|
||||
])
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Enable code size optimisations (that don't impact performance)
|
||||
## Note: we assume CXX, and that CXXLINK is g++ not ld, hence the -Wl opt
|
||||
AS_IF([test "x$enable_debugging" != "xyes"], [
|
||||
AX_CHECK_LINK_FLAG([-Wl,--gc-sections], [
|
||||
AX_APPEND_COMPILE_FLAGS([-fdata-sections], [], [-Werror])
|
||||
AX_APPEND_COMPILE_FLAGS([-ffunction-sections], [], [-Werror])
|
||||
AX_APPEND_LINK_FLAGS([-Wl,--gc-sections], [], [-Werror])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user