jjb: fix modules arm64 crossbuild
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 20 Dec 2017 19:41:29 +0000 (14:41 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 20 Dec 2017 19:41:29 +0000 (14:41 -0500)
The ftrace-mod.o special case on arm64 was introduced in 4.13 and
removed in 4.15-rc4, it is also being backported in stable branches.

See upstream commit:

  commit be0f272bfc83797f70d44faca86954df62e2bbc0
  Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
  Date:   Mon Nov 20 17:41:30 2017 +0000

    arm64: ftrace: emit ftrace-mod.o contents through code

    When building the arm64 kernel with both CONFIG_ARM64_MODULE_PLTS and
    CONFIG_DYNAMIC_FTRACE enabled, the ftrace-mod.o object file is built
    with the kernel and contains a trampoline that is linked into each
    module, so that modules can be loaded far away from the kernel and
    still reach the ftrace entry point in the core kernel with an ordinary
    relative branch, as is emitted by the compiler instrumentation code
    dynamic ftrace relies on.

    In order to be able to build out of tree modules, this object file
    needs to be included into the linux-headers or linux-devel packages,
    which is undesirable, as it makes arm64 a special case (although a
    precedent does exist for 32-bit PPC).

    Given that the trampoline essentially consists of a PLT entry, let's
    not bother with a source or object file for it, and simply patch it
    in whenever the trampoline is being populated, using the existing
    PLT support routines.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
scripts/lttng-modules/param-build.sh

index 34ad6a980fca00e281f0425974144c081b27dbba..814489c203d35758f47cc782dff3fd642966340c 100644 (file)
@@ -100,9 +100,9 @@ prepare_lnx_sources() {
         make arch/powerpc/lib/crtsavres.o CC="$CC" ${koutput}
     fi
 
-    # On arm64 this object is required to build with ftrace support
+    # On arm64 between 4.13 and 1.15 this object is required to build with ftrace support
     if [ "${karch}" = "arm64" ]; then
-        if vergte "$KVERSION" "4.13-rc1"; then
+        if [ -f "arch/arm64/kernel/ftrace-mod.S" ]; then
             make arch/arm64/kernel/ftrace-mod.o CC="$CC" ${koutput}
         fi
     fi
@@ -334,9 +334,9 @@ if [ "${karch}" = "powerpc" ]; then
     cp -a --parents arch/powerpc/lib/crtsavres.[So] "${LNXHDRDIR}/"
 fi
 
-# On arm64 this object is required to build with ftrace support
+# On arm64 between 4.13 and 1.15 this object is required to build with ftrace support
 if [ "${karch}" = "arm64" ]; then
-    if vergte "$KVERSION" "4.13-rc1"; then
+    if [ -f "arch/arm64/kernel/ftrace-mod.S" ]; then
         cp -a --parents arch/arm64/kernel/ftrace-mod.[So] "${LNXHDRDIR}/"
     fi
 fi
This page took 0.032419 seconds and 4 git commands to generate.