• Paul Burton's avatar
    kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7 · f20e6ccb
    Paul Burton authored
    commit 16fd20aa upstream.
    When building using GCC 4.7 or older, -ffunction-sections & the -pg flag
    used by ftrace are incompatible. This causes warnings or build failures
    (where -Werror applies) such as the following:
        error: -ffunction-sections disabled; it makes profiling impossible
    This used to be taken into account by the ordering of calls to cc-option
    from within the top-level Makefile, which was introduced by commit
    90ad4052 ("kbuild: avoid conflict between -ffunction-sections and
    -pg on gcc-4.7"). Unfortunately this was broken when the
    CONFIG_LD_DEAD_CODE_DATA_ELIMINATION cc-option check was moved to
    Kconfig in commit e85d1d65 ("kbuild: test dead code/data elimination
    support in Kconfig"), because the flags used by this check no longer
    include -pg.
    Fix this by not allowing CONFIG_LD_DEAD_CODE_DATA_ELIMINATION to be
    enabled at the same time as ftrace/CONFIG_FUNCTION_TRACER when building
    using GCC 4.7 or older.
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Fixes: e85d1d65 ("kbuild: test dead code/data elimination support in Kconfig")
    Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: stable@vger.kernel.org # v4.19+
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Last commit
Last update
Kconfig Loading commit data...
Makefile Loading commit data...
calibrate.c Loading commit data...
do_mounts.c Loading commit data...
do_mounts.h Loading commit data...
do_mounts_initrd.c Loading commit data...
do_mounts_md.c Loading commit data...
do_mounts_rd.c Loading commit data...
init_task.c Loading commit data...
initramfs.c Loading commit data...
main.c Loading commit data...
noinitramfs.c Loading commit data...
version.c Loading commit data...