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

build on fedora26 #3

Open
justinc1 opened this issue Apr 6, 2018 · 5 comments
Open

build on fedora26 #3

justinc1 opened this issue Apr 6, 2018 · 5 comments

Comments

@justinc1
Copy link

justinc1 commented Apr 6, 2018

Attempt to install on FS26:

make -f /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/linux/tools/build/Makefile.build dir=. obj=lklfuse
  gcc -Wp,-MD,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/.lklfuse.o.d -Wp,-MT,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o -I/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include -Iinclude -Wall -g -O2 -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-unused-parameter -U_FORTIFY_SOURCE -fno-stack-protector -fPIC -pthread -DCONFIG_AUTO_LKL_POSIX_HOST -D"BUILD_STR(s)=#s" -D_FILE_OFFSET_BITS=64 -c -o /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o lklfuse.c
lklfuse.c:11:10: fatal error: fuse.h: No such file or directory
 #include <fuse.h>
sudo dnf provides */fuse.h
...

justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun$ sudo dnf install kernel-headers
Last metadata expiration check: 0:04:03 ago on Fri 06 Apr 2018 07:28:23 PM CEST.
Package kernel-headers-4.15.4-300.fc27.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun$ ll /usr/include/linux/fuse.h
-rw-r--r--. 1 root root 17370 Feb 20 00:46 /usr/include/linux/fuse.h

Hm?

@justinc1
Copy link
Author

justinc1 commented Apr 6, 2018

cp ./linux/include/uapi/linux/fuse.h /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/

Then I get

  REPLACE	/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/lkl/linux/types.h
make -f /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/linux/tools/build/Makefile.build dir=. obj=lklfuse
  gcc -Wp,-MD,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/.lklfuse.o.d -Wp,-MT,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o -I/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include -Iinclude -Wall -g -O2 -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-unused-parameter -U_FORTIFY_SOURCE -fno-stack-protector -fPIC -pthread -DCONFIG_AUTO_LKL_POSIX_HOST -D"BUILD_STR(s)=#s" -D_FILE_OFFSET_BITS=64 -c -o /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o lklfuse.c
lklfuse.c:12:10: fatal error: fuse/fuse_opt.h: No such file or directory
 #include <fuse/fuse_opt.h>

find ./ -iname fuse_opt.h does not help now.

sudo dnf provides */fuse_opt.h
sudo dnf install fuse-devel
mkdir include/fuse
cp /usr/include/fuse/fuse_opt.h include/fuse/

But I have felling maybe I should use different distro? Ubuntu? Anyway, I will try to continue.

Now I get:

  REPLACE	/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/lkl/linux/types.h
make -f /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/linux/tools/build/Makefile.build dir=. obj=lklfuse
  gcc -Wp,-MD,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/.lklfuse.o.d -Wp,-MT,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o -I/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include -Iinclude -Wall -g -O2 -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-unused-parameter -U_FORTIFY_SOURCE -fno-stack-protector -fPIC -pthread -DCONFIG_AUTO_LKL_POSIX_HOST -D"BUILD_STR(s)=#s" -D_FILE_OFFSET_BITS=64 -c -o /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o lklfuse.c
lklfuse.c: In function ‘lklfuse_opt_proc’:
lklfuse.c:91:3: warning: implicit declaration of function ‘fuse_main’; did you mean ‘fuse_mount’? [-Wimplicit-function-declaration]
   fuse_main(args->argc, args->argv, NULL, NULL);
   ^~~~~~~~~
   fuse_mount
