openzfsonosx / zfs

OpenZFS on OS X
https://openzfsonosx.org/
Other
824 stars 72 forks source link

Building ZFS from sources : missing depmpfs sources #758

Open captain-haddock17 opened 4 years ago

captain-haddock17 commented 4 years ago

Dear ZFS developers !

Id like to compile ZFS from sources, by following instructions in Installing from sourc.

Launching ./zfsadmin.sh for configuration and compilation, I got somme errors on: bin/sh ../../../libtool --tag=CC --silent --mode=link clang -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -g -Os -Wno-tautological-constant-out-of-range-compare -lstdc++ -o kextsymboltool kextsymboltool.o ./kextsymboltool -arch x86_64 -import allsymbols -export zfs.exports -output KernelExports_64

exported name not in import list: _decmpfs_cnode_alloc exported name not in import list: _decmpfs_cnode_free make[4]: *** [KernelExports] Error 1

lundman commented 4 years ago

Old OsX? If so, delete them from spl/module/spkl/KernelExports/zfs.exports

captain-haddock17 commented 4 years ago

I found out that decmpfs source code is part of Apple's Opensource kernel.

I'm not quite comfortable with autogen and automate& al.

so as to declare these kernel source code. Sorry, William

lundman commented 4 years ago

Hmm did they change something.. check

# grep decmpfs spl/module/spl/KernelExports/allsymbols

captain-haddock17 commented 4 years ago

$ grep decmpfs -n spl/module/spl/KernelExports/allsymbols

7288:_decmpfs_cnode_destroy 7289:_decmpfs_cnode_get_vnode_cached_size 7290:_decmpfs_cnode_get_vnode_state 7291:_decmpfs_cnode_init 7292:_decmpfs_cnode_set_vnode_state 7293:_decmpfs_ctx 7294:_decmpfs_decompress_file 7295:_decmpfs_file_is_compressed 7296:_decmpfs_free_compressed_data 7297:_decmpfs_hides_rsrc 7298:_decmpfs_hides_xattr 7299:_decmpfs_init 7300:_decmpfs_lock_compressed_data 7301:_decmpfs_pagein_compressed 7302:_decmpfs_read_compressed 7303:_decmpfs_trylock_compressed_data 7304:_decmpfs_unlock_compressed_data 7305:_decmpfs_update_attributes 7306:_decmpfs_validate_compressed_file 8586:_hfs_lazy_init_decmpfs_cnode 13842:_register_decmpfs_decompressor 16759:_unregister_decmpfs_decompressor

lundman commented 4 years ago

So they did, updating my mojave now and let's see if I get the same issue

lundman commented 4 years ago

Hmm no it appears normal, did you update xcode and it's component ? decmpfs_cnode_alloc doesn't exist in 10.13 and earlier, but still in latest Catalina

lundman commented 4 years ago
bash-3.2# uname -a
Darwin o3xtest.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/DEVELOPMENT_X86_64 x86_64

bash-3.2# sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G103

bash-3.2# nm -gj /System/Library/Kernels/kernel|grep decmpfs
_decmpfs_cnode_alloc
captain-haddock17 commented 4 years ago

mine is: $ uname -a

Darwin macpro.home 18.7.0 Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64

$ sw_vers

ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G4032

$ nm -gj /System/Library/Kernels/kernel|grep decmpfs

_decmpfs_cnode_alloc _decmpfs_cnode_cmp_type _decmpfs_cnode_destroy _decmpfs_cnode_free _decmpfs_cnode_get_vnode_cached_size _decmpfs_cnode_get_vnode_state _decmpfs_cnode_init _decmpfs_cnode_set_vnode_state _decmpfs_ctx _decmpfs_decompress_file _decmpfs_file_is_compressed _decmpfs_free_compressed_data _decmpfs_hides_rsrc _decmpfs_hides_xattr _decmpfs_init _decmpfs_lock_compressed_data _decmpfs_pagein_compressed _decmpfs_read_compressed _decmpfs_trylock_compressed_data _decmpfs_unlock_compressed_data _decmpfs_update_attributes _decmpfs_validate_compressed_file _register_decmpfs_decompressor _unregister_decmpfs_decompressor

captain-haddock17 commented 4 years ago

As I understand,

_decmpfs_cnode_alloc _decmpfs_cnode_free

are already present on my system. but not found at link time.

lundman commented 4 years ago

Good, it's in there. Something else must be going on with the build.

Yes, zfs.exports ask for them, the we produce all symbols in to allsymbols, then when spl links, it links against them. ZFS will complain they dont exist, but carry on.

captain-haddock17 commented 4 years ago

Hi Jörgen, I can't carry on with this for now. Could you please give me a corrected build script ? Thanks a lot, William

lundman commented 4 years ago

Can you start again with sources? I have re-compiled everything on Mojave to make sure it works. You have shown that your kernel does have the decmpfs_cnode_alloc function.