Unable to build memcached and hello
peterzheng98 opened this issue · 5 comments
OS: 20.04.1-Ubuntu
Errors:
******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/fs/lib/libefs/../../../../fs/efs/efs_subr.c: In function 'efs_sb_checksum':
******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/fs/lib/libefs/../../../../fs/efs/efs_subr.c:66:2: error: converting a packed 'struct efs_sb' pointer (alignment 1) to a '__uint16_t' {aka 'short unsigned int'} pointer (alignment 2) may result in an unaligned pointer value [-Werror=address-of-packed-member]
66 | uint16_t *sbarray = (uint16_t *)esb;
| ^~~~~~~~
In file included from ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/fs/lib/libefs/../../../../fs/efs/efs_subr.c:36:
******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/fs/lib/libefs/../../../../fs/efs/efs_sb.h:37:8: note: defined here
37 | struct efs_sb {
| ^~~~~~
dependall ===> ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/dev/lib/libdm
dependall ===> ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/librump/rumpnet
dependall ===> ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/dev/lib/libdrvctl
dependall ===> ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/librump/rumpvfs
dependall ===> ******/rumprun-sel4-demoapps/projects/rumprun/src-netbsd/sys/rump/dev/lib/libfss
cc1: all warnings being treated as errors
Steps to errors:
../init-build.sh -DPLATFORM=x86_64 -DSIMULATION=TRUE -DAPP=memcached
ninja
Another error is
../init-build.sh -DPLATFORM=x86_64 -DSIMULATION=TRUE -DAPP=hello
ninja
It looks like the compiler is different to the expected tool chain. Have you tried building from the docker container? (trustworthysystems/camkes:latest
should work, from https://github.com/seL4/seL4-CAmkES-L4v-dockerfiles)
That's it, but when building memcached, some errors occured.
memcached.c: In function ‘process_stats_conns.constprop’:
memcached.c:2886:26: error: ‘%u’ directive writing between 1 and 5 bytes into a region of size between 1 and 1027 [-Werror=format-overflow=]
sprintf(buf, "%s:%s:%u", protoname, addr_text, port);
^~~~~~~~~~
memcached.c:2886:26: note: directive argument in the range [1, 65535]
memcached.c:2886:13: note: ‘sprintf’ output between 5 and 1035 bytes into a destination of size 1030
sprintf(buf, "%s:%s:%u", protoname, addr_text, port);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:634: memcached-memcached.o] Error 1
make[3]: Leaving directory '******/rumprun-sel4-demoapps/projects/rumprun-packages/memcached/build'
Does that means some modification on the Makefile of memcached is required?
You could try removing -Werror
, but I'm not actually sure where. @kent-mcleod can you help with that one?
That's going to be a bit harder to solve. These examples are all getting to be > 3 years old now and so to rebuild them you'll need to use compiler versions from back then. In this case, memcached in rumprun_packages is using version 1.4.28 which uses -Werror (https://github.com/memcached/memcached/blob/1.4.28/configure.ac#L597). Newer compiler versions introduce new warnings which get promoted to errors. You would need to either change the compiler to one around gcc-7 or so, or update the rumprun-packages Makefile to use a newer version (https://github.com/seL4/rumprun-packages/blob/master/memcached/Makefile#L3) which will likely be compatible with modern compiler warnings.