building gcc under redhat cygwin

Asked by kirem rahmani

I understand that the scripts provided to build gcc are only compatible ubuntu.

I am trying to cross compile gcc for windows.

As there is a distribution for windows would it be possible to make the build script available?

Building gcc is proving to be an impossible task due to my limited experience with the linux environment and the multitude of dependencies that exist and explicit reliance on specific versions of packages.

I can provide my basic build script if this helps, after fixing a lot of errors I have conceded and resigned to ask for help.

This is the last error that I have:

arm-none-eabi-gcc -dumpspecs > tmp-specs
/bin/sh: arm-none-eabi-gcc: command not found
Makefile:1822: recipe for target 'specs' failed
make[1]: *** [specs] Error 127
make[1]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod cpp.pod gfdl.pod gcc.pod
make[1]: Leaving directory '/home/bfltoolchain/build-gcc/gcc'
Makefile:3959: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2

Thanks in advance, Kirem

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Preud'homme
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
kirem rahmani (kiremrahmani) said :
#2

Hi, I don't think that it is necessary to add any further information. The
problem is quite clearly defined.
On 3 Jan 2016 08:22, "Launchpad Janitor" <
<email address hidden>> wrote:

> Your question #279606 on GCC ARM Embedded changed:
> https://answers.launchpad.net/gcc-arm-embedded/+question/279606
>
> Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open' state
> without activity for the last 15 days.
>
> --
> If you're still having this problem, you can reopen your question either
> by replying to this email or by going to the following page and
> entering more information about your problem:
> https://answers.launchpad.net/gcc-arm-embedded/+question/279606
>
> You received this question notification because you asked the question.
>

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#3

Hi Kirem,

"I understand that the scripts provided to build gcc are only compatible ubuntu.

I am trying to cross compile gcc for windows.

As there is a distribution for windows would it be possible to make the build script available?"

We use the provided buildscript to cross compile gcc for windows, this will always happen as long as you __DO_NOT__ pass --skip_steps=mingw32.

As for your error, could you post the full build log and the scripts you used to build it? As is I do not have enough information to provide you with useful help.

I have never attempted to build our toolchain on a redhat distribution before. Have you tried using the provided build scripts? You will need to install the dependencies noted on the How-to-build-toolchain.pdf(section 1.2.3), though you will need to use the Redhat Package Manager (RPM) instead of apt-get for this.

The error you get is expecting arm-none-eabi-gcc to be built somewhere and reachable by PATH, I suspect this might be during some library construction phase or something of the sorts, but the current information is not enough for us to help you figure out where the build is going wrong.

Cheers,
Andre

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#4

Hi Kirem,

This is caused by the following line in gcc/Makefile.in in the gcc source:

$(GCC_FOR_TARGET) -dumpspecs > specs

replacing $(GCC_FOR_TARGET) by ./xgcc should work but I'm not yet sure of the consequence of doing so. We'll keep you posted.

Best regards.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#5

I think a safer change would rather be to edit build-toolchain.sh and change the definition of the *_FOR_TARGET variable in Task IV-3 to the following:

saveenvvar AR_FOR_TARGET $INSTALLDIR_MINGW/bin/$TARGET-ar
and same for the other macros.

Best regards.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#6

Hi again,

Looking into build-toolchain.sh a bit deeper I noticed that the toolchain should be in the PATH as a result of prepend_path at the beginning of Task IV-1. Therefore there shouldn't be a need to touch the *_FOR_TARGET macro. Could you give us the full log (compressed to save space) of build-toolchain.sh run?

Best regards.

Revision history for this message
kirem rahmani (kiremrahmani) said :
#7

Hi Guys,

Thanks for the input so far. Please see the files here:

https://drive.google.com/folderview?id=0B3SKPqIM-IKDeVZOaXVOc2R5ajQ&usp=sharing

I found the build script provided to complicated to understand, so I attempted to make a build script.

I would appreciate any analysis of the buildlog.

Best Regards, Kirem

Revision history for this message
Best Thomas Preud'homme (thomas-preudhomme) said :
#8

Hi Kirem,

The problem is in your script, not in our toolchain. When building the target files for the mingw toolchain you need to have *_FOR_TARGET set to the path of working arm-none-eabi toolchain. In our script, we use the linux arm-none-eabi cross-toolchain built in the first part of the script by setting these variable to arm-none-eabi-* (with * being the tool's name). It works because before building the mingw toolchain the PATH is changed to contain the directory with the linux arm-none-eabi cross-toolchain.

Best regards.

Revision history for this message
kirem rahmani (kiremrahmani) said :
#9

Hi Thomas,
Thanks for the reply, I will try your suggestions.

Revision history for this message
kirem rahmani (kiremrahmani) said :
#10

Thanks Thomas Preud'homme, that solved my question.

Revision history for this message
Reza Housseini (reza-housseini-3) said :
#11

I have the same problem with my cygwin installation using the original build script. The script fials with the same error message during task [III-1]. As I understand correctly in this stage of the build the arm-none-eabi-gcc is not present yet (it cannot be found in the folder install-native/bin).
Why is the Makefile calling an executable it does not have yet? Available is the xgcc executable in the folder build-native/gcc-first/gcc.