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

Fails to build for 32-bit Android (armeabi-v7a) #5

Closed
r4v3r23 opened this issue Feb 15, 2023 · 3 comments
Closed

Fails to build for 32-bit Android (armeabi-v7a) #5

r4v3r23 opened this issue Feb 15, 2023 · 3 comments

Comments

@r4v3r23
Copy link

r4v3r23 commented Feb 15, 2023

Polyseed fails to build for 32-bit Android. After speaking with @tobtoht, they got it to build by removing the time_t check, and also mentioned that the tests include a seed with a wallet creation date after 2038, which is problematic for 32-bit builds.

@tevador
Copy link
Owner

tevador commented Feb 15, 2023

Are you talking about this assert?

static_assert(sizeof(time_t) == 8, "time_t must be a 64-bit type.");

If time_t is a 32-bit type, polyseed (and probably the whole computer) will stop working in 2038. There are 32-bit kernels (and associated glibc) that support 64-bit time_t.

@tobtoht
Copy link
Contributor

tobtoht commented Feb 16, 2023

I'm looking to upstream Polyseed to Monero core. Why now?

  1. Multiple projects have expressed interested in switching to Polyseed for various reasons (UX being the main one), but are hesitant to do so without official support.
  2. Feather Wallet, which I maintain, currently stores a copy of the Polyseed in the wallet cache so it can be retrieved later. This was done because storing it in .keys would break wallet file compatibility. For better protection against memory attacks, I want to move the Polyseed into .keys and keep it encrypted in memory. (I could technically already do this with the cache, but cryptonote::account_base already has all the plumbing.)

The assert and (when removed) failing tests on 32-bit machines are a blocker because Monero still has 32-bit release binaries and users looking to compile the software from source for 32-bit machines.

Removing the assert lets us build on 32-bit machines and as far as I can tell this doesn't cause it to create an out-of-spec Polyseed. (Unless it's 2038, in which case I doubt there are will be any 32-bit machines around by then that don't run a kernel that supports 64-bit time_t or else the computer stops working anyway.)

There are 32-bit kernels (and associated glibc) that support 64-bit time_t.

The earliest version of glibc that supports this is 2.34 [1] [2] (for reference, Debian 11 is on 2.31). Monero release binaries target glibc 2.27.

[1] https://wiki.debian.org/ReleaseGoals/64bit-time
[2] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign

@tevador
Copy link
Owner

tevador commented Feb 18, 2023

Can you test #6?

@tevador tevador closed this as completed Mar 13, 2023
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

3 participants