HaxeFoundation / HaxeFoundation/hxcpp

hxcpp runtime not compiling on Apple Silicon

Open
#960 10 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

Using:
* haxe 4.2.2 from brew
* hxcpp 4.2.1
* Apple MacBook Pro 2020 with M1 chip (arm64)

Trying to compile simple hello world:

```haxe
## main.hx:
import lib.Logger;

class Main {
static public function main():Void {
var l = new Logger();
l.log("Hello, world");
}
}

## lib/Logger.hx:
package lib;

class Logger {
public function new() {}

public function log(message:String):Void {
trace(message);
}
}
```

With:

```
haxe --main Main --cpp ./.build/cpp
```

And getting assembly errors for runtime complilation:

```
Compiling group: runtime
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -stdlib=libc++ -Qunused-arguments -O2 -I/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/include -DHX_MACOS -m64 -Wno-parentheses -Wno-unused-value -Wno-format-extra-args -Wno-overflow -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=400(haxe) ... tags=[haxe]
- src/Enum.cpp
- src/Array.cpp
- src/hx/Anon.cpp
- src/hx/Date.cpp
- src/hx/Interface.cpp
- src/hx/CFFI.cpp [haxe,static]
- src/hx/Object.cpp
- src/hx/Boot.cpp
- src/hx/Class.cpp
- src/Dynamic.cpp
- src/hx/gc/GcRegCapture.cpp [haxe,gc]
- src/Math.cpp
Error: /Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:69:12: error: unknown token in expression
asm ("movq %%rbx, %0\n\t" : "=r" (regBx) );
^
:1:7: note: instantiated into assembly here
movq %rbx, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:69:12: error: invalid operand
asm ("movq %%rbx, %0\n\t" : "=r" (regBx) );
^
:1:7: note: instantiated into assembly here
movq %rbx, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:70:12: error: unknown token in expression
asm ("movq %%rbp, %0\n\t" : "=r" (regBp) );
^
:1:7: note: instantiated into assembly here
movq %rbp, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:70:12: error: invalid operand
asm ("movq %%rbp, %0\n\t" : "=r" (regBp) );
^
:1:7: note: instantiated into assembly here
movq %rbp, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:72:12: error: unknown token in expression
asm ("movq %%r12, %0\n\t" : "=r" (reg12) );
^
:1:7: note: instantiated into assembly here
movq %r12, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:72:12: error: invalid operand
asm ("movq %%r12, %0\n\t" : "=r" (reg12) );
^
:1:7: note: instantiated into assembly here
movq %r12, x8
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:73:12: error: unknown token in expression
asm ("movq %%r13, %0\n\t" : "=r" (reg13) );
^
:1:7: note: instantiated into assembly here
movq %r13, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:73:12: error: invalid operand
asm ("movq %%r13, %0\n\t" : "=r" (reg13) );
^
:1:7: note: instantiated into assembly here
movq %r13, x9
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:74:12: error: unknown token in expression
asm ("movq %%r14, %0\n\t" : "=r" (reg14) );
^
:1:7: note: instantiated into assembly here
movq %r14, x10
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:74:12: error: invalid operand
asm ("movq %%r14, %0\n\t" : "=r" (reg14) );
^
:1:7: note: instantiated into assembly here
movq %r14, x10
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:75:12: error: unknown token in expression
asm ("movq %%r15, %0\n\t" : "=r" (reg15) );
^
:1:7: note: instantiated into assembly here
movq %r15, x11
^
/Users/pztrn/.haxelib-repo/hxcpp/4,2,1/src/hx/gc/GcRegCapture.cpp:75:12: error: invalid operand
asm ("movq %%r15, %0\n\t" : "=r" (reg15) );
^
:1:7: note: instantiated into assembly here
movq %r15, x11
^
12 errors generated.
Error: Build failed
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.