From 8fe4e79835afa83efc453c98b4b59803166610a3 Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Wed, 22 Mar 2017 08:47:45 +0900 Subject: [PATCH] sync rumpkernel/buildrump.sh#78 Signed-off-by: Hajime Tazaki --- buildrump/.travis.yml | 16 +++++++++----- buildrump/AUTHORS | 1 + buildrump/buildrump.sh | 9 +++++--- buildrump/checkout.sh | 33 +++++++++++++++-------------- buildrump/linux.sh | 47 ++++++++++++++++++++++-------------------- buildrump/netbsd.sh | 2 +- 6 files changed, 62 insertions(+), 46 deletions(-) diff --git a/buildrump/.travis.yml b/buildrump/.travis.yml index db55eaa80..2cf6f8628 100644 --- a/buildrump/.travis.yml +++ b/buildrump/.travis.yml @@ -15,8 +15,7 @@ compiler: sudo: false before_script: - - ./buildrump.sh checkout - - ./buildrump.sh ${LINUX} checkout + - ./buildrump.sh ${RUMPKERNEL} checkout env: - NAME='static' LIBTYPE='MKPIC=no' BUILDTYPE='' TESTS='tests' @@ -24,11 +23,18 @@ env: - NAME='debug' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-DDD' TESTS='tests' - NAME='release' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-r' TESTS='tests' - NAME='fibers' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-V RUMPUSER_THREADS=fiber -V RUMP_CURLWP=hypercall' TESTS='' - - NAME='dynamic' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='' TESTS='tests' LINUX='-l ./lkl-linux' - - NAME='fibers' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-V RUMPUSER_THREADS=fiber -V RUMP_CURLWP=hypercall' TESTS='' LINUX='-l ./lkl-linux' + - NAME='dynamic' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='' TESTS='' RUMPKERNEL='-l linux' + - NAME='fibers' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-V RUMPUSER_THREADS=fiber -V RUMP_CURLWP=hypercall' TESTS='' RUMPKERNEL='-l linux' + +matrix: + allow_failures: + - compiler: clang + env: NAME='dynamic' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='' TESTS='' RUMPKERNEL='-l linux' + - compiler: clang + env: NAME='fibers' LIBTYPE='MKSTATICLIB=no' BUILDTYPE='-V RUMPUSER_THREADS=fiber -V RUMP_CURLWP=hypercall' TESTS='' RUMPKERNEL='-l linux' script: - - ./buildrump.sh ${LINUX} -o obj.${NAME} -d rump.${NAME} -qq -j16 -V ${LIBTYPE} ${BUILDTYPE} fullbuild ${TESTS} + - ./buildrump.sh ${RUMPKERNEL} -o obj.${NAME} -d rump.${NAME} -qq -j16 -V ${LIBTYPE} ${BUILDTYPE} fullbuild ${TESTS} notifications: irc: diff --git a/buildrump/AUTHORS b/buildrump/AUTHORS index 1c5d05f8c..427cbeff0 100644 --- a/buildrump/AUTHORS +++ b/buildrump/AUTHORS @@ -8,3 +8,4 @@ Alexander Guy Robert Millan Viktor Pocedulic David Michael +Mahdi Mokhtari diff --git a/buildrump/buildrump.sh b/buildrump/buildrump.sh index 86bc4f31a..0a712090f 100755 --- a/buildrump/buildrump.sh +++ b/buildrump/buildrump.sh @@ -519,6 +519,7 @@ maketools () # very confused if you start the build, it bombs, you add zlib, # and retry. doesitbuild_host '#include +#include int main() {gzopen(NULL, NULL); return 0;}' -lz \ || die 'Host zlib (libz, -lz) required, please install one!' @@ -562,7 +563,7 @@ int main() {gzopen(NULL, NULL); return 0;}' -lz \ cat >> "${MKCONF}" << EOF BUILDRUMP_IMACROS=${BRIMACROS} .if \${BUILDRUMP_SYSROOT:Uno} == "yes" -BUILDRUMP_CPPFLAGS=--sysroot=\${BUILDRUMP_STAGE} +BUILDRUMP_CPPFLAGS=--sysroot=\${BUILDRUMP_STAGE} -isystem =/usr/include .else BUILDRUMP_CPPFLAGS=-I\${BUILDRUMP_STAGE}/usr/include .endif @@ -1233,6 +1234,7 @@ parseargs () OBJDIR=./obj DESTDIR=./rump SRCDIR=./src + LKL_SRCDIR=./linux JNUM=4 while getopts 'd:DhHj:kl:o:qrs:T:V:F:' opt; do @@ -1396,7 +1398,7 @@ parseargs () docheckout=true checkoutstyle=cvs fi - if ${docheckout} && ${RUMPKERNEL} = "linux" ; then + if ${docheckout} && [ ${RUMPKERNEL} = "linux" ] ; then docheckout=true checkoutstyle=linux-git fi @@ -1434,6 +1436,7 @@ resolvepaths () abspath BRTOOLDIR abspath SRCDIR + [ "${RUMPKERNEL}" = "linux" ] && abspath LKL_SRCDIR RUMPMAKE="${BRTOOLDIR}/bin/brrumpmake" BRIMACROS="${BRTOOLDIR}/include/opt_buildrump.h" @@ -1483,7 +1486,7 @@ done parseargs "$@" -${docheckout} && { ${BRDIR}/checkout.sh ${checkoutstyle} ${SRCDIR} || exit 1; } +${docheckout} && { ${BRDIR}/checkout.sh ${checkoutstyle} ${SRCDIR} ${LKL_SRCDIR} || exit 1; } if ${doprobe} || ${dotools} || ${dobuild} || ${dokernelheaders} \ || ${doinstall} || ${dotests}; then diff --git a/buildrump/checkout.sh b/buildrump/checkout.sh index e228d14fd..6d660f70e 100755 --- a/buildrump/checkout.sh +++ b/buildrump/checkout.sh @@ -64,7 +64,7 @@ NBSRC_EXTRA_usr='' GITREPO='https://github.com/rumpkernel/src-netbsd' GITREPOPUSH='git@github.com:rumpkernel/src-netbsd' -GITREPO_LINUX='https://github.com/thehajime/lkl-linux' +GITREPO_LKL='https://github.com/libos-nuse/lkl-linux' GITREVFILE='.srcgitrev' checkoutcvs () @@ -200,30 +200,30 @@ checkoutgit () } # Check out Linux (LKL) sources. -LIBOS_REV=rump-hypcall +LKL_REV=rump-hypcall-upstream checkoutgitlinux () { - echo ">> Fetching Linux sources to ${LINUX_SRCDIR} using git" + echo ">> Fetching Linux/LKL sources to ${LKL_SRCDIR} using git" - if [ -e "${LINUX_SRCDIR}" -a ! -e "${LINUX_SRCDIR}/.git" ]; then + if [ -e "${LKL_SRCDIR}" -a ! -e "${LKL_SRCDIR}/.git" ]; then echo '>>' - echo ">> NOTICE: Not a buildrump.sh-based git repo in ${LINUX_SRCDIR}" + echo ">> NOTICE: Not a buildrump.sh-based git repo in ${LKL_SRCDIR}" echo '>> Cannot verify repository version. Proceeding ...' echo '>>' return 0 fi - gitrev=${LIBOS_REV} + gitrev=${LKL_REV} [ $? -eq 0 ] || die Cannot determine relevant git revision - if [ -e ${LINUX_SRCDIR}/.git ] ; then - cd ${LINUX_SRCDIR} + if [ -e ${LKL_SRCDIR}/.git ] ; then + cd ${LKL_SRCDIR} # [ -z "$(${GIT} status --porcelain)" ] \ -# || die "Cloned repo in ${LINUX_SRCDIR} is not clean, aborting." - ${GIT} fetch origin rump-hypcall || die Failed to fetch repo +# || die "Cloned repo in ${LKL_SRCDIR} is not clean, aborting." + ${GIT} fetch origin ${LKL_REV} || die Failed to fetch repo else - ${GIT} clone -n ${GITREPO_LINUX} ${LINUX_SRCDIR} || die Clone failed - cd ${LINUX_SRCDIR} + ${GIT} clone -n ${GITREPO_LKL} ${LKL_SRCDIR} || die Clone failed + cd ${LKL_SRCDIR} fi ${GIT} checkout -q ${gitrev} || \ @@ -386,7 +386,7 @@ BRDIR=$(dirname $0) [ $# -lt 2 ] && die Invalid usage. Run this script via buildrump.sh SRCDIR=${2} -LINUX_SRCDIR=${3} +LKL_SRCDIR=${3} # default to the most secure source for githubdate if [ -z "${BUILDRUMP_CVSROOT}" ]; then @@ -433,9 +433,12 @@ git) ;; linux-git) setgit || die "require working git" - cd $(dirname $0) + curdir="$(pwd)" + # XXX: currently linux build requires src-netbsd + checkoutgit + cd "${curdir}" checkoutgitlinux - cd $(dirname $0) + cd "${curdir}" echo '>> checkout done' ;; githubdate) diff --git a/buildrump/linux.sh b/buildrump/linux.sh index 300100276..f581c6949 100644 --- a/buildrump/linux.sh +++ b/buildrump/linux.sh @@ -1,14 +1,14 @@ -RUMPKERN_CPPFLAGS="-D__linux__" +RUMPKERN_CPPFLAGS="-D__linux__ -DCONFIG_LKL" checkcheckout () { - [ -f "${LKLSRC}/arch/lkl/Makefile" ] || \ - die "Cannot find ${LKLSRC}/arch/lkl/Makefile!" + [ -f "${LKL_SRCDIR}/arch/lkl/Makefile" ] || \ + die "Cannot find ${LKL_SRCDIR}/arch/lkl/Makefile!" [ ! -z "${TARBALLMODE}" ] && return - if ! ${BRDIR}/checkout.sh checkcheckout ${LKLSRC} \ + if ! ${BRDIR}/checkout.sh checkcheckout ${LKL_SRCDIR} \ && ! ${TITANMODE}; then die 'revision mismatch, run checkout (or -H to override)' fi @@ -16,8 +16,8 @@ checkcheckout () makebuild () { - echo "=== Linux build LKLSRC=${LKLSRC} ===" - cd ${LKLSRC} + echo "=== Linux build LKLSRC=${LKL_SRCDIR} ===" + cd ${LKL_SRCDIR} VERBOSE="V=0" if [ ${NOISE} -gt 1 ] ; then VERBOSE="V=1" @@ -33,16 +33,16 @@ makebuild () set -e set -x - - export RUMP_PREFIX=${OBJDIR}/../librumpuser/ - mkdir -p ${OBJDIR}/lkl-linux + export RUMP_PREFIX=${SRCDIR}/sys/rump + export RUMP_INCLUDE=${SRCDIR}/sys/rump/include + mkdir -p ${OBJDIR}/linux cd tools/lkl - rm -f ${OBJDIR}/lkl-linux/tools/lkl/lib/lkl.o - make CROSS_COMPILE=${CROSS} rumprun=no -j ${JNUM} ${VERBOSE} O=${OBJDIR}/lkl-linux/ + rm -f ${OBJDIR}/linux/tools/lkl/lib/lkl.o + make CROSS_COMPILE=${CROSS} rumprun=yes -j ${JNUM} ${VERBOSE} O=${OBJDIR}/linux cd ../../ - make CROSS_COMPILE=${CROSS} headers_install ARCH=lkl O=${OBJDIR}/rump/ + make CROSS_COMPILE=${CROSS} headers_install ARCH=lkl O=${DESTDIR}/ PREFIX=/ INSTALL_HDR_PATH=${DESTDIR}/ set +x } @@ -52,13 +52,15 @@ makeinstall () # XXX for app-tools mkdir -p ${DESTDIR}/bin/ - mkdir -p ${OBJDIR}/rumptools/dest/usr/include/rumprun - - export RUMP_PREFIX=${OBJDIR}/../librumpuser/ - make rumprun=no headers_install libraries_install CROSS_COMPILE=${CROSS} \ - DESTDIR=${DESTDIR} \ - -C ${LKLSRC}/tools/lkl/ O=${OBJDIR}/lkl-linux/ - + mkdir -p ${DESTDIR}/include/rumprun + + export RUMP_PREFIX=${SRCDIR}/sys/rump + export RUMP_INCLUDE=${SRCDIR}/sys/rump/include + make rumprun=yes headers_install libraries_install DESTDIR=${DESTDIR}\ + -C ./tools/lkl/ O=${OBJDIR}/linux PREFIX=/ + # XXX: for netconfig.h + mkdir -p ${DESTDIR}/include/rump/ + cp -pf ${BRDIR}/brlib/libnetconfig/rump/netconfig.h ${DESTDIR}/include/rump/ } # @@ -73,7 +75,8 @@ makekernelheaders () maketests () { - printf 'Linux libos test ... ' - make -C ${LKLSRC}/tools/lkl test || die Linux libos failed + printf 'SKIP: Linux test currently not implemented yet ... \n' + return + printf 'Linux test ... \n' + make -C ${LKL_SRCDIR}/tools/lkl test O=${OBJDIR}/linux || die LKL test failed } - diff --git a/buildrump/netbsd.sh b/buildrump/netbsd.sh index 68ae8a941..8212a3d9f 100644 --- a/buildrump/netbsd.sh +++ b/buildrump/netbsd.sh @@ -142,7 +142,7 @@ makeinstall () # install kernel headers. # Note: Do _NOT_ do this unless you want to install a # full rump kernel application stack -# +# makekernelheaders () {