dde_rump: Update to current version

Issue #1361
This commit is contained in:
Josef Söntgen 2014-08-14 17:16:06 +02:00 committed by Christian Helmuth
parent 2380fc442f
commit f01472b308
13 changed files with 261 additions and 95 deletions

View File

@ -25,10 +25,11 @@ SOURCE = $(addprefix $(REP_DIR)/src/lib/rump/,$(SRC_CC))
#
# Rump build script
#
BUILD_CMD = AR=$(AR) NM=$(NM) OBJCOPY=$(OBJCOPY) \
BUILD_CMD = BUILD_CC=cc BUILD_AR=ar BUILD_NM=nm BUILD_OBJCOPY=objcopy \
AR=$(AR) NM=$(NM) OBJCOPY=$(OBJCOPY) CC_TARGET=$(shell basename $(CC)) \
$(RUMP_CONTRIB_DIR)/buildrump.sh -k -V'MAKEVERBOSE=$(VERBOSE_LEVEL)' \
$(RUMP_OPT) -s $(RUMP_SRC) -T $(RUMP_TOOLS) -o $(RUMP_OBJ) \
-d $(RUMP_BASE)
-V'NOGCCERROR=1' $(RUMP_OPT) -s $(RUMP_SRC) -T $(RUMP_TOOLS) \
-o $(RUMP_OBJ) -d $(RUMP_BASE)
#
# Linkage

View File

@ -5,17 +5,13 @@ LIBS += rump
RUMP_LIBS = librumpdev.a \
librumpdev_disk.a \
librumpdev_netsmb.a \
librumpkern_crypto.a \
librumpnet.a \
librumpvfs.a \
librumpfs_cd9660.a \
librumpfs_ext2fs.a \
librumpfs_ffs.a \
librumpfs_msdos.a \
librumpfs_nfs.a \
librumpfs_ntfs.a \
librumpfs_smbfs.a \
librumpfs_udf.a
ARCHIVE += $(addprefix $(RUMP_LIB)/,$(RUMP_LIBS))

View File

