Patch "powerpc: Fail build if using recordmcount with binutils v2.37" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc: Fail build if using recordmcount with binutils v2.37

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-fail-build-if-using-recordmcount-with-binuti.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 04a4de89e3ea5dbe11440226e243c96b0dfd2b15
Author: Naveen N Rao <naveen@xxxxxxxxxx>
Date:   Tue May 30 11:44:36 2023 +0530

    powerpc: Fail build if using recordmcount with binutils v2.37
    
    [ Upstream commit 25ea739ea1d4d3de41acc4f4eb2d1a97eee0eb75 ]
    
    binutils v2.37 drops unused section symbols, which prevents recordmcount
    from capturing mcount locations in sections that have no non-weak
    symbols. This results in a build failure with a message such as:
            Cannot find symbol for section 12: .text.perf_callchain_kernel.
            kernel/events/callchain.o: failed
    
    The change to binutils was reverted for v2.38, so this behavior is
    specific to binutils v2.37:
    https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c09c8b42021180eee9495bd50d8b35e683d3901b
    
    Objtool is able to cope with such sections, so this issue is specific to
    recordmcount.
    
    Fail the build and print a warning if binutils v2.37 is detected and if
    we are using recordmcount.
    
    Cc: stable@xxxxxxxxxxxxxxx
    Suggested-by: Joel Stanley <joel@xxxxxxxxx>
    Signed-off-by: Naveen N Rao <naveen@xxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/20230530061436.56925-1-naveen@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2fad158173485..daddada1a3902 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -439,3 +439,11 @@ checkbin:
 		echo -n '*** Please use a different binutils version.' ; \
 		false ; \
 	fi
+	@if test "x${CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT}" = "xy" -a \
+		"x${CONFIG_LD_IS_BFD}" = "xy" -a \
+		"${CONFIG_LD_VERSION}" = "23700" ; then \
+		echo -n '*** binutils 2.37 drops unused section symbols, which recordmcount ' ; \
+		echo 'is unable to handle.' ; \
+		echo '*** Please use a different binutils version.' ; \
+		false ; \
+	fi



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux