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

Add arm64ilp32 / x32 / IL64P32 targets #26

Closed
briansmith opened this issue Oct 6, 2015 · 7 comments
Closed

Add arm64ilp32 / x32 / IL64P32 targets #26

briansmith opened this issue Oct 6, 2015 · 7 comments

Comments

@briansmith
Copy link
Owner

See openssl/openssl@5e5ece5 and openssl/openssl@a93d3e0

@briansmith
Copy link
Owner Author

@briansmith briansmith changed the title Add arm64ilp32 target Add arm64ilp32 / x32 / IL64P32 targets Jan 10, 2016
@briansmith
Copy link
Owner Author

Note that this memory model is only good for cases where ASLR isn't necessary. This is perfect for Rust.

On GCC for MIPS, this is -mlong32
On GCC for PowerPOC, this is -mpowerpc64 -m32

See ICC's /Qauto-ilp32 (-auto-ilp32) https://software.intel.com/en-us/node/523141

Specifies that the application cannot exceed
a 32-bit address space, which allows the compiler to use 32-bit pointers
whenever possible.

See https://en.wikipedia.org/wiki/X32_ABI:

The x32 ABI was merged into the Linux kernel for the 3.4 release with support being added to the GNU C Library in version 2.16.

See https://sites.google.com/site/x32abi/

  • Ubuntu 13.04 added x32 support.
  • GCC 4.8.0 has been released with address size prefix improvement. GCC 4.8 is the recommended minimum version of GCC for x32.
  • X32 support is checked into GDB 7.5.
  • X32 support is checked into GLIBC 2.16.
  • X32 support is checked into Linux kernel 3.4.
    ... and more...

See http://lwn.net/Articles/456731/

See http://www-cs-faculty.stanford.edu/~uno/news08.html:

A Flame About 64-bit Pointers

It is absolutely idiotic to have 64-bit pointers when I compile a program that uses less than 4 gigabytes of RAM. When such pointer values appear inside a struct, they not only waste half the memory, they effectively throw away half of the cache.

The gcc manpage advertises an option "-mlong32" that sounds like what I want. Namely, I think it would compile code for my x86-64 architecture, taking advantage of the extra registers etc., but it would also know that my program is going to live inside a 32-bit virtual address space.

Unfortunately, the -mlong32 option was introduced only for MIPS computers, years ago. Nobody has yet adopted such conventions for today's most popular architecture. Probably that happens because programs compiled with this convention will need to be loaded with a special version of libc.

Please, somebody, make that possible.

@briansmith
Copy link
Owner Author

Note: Some parts of the code, e.g. gcm.c, use size_t, which is 32-bits on these platforms, when instead they should be using uint64_t on these platforms. We need to audit the code for all the places where size_t is being used for something other than a size.

Similarly, we need to audit the code for places where int and long and the unsigned variants thereof are being used, and replace them with the appropriate type.

@briansmith
Copy link
Owner Author

@briansmith
Copy link
Owner Author

rust-lang/rfcs#1339

@briansmith
Copy link
Owner Author

rust-lang/rfcs#1797

@sanxiyn
Copy link

sanxiyn commented Oct 19, 2017

x32 landed in Rust.

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

2 participants