What difference between some-prefix-gcc and gcc --target=some-prefix?

442 views Asked by At

I want to use another version of gcc (newer), but don't want to replace original <some-prefix>-gcc executable.

Which compiler flags do I have to use to emulate the <some-prefix>-gcc behaviour? I know about --prefix and --target flags during building, but I don't want to build a specific version of gcc.

Problem with /my/new/gcc --target=some-prefix in different tool chains (<some-prefix>-ld, <some-prefix>-as). So, I want to use my version of GCC as front end and the original tool chain as back end (not only executables, includes/libs too).

Which additional flags can help me to tell gcc to use the <some-prefix>-as as back end?

1

There are 1 answers

0
Jonathan Wakely On

you can use -B dir to tell gcc to look in dir for the other executables it needs, but you can't tell it to use a different <some-prefix> because that's set when gcc is built. You also can't (generally) mix headers and libs from one version of gcc with another version, they are intended to be used together with the release they came with.

You could create a new directory with symlinks to the backend tools you want, naming the symlinks as gcc expects to find them, then use -B to tell it to look in that dir. But don't be surprised if it fails to work.