PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
223 stars 53 forks source link

Failed to compile examples on Mac ARM64 #1278

Open zsx opened 3 months ago

zsx commented 3 months ago

Describe the bug

It fails to compile the files under example/ on an M2 Macbook.

To Reproduce Steps to reproduce the behavior:

I tried to follow the example as documented: cargo run plc examples/hello_world.st -o hello_world --linker=cc complains:

LLVM ERROR: Global variable 'main' has an invalid section specifier ',fn-$RUSTY$main:i32': mach-o section specifier requires a section whose length is between 1 and 16 characters.

Expected behavior the command should produce an executable

Additional context Add any other context about the problem here.

Tests Optional: Add a link to a PR or a branch where you have a failing test of the issue.

ghaith commented 3 months ago

Seems like the changes to the metadata affects macs. There's a PR that will move them behind a flag but we should still look into this.

volsa commented 3 months ago

Related https://github.com/PLC-lang/rusty/issues/1192; in the meantime you'll have to use Docker / Devcontainer when developing under MacOS