Closed Bug 1485765 Opened Last year Closed Last year

add compile-time endianness determination for aarch64 windows to sqlite

Categories

(Toolkit :: Storage, enhancement)

ARM64
Windows
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

sqlite3 compiles for AArch64 Windows just fine (at least our local sqlite3.c amalgamation), which is actually pretty impressive.

It would be nice to have SQLITE_BYTEORDER defined appropriately for AArch64 Windows platforms as little-endian, so that optimized code is compiled in as necessary, rather than using a bunch of runtime testing.  The preprocessor macro for such machines is _M_ARM64.

Can this change be made?  I'm not sure if backports would be possible, or even if we'd need them.
Flags: needinfo?(drh)
See Also: → 1485767
(In reply to Nathan Froyd [:froydnj] from comment #0)
> It would be nice to have SQLITE_BYTEORDER defined appropriately for AArch64
> Windows platforms as little-endian, so that optimized code is compiled in as
> necessary, rather than using a bunch of runtime testing.  The preprocessor
> macro for such machines is _M_ARM64.

The change is checked in here: https://www.sqlite.org/src/info/ef6729be85ed1062

This will appear in the next release of SQLite (3.25.0), but that is still several weeks away.  I will be happy to backport, generating a new 3.24.1 release, if you like. Just let me know. Meanwhile, I have uploaded a copy of the latest build to https://sqlite.org/tmp/sqlite-20180823.tar.gz which you can use for testing purposes. Also you can achieve the same effect using the official 3.24.0 release by adding the -DSQLITE_BYTEORDER=1234 compile-time option to your AArch64 builds.
Flags: needinfo?(drh)
(In reply to D. Richard Hipp from comment #1)
> (In reply to Nathan Froyd [:froydnj] from comment #0)
> > It would be nice to have SQLITE_BYTEORDER defined appropriately for AArch64
> > Windows platforms as little-endian, so that optimized code is compiled in as
> > necessary, rather than using a bunch of runtime testing.  The preprocessor
> > macro for such machines is _M_ARM64.
> 
> The change is checked in here:
> https://www.sqlite.org/src/info/ef6729be85ed1062

Excellent, thank you!

> This will appear in the next release of SQLite (3.25.0), but that is still
> several weeks away.  I will be happy to backport, generating a new 3.24.1
> release, if you like. Just let me know. Meanwhile, I have uploaded a copy of
> the latest build to https://sqlite.org/tmp/sqlite-20180823.tar.gz which you
> can use for testing purposes. Also you can achieve the same effect using the
> official 3.24.0 release by adding the -DSQLITE_BYTEORDER=1234 compile-time
> option to your AArch64 builds.

Ah, that's a good point about providing the explicit define.  I think using that should be sufficient until we upgrade to 3.25.0.  Thank you!
Credit to D. Richard Hipp for the idea.
Attachment #9003854 - Flags: review?(bugmail)
Comment on attachment 9003854 [details] [diff] [review]
use a compile-time determined endianness on aarch64 windows for sqlite

Review of attachment 9003854 [details] [diff] [review]:
-----------------------------------------------------------------

I like the self-explanatory nature of the define's value!
Attachment #9003854 - Flags: review?(bugmail) → review+
Assignee: nobody → nfroyd
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f6ebc9867b6d
use a compile-time determined endianness on aarch64 windows for sqlite; r=asuth
https://hg.mozilla.org/mozilla-central/rev/f6ebc9867b6d
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.