From: Michael Jeanson Date: Mon, 17 Jul 2017 19:06:40 +0000 (-0400) Subject: jjb: fix arm64 lttng-modules build on kernel >=4.13-rc1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a1ae361ec3a9a41ef3e22a464cd4ebc4afae0fbc;p=lttng-ci.git jjb: fix arm64 lttng-modules build on kernel >=4.13-rc1 Signed-off-by: Michael Jeanson --- diff --git a/jobs/lttng-modules.yaml b/jobs/lttng-modules.yaml index b5e48ac..9b6533c 100644 --- a/jobs/lttng-modules.yaml +++ b/jobs/lttng-modules.yaml @@ -301,7 +301,7 @@ default: 'master' description: 'The lttng-modules branch to build.' - string: - name: 'kversion' + name: 'ktag' default: '' description: 'The linux kernel git tag to build against.' - string: @@ -325,7 +325,7 @@ builders: - shell: | - git clone --depth=1 -b "$kversion" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux + git clone --depth=1 -b "$ktag" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux - shell: !include-raw-escape: scripts/lttng-modules/param-build.sh @@ -356,7 +356,7 @@ default: 'master' description: 'The lttng-modules branch to build.' - string: - name: 'kversion' + name: 'ktag' default: '' description: 'The linux kernel git tag to build against.' - string: @@ -380,7 +380,7 @@ builders: - shell: | - git clone --depth=1 -b "$kversion" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux + git clone --depth=1 -b "$ktag" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux - shell: !include-raw-escape: scripts/lttng-modules/param-build.sh diff --git a/scripts/lttng-modules/master-rt.groovy b/scripts/lttng-modules/master-rt.groovy index 177041d..cfcfe09 100644 --- a/scripts/lttng-modules/master-rt.groovy +++ b/scripts/lttng-modules/master-rt.groovy @@ -173,7 +173,7 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { def kversion = kversions.pop() def job_params = [ new StringParameterValue('mversion', mversion), - new StringParameterValue('kversion', kversion.toString()), + new StringParameterValue('ktag', kversion.toString()), new StringParameterValue('kgitrepo', kgitrepo), ] @@ -217,7 +217,7 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { // Print results def matrixParent = currentBuild.get() allBuilds.add(matrixParent) - def kernelStr = matrixParent.buildVariableResolver.resolve("kversion") + def kernelStr = matrixParent.buildVariableResolver.resolve("ktag") println "${matrixParent.fullDisplayName} (${kernelStr}) completed with status ${matrixParent.result}" // Process child runs of matrixBuild @@ -243,7 +243,7 @@ for (failedRun in failedRuns) { println "---Build report---" for (b in allBuilds) { - def kernelStr = b.buildVariableResolver.resolve("kversion") + def kernelStr = b.buildVariableResolver.resolve("ktag") println "${b.fullDisplayName} (${kernelStr}) completed with status ${b.result}" // Cleanup builds try { diff --git a/scripts/lttng-modules/master.groovy b/scripts/lttng-modules/master.groovy index 0dbf61b..a8bf945 100644 --- a/scripts/lttng-modules/master.groovy +++ b/scripts/lttng-modules/master.groovy @@ -450,7 +450,7 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { def kversion = kversions.pop() def job_params = [ new StringParameterValue('mversion', mversion), - new StringParameterValue('kversion', kversion.toString()), + new StringParameterValue('ktag', kversion.toString()), new StringParameterValue('kgitrepo', kgitrepo), ] @@ -492,7 +492,7 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { // Print results def matrixParent = currentBuild.get() allBuilds.add(matrixParent) - def kernelStr = matrixParent.buildVariableResolver.resolve("kversion") + def kernelStr = matrixParent.buildVariableResolver.resolve("ktag") println "${matrixParent.fullDisplayName} (${kernelStr}) completed with status ${matrixParent.result}" // Process child runs of matrixBuild @@ -518,7 +518,7 @@ for (failedRun in failedRuns) { println "---Build report---" for (b in allBuilds) { - def kernelStr = b.buildVariableResolver.resolve("kversion") + def kernelStr = b.buildVariableResolver.resolve("ktag") println "${b.fullDisplayName} (${kernelStr}) completed with status ${b.result}" // Cleanup builds try { diff --git a/scripts/lttng-modules/param-build.sh b/scripts/lttng-modules/param-build.sh index 6af2d57..443059d 100644 --- a/scripts/lttng-modules/param-build.sh +++ b/scripts/lttng-modules/param-build.sh @@ -46,7 +46,7 @@ prepare_lnx_sources() { fi # Generate kernel configuration - case "$kversion" in + case "$ktag" in Ubuntu*) fakeroot debian/rules clean fakeroot debian/rules genconfigs @@ -88,11 +88,18 @@ prepare_lnx_sources() { make arch/powerpc/lib/crtsavres.o CC="$CC" ${koutput} fi + # On arm64 this object is required to build with ftrace support + if [ "${karch}" = "arm64" ]; then + if vergte "$KVERSION" "4.13-rc1"; then + make arch/arm64/kernel/ftrace-mod.o CC="$CC" ${koutput} + fi + fi + # Version specific tasks - case "$kversion" in + case "$ktag" in Ubuntu*) # Add Ubuntu ABI number to kernel headers, this is normally done by the packaging code - ABINUM="$(echo "$kversion" | grep -P -o 'Ubuntu-(lts-)?.*-\K\d+(?=\..*)')" + ABINUM="$(echo "$ktag" | grep -P -o 'Ubuntu-(lts-)?.*-\K\d+(?=\..*)')" echo "#define UTS_UBUNTU_RELEASE_ABI $ABINUM" >> "${outdir}"/include/generated/utsrelease.h ;; esac @@ -105,17 +112,13 @@ build_modules() { kdir="$1" bdir="$2" - # Get kernel version from source tree - cd "${kdir}" - kversion=$(make kernelversion) - # Enter lttng-modules source dir cd "${LTTSRCDIR}" # kernels 3.10 to 3.10.13 and 3.11 to 3.11.2 introduce a deadlock in the # timekeeping subsystem. We want those build to fail. - if { vergte "$kversion" "3.10" && verlte "$kversion" "3.10.13"; } || \ - { vergte "$kversion" "3.11" && verlte "$kversion" "3.11.2"; }; then + if { vergte "$KVERSION" "3.10" && verlte "$KVERSION" "3.10.13"; } || \ + { vergte "$KVERSION" "3.11" && verlte "$KVERSION" "3.11.2"; }; then set +e @@ -280,6 +283,9 @@ mkdir -p "${LNXBUILDDIR}" "${LNXHDRDIR}" "${LTTBUILDKSRCDIR}" "${LTTBUILDKHDRDIR # Enter linux source dir cd "${LNXSRCDIR}" +# Get kernel version from source tree +KVERSION=$(make kernelversion) + prepare_lnx_sources "." # For RT kernels, copy version file @@ -316,6 +322,13 @@ 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 +if [ "${karch}" = "arm64" ]; then + if vergte "$KVERSION" "4.13-rc1"; then + cp -a --parents arch/arm64/kernel/ftrace-mod.[So] "${LNXHDRDIR}/" + fi +fi + # Copy modules related stuff, if available if [ -s Module.symvers ]; then cp Module.symvers "${LNXHDRDIR}"