-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Running a simple compilation with aspis.sh:
$ ./aspis.sh --llvm-bin /your/path/llvm-project/build/bin examples/cpp-benchmarks/full_test.cpp
Leads to the following error:
fatal error: error in backend: unknown special variable
clang-16: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 16.0.6 clang-16: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
ERROR: Command FAILED:/your/path/llvm-project/build/bin/clang -lstdc++ ./out.ll -o ./out
The problem seems to be due to the #include <iostream> call.
Somehow, the ASPIS toolchain creates some special variable in the out.ll file that the back-end can't translate.
The problem is NOT the standard library since a program with the inclusion of vector doesn't yield an error.
How to see the error
Firstly, I run the following code, which results in the previous error.
#include <iostream>
int main(){
std::cout<<"Hello World"<<std::endl;
return 0;
}
While the code below, with the C-style print and the allocation of a vector (check if the problem is the std library), won't result in an error.
#include <vector>
#include <stdio.h>
int main(){
std::vector<int> {};
printf("Hello World\n");
return 0;
}
You can check the error by yourself just by running aspis.sh on full_test.cpp file.
I'm still not sure if the problem is only on my machine, so it would be useful if someone could run it on their machine.