@ -1,66 +1,221 @@
diff --git a/buildrump.sh b/buildrump.sh
index f600b6a..f6bb302 100755
index 9cc5457..620dbf1 100755
--- a/buildrump.sh
+++ b/buildrump.sh
@@ -570,6 +570,16 @@ evaltools ()
: ${NM:=nm}
: ${OBJCOPY:=objcopy}
else
+ if [ "${MACH_ARCH}" = 'x86_64' ] ; then
+ cc_target=genode-x86
+ elif [ "${MACH_ARCH}" = 'arm' ] ; then
+ cc_target=genode-arm
+ else
+ die Unsupported architectur ${MACH_ARCH}
+ fi
+
+ echo "MACH_ARCH cc ${MACH_ARCH}"
+
: ${AR:=${cc_target}-ar}
: ${NM:=${cc_target}-nm}
: ${OBJCOPY:=${cc_target}-objcopy}
@@ -600,6 +610,8 @@ evaltools ()
;;
esac
@@ -191,8 +191,8 @@ probear ()
{
+ TARGET=freebsd
+
# check if we're running from a tarball, i.e. is checkout possible
BRDIR=$(dirname $0)
unset TARBALLMODE
@@ -872,26 +884,6 @@ evaltarget ()
ccdefault=32
# Check for GNU/BSD ar
- if ! ${AR} -V 2>/dev/null | egrep '(GNU|BSD) ar' > /dev/null ; then
- die Need GNU or BSD ar "(`type ${AR}`)"
+ if ! ${TOOLS_AR} -V 2>/dev/null | egrep '(GNU|BSD) ar' > /dev/null ; then
+ die Need GNU or BSD ar "(`type ${TOOLS_AR}`)"
fi
}
@@ -223,7 +223,7 @@ doesitbuild ()
warnflags="-Wmissing-prototypes -Wstrict-prototypes -Wimplicit -Werror"
printf "${theprog}" \
- | ${CC} ${warnflags} ${EXTRA_LDFLAGS} ${EXTRA_CFLAGS} \
+ | ${TOOLS_CC} ${warnflags} ${EXTRA_LDFLAGS} ${EXTRA_CFLAGS} -x c - -o /dev/null $* \
-x c - -o /dev/null $* > /dev/null 2>&1
}
@@ -242,13 +242,7 @@ checkcheckout ()
checkcompiler ()
{
-
- if ! ${KERNONLY}; then
- doesitbuild 'int main(void) {return 0;}\n' \
- ${EXTRA_RUMPUSER} ${EXTRA_RUMPCOMMON}
- [ $? -eq 0 ] || ${TITANMODE} || \
- die 'Probe cannot build a binary'
- fi
+ return
}
probe_rumpuserbits ()
@@ -548,7 +542,8 @@ makemake ()
stage=$2
cmd=$3
- env CFLAGS= HOST_LDFLAGS=-L${OBJDIR} ./build.sh \
+ env CC=${BUILD_CC} AR=${BUILD_AR} NM=${BUILD_NM} OBJCOPY=${BUILD_OBJCOPY} \
+ CFLAGS= BUILD_LDFLAGS=-L${OBJDIR} ./build.sh \
-m ${MACHINE} -u \
-D ${stage} -w ${wrapper} \
-T ${BRTOOLDIR} -j ${JNUM} \
@@ -708,10 +703,27 @@ evaltoolchain ()
rm -f ${OBJDIR}/canrun
fi
- # step 2: if the user specified 32/64, try to establish if it will work
- if ${THIRTYTWO} && [ "${ccdefault}" -ne 32 ] ; then
- echo 'int main() {return 0;}' | ${CC} ${EXTRA_CFLAGS} -o /dev/null -x c - \
- ${EXTRA_RUMPUSER} ${EXTRA_RUMPCOMMON} > /dev/null 2>&1
- [ $? -eq 0 ] || ${ANYTARGETISGOOD} || \
- die 'Gave -32, but probe shows it will not work. Try -H?'
- elif ${SIXTYFOUR} && [ "${ccdefault}" -ne 64 ] ; then
- echo 'int main() {return 0;}' | ${CC} ${EXTRA_CFLAGS} -o /dev/null -x c - \
- ${EXTRA_RUMPUSER} ${EXTRA_RUMPCOMMON} > /dev/null 2>&1
- [ $? -eq 0 ] || ${ANYTARGETISGOOD} || \
- die 'Gave -64, but probe shows it will not work. Try -H?'
- else
- # not specified. use compiler default
- if [ "${ccdefault}" -eq 64 ]; then
- SIXTYFOUR=true
+ # check for crossbuild with tools running on host
+ : ${BUILD_CC:=}
+ [ ${BUILD_CC} ] && HYBRIDBUILD=true
+
+ if ${HYBRIDBUILD}; then
+ : ${TOOLS_CC:=${BUILD_CC}}
+ : ${TOOLS_AR:=${BUILD_AR}}
+ : ${TOOLS_NM:=${BUILD_NM}}
+ : ${TOOLS_OBJCOPY:=${BUILD_OBJCOPY}}
+ else
+ : ${TOOLS_CC:=${CC}}
+ : ${TOOLS_AR:=${AR}}
+ : ${TOOLS_NM:=${NM}}
+ : ${TOOLS_OBJCOPY:=${OBJCOPY}}
+ fi
+
+
# Check for variant of compiler.
# XXX: why can't all cc's that are gcc actually tell me
# that they're gcc with cc --version?!?
- ccver=$(${CC} --version)
+ ccver=$(${TOOLS_CC} --version)
if echo ${ccver} | grep -q 'Free Software Foundation'; then
CC_FLAVOR=gcc
elif echo ${ccver} | grep -q clang; then
@@ -721,33 +733,21 @@ evaltoolchain ()
CC_FLAVOR=pcc
PCC='-V HAVE_PCC=1'
else
- die Unsupported \${CC} "(`type ${CC}`)"
+ die Unsupported \${TOOLS_CC} "(`type ${TOOLS_CC}`)"
fi
- # Check the arch we're building for so as to work out the necessary
- # NetBSD machine code we need to use. First try -dumpmachine,
- # and if that works, be happy with it. Not all compilers support
- # it (e.g. older versions of clang), so if that doesn't work,
- # try parsing the output of -v
- if ! CC_TARGET=$(${CC} -dumpmachine 2>/dev/null) ; then
- # first check "${CC} -v" ... just in case it fails, we want a
- # sensible return value instead of it being lost in the pipeline
- # (this is easier than adjusting IFS)
- if ${CC} -v >/dev/null 2>&1 ; then
- # then actually process the output of ${CC} -v
- CC_TARGET=$(LC_ALL=C ${CC} -v 2>&1 \
- | sed -n 's/^Target: //p' )
- [ -z "${CC_TARGET}" ] \
- && die failed to probe target of \"${CC}\"
- else
- THIRTYTWO=true
- # this might be pcc
- ${CC} -v 2>&1 | grep pcc > /dev/null || \
- die \"${CC} -v failed\". Check \"${CC}\"
- CC_TARGET=$(${CC} -v 2>&1 \
- | sed -n -e 's/^pcc.*for //' -e 's/,.*//p' )
- fi
- fi
-
TOOLABI=''
case ${MACH_ARCH} in
"amd64"|"x86_64")
@@ -918,6 +910,8 @@ evaltarget ()
MACHINE="evbarm"
MACH_ARCH="arm"
TOOLABI="elf"
+ EXTRA_CFLAGS='-march=armv7-a'
+ EXTRA_AFLAGS='-march=armv7-a'
probearm
+ MACH_ARCH=$(echo ${CC_TARGET} | sed 's/.*-\(.*\)-.*/\1/' )
+ echo "MACH_ARCH cc ${MACH_ARCH}"
+
+
+ if [ "${MACH_ARCH}" = 'x86' ] ; then
+ CC_TARGET=genode-x86
+ MACH_ARCH=x86_64
+ elif [ "${MACH_ARCH}" = 'arm' ] ; then
+ CC_TARGET=genode-arm
+ else
+ die Unsupported architectur ${MACH_ARCH}
fi
- MACH_ARCH=$(echo ${CC_TARGET} | sed 's/-.*//' )
# Set names of tools we're going to use. try to guess them
# for common scenarios
@@ -767,6 +767,9 @@ evaltoolchain ()
done
case ${CC_TARGET} in
+ "genode")
+ RUMPKERN_UNDEF='-U__FreeBSD__'
+ ;;
*-linux*)
RUMPKERN_UNDEF='-Ulinux -U__linux -U__linux__ -U__gnu_linux__'
cppdefines _BIG_ENDIAN \
@@ -793,10 +796,10 @@ evaltoolchain ()
${TITANMODE} || die ELF required as target object format
fi
- if cppdefines __LP64__; then
- THIRTYTWO=false
- else
+ if ${TARGET_IS_32BIT}; then
THIRTYTWO=true
+ else
+ THIRTYTWO=false
fi
# The compiler cannot do %zd/u warnings if the NetBSD kernel
@@ -857,6 +860,9 @@ evalplatform ()
echo '>> Mach-O object format used by OS X is not yet supported'
target_supported=false
;;
"sparc")
+ genode-*)
+ TARGET=genode
+ ;;
*)
target_supported=false
;;
@@ -867,8 +873,8 @@ evalplatform ()
fi
# does target support __thread. if yes, optimize curlwp
- doesitbuild '__thread int lanka; int main(void) {return lanka;}\n'
- [ $? -eq 0 ] && RUMP_CURLWP=__thread
+# doesitbuild '__thread int lanka; int main(void) {return lanka;}\n'
+# [ $? -eq 0 ] && RUMP_CURLWP=__thread
}
# ARM targets require a few extra checks
@@ -880,8 +886,8 @@ probearm ()
MACHINE="evbearm-el"
MACH_ARCH="arm"
else
- MACHINE="evbearm-eb"
- MACH_ARCH="armeb"
+ MACHINE="evbearm"
+ MACH_ARCH="arm"
fi
TOOLABI="elf-eabi"
@@ -893,6 +899,11 @@ probearm ()
if cppdefines __VFP_FP__; then
MKSOFTFLOAT=no
fi
+
+ EXTRA_CFLAGS='-march=armv7-a'
+ EXTRA_AFLAGS='-march=armv7-a'
+ EXTRA_LDFLAGS='-nostdlib'
+ appendvar EXTRA_CWARNFLAGS -Wno-format
}
# aarch64 requires a few checks
@@ -962,6 +973,9 @@ evalmachine ()
MACHINE="i386"
MACH_ARCH="i486"
TOOLABI="elf"
+ appendvar EXTRA_CFLAGS -m32
+ appendvar EXTRA_LDFLAGS -m32
+ appendvar EXTRA_AFLAGS -m32
else
MACHINE="amd64"
MACH_ARCH="x86_64"
@@ -1044,13 +1058,17 @@ parseargs ()
debugginess=0
KERNONLY=false
NATIVENETBSD=false
+ TARGET_IS_32BIT=false
OBJDIR=./obj
DESTDIR=./rump
SRCDIR=./src
JNUM=4
- while getopts 'd:DhHj:kNo:qrs:T:V:F:' opt; do
+ while getopts '3:d:DhHj:kNo:qrs:T:V:F:' opt; do
case "$opt" in
+ 3)
+ TARGET_IS_32BIT=true
+ ;;
d)
DESTDIR=${OPTARG}
;;

