Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build memcached and hello #10

Open
peterzheng98 opened this issue Aug 2, 2021 · 5 comments
Open

Unable to build memcached and hello #10

peterzheng98 opened this issue Aug 2, 2021 · 5 comments

Comments

@peterzheng98
Copy link

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
@lsf37
Copy link
Member

lsf37 commented Aug 2, 2021

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)

@peterzheng98
Copy link
Author

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'

@peterzheng98
Copy link
Author

Does that means some modification on the Makefile of memcached is required?

@lsf37
Copy link
Member

lsf37 commented Aug 2, 2021

You could try removing -Werror, but I'm not actually sure where. @kent-mcleod can you help with that one?

@kent-mcleod
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants