Open titzer opened 2 years ago
I believe Rosetta 2 requires executables to use PIC (position independent code). PIE and fixed addresses are not supported I think. At least when linking a non-PIC executable you get the following warning: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in ... from ...o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
Thanks for that info! That makes sense. It's a bit of work to figure out how to emit linker tables and such on MacOS.
Steps to reproduce:
bin/dev/aeneas bootstrap
bin/dev/v3c-x86-64-darwin -output=/tmp apps/HelloWorld/*.v3
/tmp/HelloWord
The current error I get is "overlapping segments" but even rearranging the segments in the binary, I cannot get the program to start.
I recently ported Virgil to
x86-64-darwin
, i.e. 64-bit MacOS on Intel. I expected that the binaries generated would work automatically under Rosetta 2, but they apparently do not.I could some help debugging some issues.
Tinkering with the segment layouts in
aeneas/src/x86-64/X86_64Darwin.v3
can get past that, but other errors remain. I am not sure what the rules are for Rosetta.