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

test_translator.py fails on Mac M1 without -march=native target args #779

Open
bytewife opened this issue Jan 13, 2023 · 1 comment
Open

Comments

@bytewife
Copy link
Contributor

bytewife commented Jan 13, 2023

Removing the -march=native from test_translator.py causes the script to indefinitely stall when run on a Mac M1. See #778 for more details

Log:

ivy:~/projects/c2rust(master!?)via 🐍 v3.11.1 via 🦀 v1.65.0-nightly via 🐏 10GiB/16GiB took 248ms  ./scripts/test_translator.py tests --log DEBUG --only-directories misc
args: ./scripts/test_translator.py tests --log DEBUG --only-directories misc
misc:
compilation command:
 /usr/bin/clang -c -fPIC /Users/ivy/projects/c2rust/tests/misc/src/vectortypes.c /Users/ivy/projects/c2rust/tests/misc/src/sizeofs.c /Users/ivy/projects/c2rust/tests/misc/src/lvalues.c /Users/ivy/projects/c2rust/tests/misc/src/shadowing.c 

...

translating uninitialized.cranslating the C file into Rust...
translation command:
 LD_LIBRARY_PATH=/Users/ivy/.rustup/toolchains/nightly-2022-08-08-aarch64-apple-darwin/lib \
/Users/ivy/projects/c2rust/target/release/c2rust-transpile /Users/ivy/projects/c2rust/tests/misc/src/compile_commands.json --prefix-function-names rust_ --overwrite-existing --log-level=debug --
Running ['/Users/ivy/projects/c2rust/target/release/c2rust-transpile', '/Users/ivy/projects/c2rust/tests/misc/src/compile_commands.json', '--prefix-function-names', 'rust_', '--overwrite-existing', '--log-level=debug', '--']
stdout:
Transpiling uninitialized.c

stderr:

Chdir to /Users/ivy/projects/c2rust/tests/misc
Running ['/Users/ivy/.cargo/bin/cargo', 'build', '--release']
@bytewife
Copy link
Contributor Author

Reran test_translator.py again and this error popped up instead:

 [ OK ]     test test_enums.rs - test_buffer4
 [ OK ]     test test_enums.rs - test_buffer5
simd:
 [ FAILED ] create libtest.a
In file included from /Users/ivy/projects/c2rust/tests/simd/src/x86.c:1:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
In file included from /Users/ivy/projects/c2rust/tests/simd/src/x86.c:1:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:54:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:133:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:163:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:487:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Test summary:
  unexpected failures: 1
  unexpected successes: 0
  expected failures: 2
  successes: 45

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

1 participant