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

0.19: use of undeclared identifier 'POSIX_MADV_NORMAL' #697

Closed
kwek20 opened this issue Oct 13, 2022 · 4 comments · Fixed by #726
Closed

0.19: use of undeclared identifier 'POSIX_MADV_NORMAL' #697

kwek20 opened this issue Oct 13, 2022 · 4 comments · Fixed by #726

Comments

@kwek20
Copy link
Contributor

kwek20 commented Oct 13, 2022

Hi!

I am cross compiling rocksdb from WSL to android, which worked in 0.18. (cargo build --target aarch64-linux-android --release)
However when i compile on 0.19 i get the following error:

warning: rocksdb/env/io_posix.cc:1001:41: error: use of undeclared identifier 'POSIX_MADV_NORMAL'
warning:       Madvise(mmapped_region_, length_, POSIX_MADV_NORMAL);
warning:                                         ^
warning: rocksdb/env/io_posix.cc:1004:41: error: use of undeclared identifier 'POSIX_MADV_RANDOM'
warning:       Madvise(mmapped_region_, length_, POSIX_MADV_RANDOM);
warning:                                         ^
warning: rocksdb/env/io_posix.cc:1007:41: error: use of undeclared identifier 'POSIX_MADV_SEQUENTIAL'
warning:       Madvise(mmapped_region_, length_, POSIX_MADV_SEQUENTIAL);
warning:                                         ^
warning: rocksdb/env/io_posix.cc:1010:41: error: use of undeclared identifier 'POSIX_MADV_WILLNEED'
warning:       Madvise(mmapped_region_, length_, POSIX_MADV_WILLNEED);
warning:                                         ^
warning: rocksdb/env/io_posix.cc:1013:41: error: use of undeclared identifier 'POSIX_MADV_DONTNEED'
warning:       Madvise(mmapped_region_, length_, POSIX_MADV_DONTNEED);
warning:                                         ^
warning: 5 errors generated.

Full error: https://pastebin.com/GHRrK3t3

I have traced the error to this commit: 17471a6. (Bump rocksdb to 7.4.3)

I import the crate in the following way:
Broken: rocksdb = { version = "0.19.0", default-features = false, features = [ "lz4" ], optional = true }
Working: rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "947e4b63034fff2151f52c399a5d85925ea80911", default-features = false, features = ["lz4"], optional = true }

Any ideas how to fix this?
Thanks!

@samuel-rufi
Copy link

Hi, just wanted to note I have run into the same problem when cross compiling for Android on macOS.

@amadeu2
Copy link

amadeu2 commented Oct 18, 2022

Hello, I have the same issue on coss compiling for Android.

@aleksuss
Copy link
Member

Unfortunately, I don't have such an environment for testing it. Could you provide steps for reproducing it? Besides, you can always create a PR to fix it.

@kwek20
Copy link
Contributor Author

kwek20 commented Oct 26, 2022

@aleksuss I have found the issue in rocksdb and made a PR there. Once it is merged ill make a PR here to update rocksdb

facebook-github-bot pushed a commit to facebook/rocksdb that referenced this issue Nov 2, 2022
Summary:
Cross compiling rocksdb with rust bindings to android leads to an error since 7.4.0 (Incusion of madvise)
This is due to missing placeholders for non-linux platforms.

This PR adds the missing placeholders.

See rust-rocksdb/rust-rocksdb#697 for the specific error thrown.

I have just completed the CLA :)

Pull Request resolved: #10881

Reviewed By: akankshamahajan15

Differential Revision: D40726103

Pulled By: ajkr

fbshipit-source-id: 6b391636a74ef7e20d0daf47d332ddf0c14d5c34
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

Successfully merging a pull request may close this issue.

4 participants