Comments (9)
m68k (gcc 8.2.0):
Type Alignment/Bytes Size/Bytes
int8_t 1 1
int16_t 2 2
int32_t 2 4
int64_t 2 8
__int128 not supported
uint8_t 1 1
uint16_t 2 2
uint32_t 2 4
uint64_t 2 8
float 2 4
double 2 8
long double 2 12
size_t 2 4
off_t 2 4
void* 2 4
from mrustc.
Does it make sense to have the alignments and sizes for other compilers than gcc/llvm?
from mrustc.
I don't know, you tell me. Though if the libraries these compilers create interoperate with libraries other compilers create then those alignments and sizes have to be equal between compilers anyway.
from mrustc.
Alignment sizes are dictated by the ABI which is usually independent of the compiler used.
See for example: https://wiki.osdev.org/System_V_ABI
from mrustc.
@glaubitz sure, but offsets are, AFAICT, implementation specific in the sense that there's no restriction to put a uint16_t in the first 2 bytes or the last ones in a struct where the uint16_t is before a uint32_t.
from mrustc.
But wouldn't that make any code compiled with a different compiler ABI-incompatible with standard Linux environments, for example?
from mrustc.
It would. But I mostly thinking of bare metal code and embedded systems where the problem is not that obvious and using the same compiler is the go to solution.
from mrustc.
Okay, but bare-metal code doesn't use the SysV ABI anyway, so we're talking about different things then.
from mrustc.
There are now assertions in the generated C code to ensure that the size+alignment match what mrustc expected.
from mrustc.
Related Issues (20)
- Building 1.54.0 on linux amd64: Assertion '__n < this->size()' failed. HOT 5
- rustc-1.54.0-src.patch fails to apply on macOS 13 HOT 3
- minicargo build fails on WSLv2 - Ubuntu 22.04 due to OpenSSL HOT 6
- Support PowerPC: mrustc itself builds fine, rust tries to build for x86 and fails HOT 23
- Clarify trademark use HOT 1
- [Question] Does mrustc makes programs in Rust more portable across host/platforms that LLVM doesn't cover? HOT 4
- Add PGO support HOT 3
- Parallel builds HOT 4
- 1.29.0: failure to build against libssl-dev 3.x HOT 15
- Function returning enum doesn't populate the return value HOT 2
- A problem from beginner: Troubles with `core` and `std` paths when using mrustc HOT 3
- Compilation Error: Failed to find IntoIterator implementation for `core-0_0_0` HOT 2
- Compilation Error: BUG in expr_cs.cpp:7534 - Spare rules left after typecheck stabilised HOT 2
- SIGSEGV compiling 1.54.0 librustc_mir on OSX HOT 12
- Error with leading digit in '1' in src/trans/mangling_v2.cpp:85 HOT 3
- 'Macro_InvokeRules_MatchPattern - No arm matched' error in mrustc HOT 3
- BUG:src/hir_typeck/common.cpp:751: Impl parameters were not expected (got T/*I:0*/) HOT 5
- Unable to build against musl HOT 29
- Can't compile on macOS 12 anymore HOT 3
- Problem to build with #![no_std] HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mrustc.