View File

@ -1,13 +1,15 @@
diff --git a/src/sys/arch/arm/include/lock.h b/sys/arch/arm/include/lock.h
index c52a44f..3b4ba93 100644
diff --git a/sys/arch/arm/include/lock.h b/sys/arch/arm/include/lock.h
index ba612d5..8e0e2f3 100644
--- a/src/sys/arch/arm/include/lock.h
+++ b/src/sys/arch/arm/include/lock.h
@@ -119,8 +119,13 @@ __swp(__cpu_simple_lock_t __val, volatile __cpu_simple_lock_t *__ptr)
return __rv;
#else
@@ -105,8 +105,18 @@ static __inline unsigned char
__swp(unsigned char __val, __cpu_simple_lock_t *__ptr)
{
uint32_t __val32;
- __asm volatile("swpb %0, %1, [%2]"
- : "=&r" (__val32) : "r" (__val), "r" (__ptr) : "memory");
+#ifdef _ARM_ARCH_6
__asm volatile("swpb %0, %1, [%2]"
: "=&r" (__val32) : "r" (__val), "r" (__ptr) : "memory");
+#else
+ __asm volatile(" 1: \n"
+ " ldrexb %0, [%2] \n"
+ " strexb r0, %1, [%2]\n"
@ -15,6 +17,7 @@ index c52a44f..3b4ba93 100644
+ " bne 1b \n"
+ : "=&r" (__val32) : "r" (__val), "r" (__ptr)
+ : "memory", "r0");
+#endif
return __val32;
#endif
}
#else