lklfuse.c: At top level:
lklfuse.c:397:57: error: unknown type name ‘fuse_fill_dir_t’; did you mean ‘fuse_ino_t’?
 static int lklfuse_readdir(const char *path, void *buf, fuse_fill_dir_t fill,
                                                         ^~~~~~~~~~~~~~~
                                                         fuse_ino_t
lklfuse.c:461:14: error: variable ‘lklfuse_ops’ has initializer but incomplete type
 const struct fuse_operations lklfuse_ops = {

Maybe I should used fuse3-devel? But that is file /usr/include/fuse3/fuse_opt.h, partial path is even not fuse/fuse_opt.h. fuse_operations seems to be in /usr/include/fuse/fuse.h from libfuse2-devel, but not in ./linux/include/uapi/linux/fuse.h, or in any .h file from sources.

cp /usr/include/fuse/* /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/

I compiles lklfuse.o now, and fails about 50 lines later with:

make: *** No rule to make target 'cptofs', needed by '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/cpfromfs'.  Stop.

I will try clean build on clean ubuntu 16.04 VM next.

@justinc1
Copy link
Author

justinc1 commented Apr 6, 2018

Same on ubuntu. Hm...

  REPLACE	/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/lkl/linux/poll.h
  REPLACE	/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include/lkl/linux/byteorder.h
make -f /home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/linux/tools/build/Makefile.build dir=. obj=lklfuse
  gcc -Wp,-MD,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/.lklfuse.o.d -Wp,-MT,/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o -I/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl//include -Iinclude -Wall -g -O2 -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-unused-parameter -U_FORTIFY_SOURCE -fno-stack-protector -fPIC -pthread -DCONFIG_AUTO_LKL_POSIX_HOST -D"BUILD_STR(s)=#s" -D_FILE_OFFSET_BITS=64 -c -o /home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o lklfuse.c
lklfuse.c:11:18: fatal error: fuse.h: No such file or directory
compilation terminated.
/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/linux/tools/build/Makefile.build:91: recipe for target '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o' failed
make[1]: *** [/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse.o] Error 1
Makefile:166: recipe for target '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse-in.o' failed
make: *** [/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/lklfuse-in.o] Error 2
xlab@or-libos:/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604$ 

Code is:

xlab@or-libos:/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604$ git submodule status
 238ed1fe120b1a71898a9d412f67376c9f01cb30 buildrump.sh (v20140526-488-g238ed1f)
 dc0ad89a032fb5764c315bdca931f52a370d0447 linux (v4.3-102158-gdc0ad89)
 8cba3827fa430fea92580a0281fe117f92d5f27d musl (heads/master-23-g8cba382)
 f08dfa4d19f4408a35c34581f126a7c2e009063c src-netbsd (f08dfa4)
xlab@or-libos:/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604$ git status
On branch jc-lkl-musl
Your branch is up-to-date with 'jc-origin/jc-lkl-musl'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	obj-amd64-hw-jc-lkl-musl/

nothing added to commit but untracked files present (use "git add" to track)
xlab@or-libos:/home/justin_cinkelj/devel/oor/libos-nuse/rumprun-ub1604$ 

Anything wrong with my submodules?

@justinc1 justinc1 changed the title build of fedora26 build on fedora26 Apr 6, 2018
@justinc1
Copy link
Author

justinc1 commented Apr 9, 2018

I returned to compile on FC26. If I remember correctly, I now have a copy of fuse2-devel header files. Last error was

justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun$ ./build-rr.sh -r linux hw
make: *** No rule to make target 'cptofs', needed by '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/cpfromfs'.  Stop.

While file cptofs was already built :/

I tried to compile submodule ./linux by hand:

justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun/linux$ make -C tools/lkl
 fs2tar.c:14:10: fatal error: archive.h: No such file or directory
sudo dnf install libarchive-devel
# ./linux is built now

justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun$ ./build-rr.sh -r linux hw
  /home/justin_cinkelj/devel/oor/libos-nuse/rumprun/linux is not clean, please run 'make mrproper'
# :) rumprun doesn't like my help
(cd ./linux && make mrproper)

justin_cinkelj@jcpc:~/devel/oor/libos-nuse/rumprun$ ./build-rr.sh -r linux hw
install: will not overwrite just-created '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/dest.stage//lib/liblkl-hijack.so' with '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/obj-amd64-hw-jc-lkl-musl/buildrump.sh/linux//tools/lkl/liblkl-hijack.so'
make: *** [Makefile:220: libraries_install] Error 1
make: Leaving directory '/home/justin_cinkelj/devel/oor/libos-nuse/rumprun/linux/tools/lkl'

I just changed the linux/tools/lkl/Makefile - added || true at end of line 220. Now I have rumprun-jc-lkl-musl/bin/rumprun-bake and friends. If small .c test will be able to fopen /proc/modules, then I guess that is actually LKL unikernel.

@thehajime
Copy link
Member

LKL bundled applications (lklfuse, fs2tar, cptofs, etc) are not meant to build with rumprun and frankenlibc right now. If there is a use case it would be good to support.

If those are complied during build-rr.sh, then it's not intentional and should be skipped by anyway.

If small .c test will be able to fopen /proc/modules, then I guess that is actually LKL unikernel.

yep.

@justinc1
Copy link
Author

The lklfuse and cptofs were build by default. I don't need them, currently I'm interested into networking functionality only. So no need to support them from my side.

I got new problem when trying to compile hello-world app.

x86_64-rumprun-linux-gcc -o test test.c
rumprun-bake hw_virtio test.bin test

!!!
!!! NOTE: rumprun-bake is experimental. syntax may change in the future
!!!

/usr/bin/ld: cannot find -lrumpvfs
/usr/bin/ld: cannot find -lrumpkern_bmktc
/usr/bin/ld: cannot find -lrumpkern_mman
/usr/bin/ld: cannot find -lrumpdev
/usr/bin/ld: cannot find -lrumpfs_tmpfs
/usr/bin/ld: cannot find -lrumpnet_config
/usr/bin/ld: cannot find -lrumpnet
/usr/bin/ld: cannot find -lrumpdev_bpf
/usr/bin/ld: cannot find -lrumpdev_vnd
/usr/bin/ld: cannot find -lrumpdev_rnd
/usr/bin/ld: cannot find -lrumprunfs_base
/usr/bin/ld: cannot find -lrumpnet_netinet
/usr/bin/ld: cannot find -lrumpnet_net
/usr/bin/ld: cannot find -lrumpnet_netinet6
/usr/bin/ld: cannot find -lrumpnet_local
/usr/bin/ld: cannot find -lrumpfs_ffs
/usr/bin/ld: cannot find -lrumpfs_cd9660
/usr/bin/ld: cannot find -lrumpfs_ext2fs
/usr/bin/ld: cannot find -lrumpdev_disk
/usr/bin/ld: cannot find -lrumpkern_sysproxy
/usr/bin/ld: cannot find -lrumpdev_virtio_if_vioif
/usr/bin/ld: cannot find -lrumpdev_virtio_ld
/usr/bin/ld: cannot find -lrumpdev_virtio_viornd
/usr/bin/ld: cannot find -lrumpdev_pci_virtio
/usr/bin/ld: cannot find -lrumpdev_pci
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: test.bin] Error 1

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

2 participants