[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/vfscore: Populate exportsyms.uk



Hey Felipe,

I just send another patch for newlib to make it work again:
https://patchwork.unikraft.org/patch/736001/

Can you try the change with this one together? I think both patches need to go in at the same time if accepted.

Thanks,

Simon

On 18.09.19 13:51, Felipe Huici wrote:
Hi Simon,

When building this against newlib I get a number of linker errors:

   CC      libuknetdev: netdev.o
   LD      libuknetdev.ld.o
   OBJCOPY libuknetdev.o
   LD      helloworld_kvm-x86_64.ld.o
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libvfscore.o: 
In function `fchown':
/root/workspace/gitlab/unikraft/upstreaming/unikraft/lib/vfscore/main.c:1963: 
multiple definition of `fchown'
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libnewlibglue.o:/root/workspace/gitlab/unikraft/upstreaming/libs/newlib/file.c:100:
 first defined here
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libvfscore.o: 
In function `lchown':
/root/workspace/gitlab/unikraft/upstreaming/unikraft/lib/vfscore/main.c:1976: 
multiple definition of `lchown'
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libnewlibglue.o:/root/workspace/gitlab/unikraft/upstreaming/libs/newlib/file.c:106:
 first defined here
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libvfscore.o: 
In function `rename':
/root/workspace/gitlab/unikraft/upstreaming/unikraft/lib/vfscore/main.c:909: 
multiple definition of `rename'
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libnewlibc.o:/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libnewlibc/origin/newlib-2.5.0.20170922/newlib/libc/stdio/rename.c:66:
 first defined here
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libvfscore.o: 
In function `umask':
/root/workspace/gitlab/unikraft/upstreaming/unikraft/lib/vfscore/main.c:2063: 
multiple definition of `umask'
/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/libnewlibglue.o:/root/workspace/gitlab/unikraft/upstreaming/libs/newlib/file.c:58:
 first defined here
collect2: error: ld returned 1 exit status
/root/workspace/gitlab/unikraft/upstreaming/unikraft/plat/kvm/Linker.uk:21: 
recipe for target 
'/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/helloworld_kvm-x86_64.dbg'
 failed
make[1]: *** 
[/root/workspace/gitlab/unikraft/upstreaming/apps/helloworld/build/helloworld_kvm-x86_64.dbg]
 Error 1
make[1]: Leaving directory 
'/root/workspace/gitlab/unikraft/upstreaming/unikraft'
Makefile:21: recipe for target 'all' failed
make: *** [all] Error 2

fchown, lchown, and umask are stubs in the newlib glue code, so it'd fine to 
just remove them.

rename is an actual implementation, but since vfscore now provides and exposes 
one, you can just remove newlib's rename.c from Makefile.uk .

If you agree and submit these fixes to newlib I can then upstream this vfscore 
patch.

-- Felipe

Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>

On 18.09.19, 12:18, "Simon Kuenzer" <simon.kuenzer@xxxxxxxxx> wrote:

     In order to avoid surprising linking errors, we further populate the
     `exportsyms.uk` file with symbols that are being expected to be publicly
     provided by vfscore.
     Duplicates of entries are removed with this commit, too (e.g., read, write)
Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
     ---
      lib/vfscore/exportsyms.uk | 38 +++++++++++++++++++++++++++++++++-----
      1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
     index e2627c03..46156098 100644
     --- a/lib/vfscore/exportsyms.uk
     +++ b/lib/vfscore/exportsyms.uk
     @@ -3,9 +3,6 @@ vfscore_put_fd
      vfscore_install_fd
      vfscore_get_file
      vfscore_put_file
     -close
     -write
     -read
      mount
      vfscore_nullop
      vfscore_release_mp_dentries
     @@ -24,15 +21,17 @@ mkdir
      fsync
      fstat
      flock
     -lseek
     +fhold
     +fdrop
     +fget
      ftruncate
      stat
      chmod
      fchmod
     +fchown
      dup
      dup2
      dup3
     -vfscore_uiomove
      sync
      vfscore_mount_dump
      umount
     @@ -41,13 +40,16 @@ link
      unlink
      getcwd
      chown
     +chroot
      chdir
      fstatat
      statfs
      lstat
     +lchown
      openat
      opendir
      readdir
     +readdir64
      closedir
      pread
      pwrite
     @@ -75,9 +77,35 @@ readlink
      fallocate
      lseek
      uk_syscall_writev
     +umask
      dentry_alloc
     +dentry_init
     +dentry_lookup
     +dentry_move
     +dentry_remove
      drele
      vrele
     +vput
     +vref
     +vflush
     +dref
      fcntl
      readdir_r
     +readdir64_r
      fstatfs
     +eaccess
     +euidaccess
     +rename
     +__xmknod
     +__xstat
     +__lxstat
     +vn_access
     +vn_add_name
     +vn_del_name
     +vn_lock
     +vn_lookup
     +vn_setmode
     +vn_settimes
     +vn_stat
     +vn_unlock
     +vfs_busy
     --
     2.20.1

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.