View File

@ -1,8 +1,8 @@
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 57f4909..36235db 100644
diff --git a/src/share/mk/bsd.own.mk b/src/share/mk/bsd.own.mk
index 9bdc7c7..518440e 100644
--- a/src/share/mk/bsd.own.mk
+++ b/src/share/mk/bsd.own.mk
@@ -1045,7 +1045,7 @@ INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
@@ -1155,7 +1155,7 @@ INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
STRIPFLAG?=
.if ${NEED_OWN_INSTALL_TARGET} != "no"

View File

@ -1 +1 @@
7cc23ebea58569f4eaec723a42009428ab662918
d3121f30954b15d2da548e8361dbaf419e6124b5

View File

@ -2,26 +2,30 @@ LICENSE := BSD
VERSION := git
DOWNLOADS := rump.git nblibs.git
URL(rump) := https://github.com/anttikantee/buildrump.sh.git
REV(rump) := d604845baafa110945cb54a2d9607e6f435c6027
URL(rump) := https://github.com/rumpkernel/buildrump.sh.git
REV(rump) := fd4bdac4ad6357a36b9a0af6abde02bf3bb42232
DIR(rump) := src/lib/dde_rump
URL(nblibs) := https://github.com/rumpkernel/netbsd-userspace-src.git
REV(nblibs) := b86122315f338042d06ad83ac5bd763a5dbd0c00
URL(nblibs) := https://github.com/rumpkernel/src-netbsd.git
REV(nblibs) := b71ee7667ea9904c28b089feadc594a62f406bd5
DIR(nblibs) := src/lib/dde_rump/nblibs
PATCHES := $(shell find $(REP_DIR)/patches/*.patch)
PATCH_OPT := -N -d ${DIR(rump)} -p1
GIT_NETBSD_COMMIT := ff70642c9d7a8fb4b3242b30de2efc1fd8ad9ad4
GIT_NETBSD_COMMIT := 0875d49ae93a8101d5321b7a73983daee5c1b581
NETBSD_SRC := src/lib/dde_rump/src
# checkout NetBSD sources
default: checkout_src
checkout_src: $(DOWNLOADS)
@$(MSG_PREFIX)"checkout NetBSD src "
$(VERBOSE)if [ -d "$(NETBSD_SRC)/.git" ]; then cd $(NETBSD_SRC) && git checkout -f; fi
$(VERBOSE)src/lib/dde_rump/checkout.sh git src/lib/dde_rump/src
$(VERBOSE)cd src/lib/dde_rump/src && git reset --hard $(GIT_NETBSD_COMMIT)
$(VERBOSE)ln -s ../src/common src/lib/dde_rump/nblibs/common
$(VERBOSE)cd $(NETBSD_SRC) && git reset --hard $(GIT_NETBSD_COMMIT)
$(VERBOSE)ln -sf ../src/common src/lib/dde_rump/nblibs/common
DIRS := include/rump
DIR_CONTENT(include/rump) := src/lib/dde_rump/src/sys/rump/include/rump/*.h

View File

@ -1,8 +1,8 @@
#
# Check used commands
#
set mkfs.vfat [check_installed mkfs.vfat]
set dd [check_installed dd]
set mkfs [check_installed mkfs.vfat]
set dd [check_installed dd]
#
# Build
@ -21,7 +21,7 @@ build $build_components
# Build FAT-file-system image
#
catch { exec $dd if=/dev/zero of=bin/fs.raw bs=1M count=16 }
catch { exec $mkfs.vfat -F16 bin/fs.raw }
catch { exec $mkfs -F16 bin/fs.raw }
create_boot_directory
@ -88,7 +88,7 @@ set boot_modules {
build_boot_image $boot_modules
append qemu_args " -m 256 -nographic"
append qemu_args " -m 256 -nographic "
run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60

View File

@ -46,7 +46,6 @@ DUMMY(-1, rumpuser_sp_copyoutstr)
DUMMY(-1, rumpuser_sp_fini)
DUMMY(-1, rumpuser_sp_init)
DUMMY(-1, rumpuser_sp_raise)
DUMMY(-1, rumpuser_thread_exit)
DUMMY(-1, rumpuser_thread_join)
DUMMY(-1, rumpuser_unmap)
} /* extern "C" */

View File

@ -113,6 +113,13 @@ int rumpuser_thread_create(func f, void *arg, const char *name,
return 0;
}
void rumpuser_thread_exit()
{
Genode::sleep_forever();
}
int errno;
void rumpuser_seterrno(int e) { errno = e; }

View File

@ -262,14 +262,16 @@ static Backend *backend()
if (_b)
return _b;
int nlocks;
rumpkern_unsched(&nlocks, 0);
try {
int nlocks;
rumpkern_unsched(&nlocks, 0);
_b = new(Genode::env()->heap())Backend();
rumpkern_sched(nlocks, 0);
} catch (Genode::Parent::Service_denied) {
PERR("Opening block session denied!");
}
rumpkern_sched(nlocks, 0);
return _b;
}

View File

@ -38,8 +38,7 @@ namespace File_system {
static char const *fs_types[] = { RUMP_MOUNT_CD9660, RUMP_MOUNT_EXT2FS,
RUMP_MOUNT_FFS, RUMP_MOUNT_MSDOS,
RUMP_MOUNT_NFS, RUMP_MOUNT_NTFS,
RUMP_MOUNT_SMBFS, RUMP_MOUNT_UDF, 0 };
RUMP_MOUNT_NTFS, RUMP_MOUNT_UDF, 0 };
static char _fs_type[10];
static bool _supports_symlinks;

View File

@ -197,7 +197,7 @@ class File_system::Session_component : public Session_rpc_object
Symlink_handle symlink(Dir_handle dir_handle, Name const &name, bool create)
{
if (!File_system::supports_symlinks())
return Symlink_handle();
throw Permission_denied();
if (!valid_name(name.string()))
throw Invalid_name();