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

changes to port part of ceph to osx (part 0 of some) #17615

Merged
merged 29 commits into from Sep 16, 2017

Conversation

Projects
None yet
2 participants
@tchaikov
Copy link
Contributor

commented Sep 9, 2017

based on @ukernel 's work

i will try to update the ceph-fuse to enable it to work on osx again.

@tchaikov tchaikov requested review from gregsfortytwo, ukernel and wjwithagen Sep 9, 2017

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch 4 times, most recently from d5a4d19 to 100af12 Sep 9, 2017

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 9, 2017

@tchaikov
ENODATA != ENOATTR is probably going to raise its nasty head here as well.
But I do not have an MAC to check it.

@tchaikov

This comment has been minimized.

Copy link
Contributor Author

commented Sep 10, 2017

@wjwithagen
it's been taken care of by 5db6915

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch from 15bdedd to d43ec01 Sep 10, 2017

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2017

@tchaikov
Are you sure that the ENODATA that is used there is not the ENODATA from the boost lib?
Which would be the case unless APPLE also defines FreeBSD.
Otherwise the ENODATA in compat.h needs to be seperated out and also enabled for APPLE.

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch 4 times, most recently from f8e62eb to 79918a3 Sep 10, 2017

@tchaikov

This comment has been minimized.

Copy link
Contributor Author

commented Sep 10, 2017

@wjwithagen fixed and repushed.

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

@tchaikov
I'll run it trhu my jenkins-master.

@tchaikov tchaikov changed the title changes to port part of ceph to osx (0 of some) changes to port part of ceph to osx (port 0 of some) Sep 11, 2017

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

@tchaikov
Jenkins complains at:
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/1209/console
But I currently have to attend otehr business.
Perhaps I can check what is wrong tonight.

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

@tchaikov
Log output is full with

/home/jenkins/workspace/ceph-master/src/test/encoding/readable.sh: line 105: 47207 Segmentation fault      (core dumped) $CEPH_DENCODER type $type import $vdir/objects/$type/$f decode dump_json > $tmp1

Perhaps I should revert some of the changes to the dencoder-code?

@tchaikov

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2017

@wjwithagen i suspect it's c47d4e7, will take a closer look at it this weekend. thanks for reviewing/testing this PR!

@tchaikov tchaikov added the DNM label Sep 12, 2017

@tchaikov tchaikov self-assigned this Sep 12, 2017

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

@tchaikov
I'll try and revert it, and see if it passes.
Will let you know

@wjwithagen

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

@tchaikov
Removing the patch to msg_types.h fixes build and testing.

tchaikov added some commits Sep 9, 2017

common/util: port collect_sys_info() to osx
Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: do not link against librt on osx
as osx does not offer librt

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: remove unnecessary linkage of librt
Signed-off-by: Kefu Chai <kchai@redhat.com>
time: use mach_absolute_time() for monotonic time
* use mach_absolute_time() for monotonic time
  mach_absolute_time() is faster and monotonic, see
  https://developer.apple.com/library/content/qa/qa1398/_index.html

  for its implementation, see
  https://opensource.apple.com/source/xnu/xnu-3248.60.10/libsyscall/wrappers/mach_absolute_time.s

  it's using rdtsc.
* and remove unnecessary headers from ceph_time.h

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: link against libresolv on OSX
Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: compile Mach-O format instead of ELF on OSX
Signed-off-by: Kefu Chai <kchai@redhat.com>
crc32c: only add qualifiers for elf64 format
they are not understood by non-elf formats

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: do not pass --exclude-libs on osx
it is not supported by osx linker

Signed-off-by: Kefu Chai <kchai@redhat.com>
msg/msg_types: consolidate sockaddr_storage dencoders
utilize ceph_sockaddr_storage on FreeBSD and osx to perform the
dencoding, to improve the readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
msg/msg_types: fix the denc of sockaddr_storage on freebsd/osx
the layout of sockaddr_in and sockaddr_in6 are different on
GNU/Linux and FreeBSD/OSX:
 - on GNU/Linux, sockaddr does not have sa_len,
 - on GNU/Linux, sockaddr* use a 16 bit integer for sa_family, but
   on FreeBSD, a 32bit integer is used.
so we need to be more care when memcpy() between sockaddr_storage()
and ceph_sockaddr_storage().

Signed-off-by: Kefu Chai <kchai@redhat.com>
compat: consolidate definitions of osx and freebsd
on osx, ENODATA = 96, so we need to fix it. also define
CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE for osx, ceph_time.h
defines this also, but i don't want to include compat.h in ceph_time.h
at this moment.

and silence the warning of
 #warning ENODATA already defined to a value different from 87 (ENOATRR), refining to fix
because it is fired everywhere on osx when "compat.h" is included.

Signed-off-by: Kefu Chai <kchai@redhat.com>
crc32: label assembler functions without leading underscore
clang onder osx adds leading undescore to the function names to be
ABI compatible. but the assembly code does not do so. so we need to
control the name using gcc/clang extension. see
https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Asm-Labels.html#Asm-Labels

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: disable plugins using isa-l on osx
clang on osx emits functions with leading underscore, but the isa-l
assembly's functions have no leading underscore. we could label the
function declaration like `int foo asm("foo")` to remove the leading
underscore, but isa-l is a git submodule, let do this later. and in the
meanwhile, disable this plugin on osx.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: allows undefined symbol in plugin on osx
clang on osx erros out when linking a dynamic library if any symbols is
missing by default. so disable this behavior.

Signed-off-by: Kefu Chai <kchai@redhat.com>
mds: use the best-effort if procfs is not available
Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake: check for fdatasync() on non osx
on osx, fdatasync() is a syscall without userspace wrapper.

Signed-off-by: Kefu Chai <kchai@redhat.com>
test/encoding/readable.sh: use sysctl -n hw.ncpu instead of nproc on …
…osx also

Signed-off-by: Kefu Chai <kchai@redhat.com>

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch from 807eada to 5c1158e Sep 16, 2017

tchaikov added some commits Sep 13, 2017

crc32c: mach-o 64 follows the same calling convention as elf64 does
so reuse the register-parameter/variable mappings

Signed-off-by: Kefu Chai <kchai@redhat.com>
crc32c: pass integer param by uint64_t
the assembly is expecting 64bits input, so make this explicit.

Signed-off-by: Kefu Chai <kchai@redhat.com>

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch from 5c1158e to 804eb5f Sep 16, 2017

@tchaikov tchaikov changed the title changes to port part of ceph to osx (port 0 of some) changes to port part of ceph to osx (part 0 of some) Sep 16, 2017

tchaikov added some commits Sep 13, 2017

msg/msg_types: fix the dencoder of entity_addr_t
improve the interoperability between freebsd/osx and GNU/Linux, because
the their layouts of sockaddr_storage are different, and we use the
one of linux as the wire format. so need to convert it on freebsd/osx
side.

Signed-off-by: Kefu Chai <kchai@redhat.com>
client: use st_mtimespec instea of st_mtime on osx
Signed-off-by: Kefu Chai <kchai@redhat.com>

@tchaikov tchaikov force-pushed the tchaikov:wip-osx branch from 804eb5f to 8f1318e Sep 16, 2017

@tchaikov tchaikov merged commit 9d07597 into ceph:master Sep 16, 2017

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@tchaikov tchaikov deleted the tchaikov:wip-osx branch Sep 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.