Error when SimPipe builds simulation environment and uses test

Asked 2 years ago, Updated 2 years ago, 148 views

terminal screenshots

When I tried to run the test program hello.c in a SimPipe environment on Mac OSX, I encountered the following problems:

./SimPipe SimMips/test/qsort

When I typed , I tried to test hello.c in workspace even though it did.

mipsel-linux-gnu-gcc-static hello.c-o hello

-bash:mipsel-linux-gnu-gcc command not found

./SimPipe-0.1.4/SimPipe hello
## ERROR: Can't open file. (hello)

There was an error.
I don't know why hello, world is not printed.
Due to the above error, if you try to install gcc in the current directory, it will probably default to
Installed in Library/Developer/CommandLineTools/usr/bin, even if you type gcc,

 clang:error:no input files

it came out.
I have my username between workspace and $.
Also, PATH of the downloaded compiled cross-compiler to bash_profile

export PATH=$PATH:/Users/username/Downloads/cross_compiler/bin

I passed through. (I don't think this will work.)
I have /bin/mipsel-linux-gnn-gcu, but where on earth...

macos c gcc compiler

2022-09-30 10:26

1 Answers

clang:error:no input files is normal (behavior when you do not specify a source file to compile).Now that you are trying to generate a cross compiler, mipsel-linux-gnu-gcc command not found is obvious (as we have not generated it yet).So I don't know what the question is.

If you want to create a cross compiler for gcc-x.y.z with clang that comes with MacOS, you just have to follow the instructions on the GCC webpage.
https://gcc.gnu.org/install/
Articles specializing in cross-compiler generation, for example
https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
There must be a lot of articles in Japanese, but it is omitted (please search by yourself)


To explain the carelessness,
1. Obtain the binutils source and create a cross assembly with ./configure --target=mipsel-linux-gnu;make 2. Obtain a set of gcc sources and create a cross compiler by ./configure --target=mipsel-linux-gnu --enable-languages=c,c++;make 3.Create a library for cross-destination machines if necessary
4.Install the System Standard Compiler without breaking it
5. If installed outside the standard PATH, pass through the PATH

The above is intended to be the answer to the initial question.The question has been edited and the content has been completely changed, so add below

Modifying only through /.bash_profile will not change the environment variable for the shell that has already started.You need to log out → log in again or reload like $source~/.bash_profile.You may need to clear the command hash as $hash-r.

Make sure that the "cross compiler package" you downloaded also contains the cross assembler.


2022-09-30 10:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.