+# Get kernel version from source tree
+cd "${LNXBINDIR}"
+KVERSION=$(make kernelversion)
+cd -
+
+# 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
+
+ set +e
+
+ # Build modules
+ KERNELDIR="${LNXBINDIR}" make -j${NPROC} V=1 CONFIG_LTTNG=m
+
+ # We expect this build to fail, if it doesn't, fail the job.
+ if [ "$?" -eq 0 ]; then
+ exit 1
+ fi
+
+ # We have to publish at least one file or the build will fail
+ echo "This kernel is broken, there is a deadlock in the timekeeping subsystem." > "${BUILDDIR}/BROKEN.txt"
+
+ set -e
+
+else # Regular build
+
+ # Build modules
+ KERNELDIR="${LNXBINDIR}" make -j${NPROC} V=1 CONFIG_LTTNG=m