So, here is the situation: I need to compile binary files from a Linux machine (on Ubuntu, for what it costs), which can be run from the SPARC server. The program I'm trying to compile is very simple:
#include <stdio.h> #include <stdlib.h> int main() { printf("Testing the SPARC program..."); return EXIT_SUCCESS; }
I tried several different compilation lines to make it work, but unfortunately nothing works.
I tried the traditional one:
clang -target sparc blah.c -o blahsparc
But this will not work with assembler crashes:
/tmp/blah-519e77.s: Assembler messages: /tmp/blah-519e77.s:7: Error: unknown pseudo-op: '.register' /tmp/blah-519e77.s:8: Error: unknown pseudo-op: '.register' /tmp/blah-519e77.s:9: Error: unknown pseudo-op: '.register' /tmp/blah-519e77.s:10: Error: unknown pseudo-op: '.register' /tmp/blah-519e77.s:11: Error: no such instruction: 'save %sp,-240,%sp' /tmp/blah-519e77.s:12: Error: no such instruction: 'st %g0, [%fp+2043]' ... clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
I also tried this:
clang -cc1 -triple "sparc-unknown-Linux" blah.c -o blahsparc
which complains about missing headers, so instead of using -cc1 I use -Xclang:
clang -Xclang -triple -Xclang "sparc-unknown-Linux" blah.c -o blahsparc
However, this also fails due to โerror: unknown target processorโ x86-64. โI donโt know where to start. I also tried using crosstool-ng with very little success.
source share