#59 'Program "gcc" not found in PATH' error when creating a project with linaro gcc (aarch64-none-elf-gcc).

Future release
closed-works-for-me
None
4
2 days ago
2013-10-23
Iulia Vasii
No

Abstract: 'Program "gcc" not found in PATH' error when creating a project with linaro gcc (aarch64-none-elf-gcc).

Steps to reproduce:
- create 'HelloWorld ARM C Project' with 'Cross ARM GCC'
- choose toochain name: Linaro AArch64 bare-metal ELF (aarch64-none-elf-gcc)
- toolchain path: ../gcc-linaro-aarch64-none-elf-4.8_win32/bin (the package is in my eclipse layout)
- finish
- in Problems view I see two errors:

"Error: Program "g++" not found in PATH"
Error: Program "gcc" not found in PATH
- in Properties >> Build Variables I correctly configured ${cross_make} and ${cross_rm}
- build project (the build process finishes without errors, the binaries are created), but the above errors don't disappear

From my investigations, the issue is in Properties >> Preprocessor Include Paths, Macros etc. >> Providers >> CDT GCC Built-in Compiler Settings Cross ARM. I checked "Allocate console in the Console View" and the log is:

11:47:31 * Running scanner discovery: CDT GCC Built-in Compiler Settings Cross ARM *
g++ ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD D:/WORKSPACES/runtime-New_configuration/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
Cannot run program "g++": Launching failed
Error: Program "g++" not found in PATH

If I modify the ${COMMAND} to aarch64-none-elf-gcc I get:

11:56:10 * Running scanner discovery: CDT GCC Built-in Compiler Settings Cross ARM *
aarch64-none-elf-g++ ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD D:/WORKSPACES/runtime-New_configuration/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
aarch64-none-elf-g++: error: ${FLAGS}: No such file or directory
aarch64-none-elf-g++: error: ${cross_toolchain_flags}: No such file or directory

I'm using plugin version 1.1.2-201310221203 with eclipse Kepler, Windows host. The .metadata log is attached.

1 Attachments

Discussion

1 2 3 > >> (Page 1 of 3)
    • status: open --> open-accepted
     
  • Iulia Vasii
    Iulia Vasii
    2013-10-23

    I attach my project to see the settings. It has hard-coded paths for ${cross_make}, ${cross_rm} and toolchain path.

     
    Attachments
  • Iulia Vasii
    Iulia Vasii
    2013-10-23

    I reproduced the issue on Linux too. Is there a workaround without having to edit the PATH variable? Can I disable Scanner Discovery somehow?

     
  • you can disable the scanner providers, but this is by no means a solution; the indexer being one of the main strengths of CDT, without the scanner providers the indexer is rendered useless.

     
  • Iulia Vasii
    Iulia Vasii
    2013-10-23

    Ok. I'll wait for a solution.

     
    • toolchain path: ../gcc-linaro-aarch64-none-elf-4.8_win32/bin (the package is in my eclipse layout)

    using relative paths here is not a good idea, since you do not now the current path when the execution is attempted. the actual build is done inside each configuration folder (Debug/Release), the discovery process... I don't know by heart, I have to check

    • in Properties >> Build Variables I correctly configured ${cross_make} and ${cross_rm}

    why would you like to change the internal build variables, when there is a special page to configure all toolchain details.

    please read the new documentation pages on how to configure the path to make & rm, and avoid entering absolute paths in macros, they are not portable across workspaces


    with the correct path to the toolchain (absolute path in Toolchain tabs) and the build tool (make & rm) in a separate folder, with its path added to the entire workspace environment, my test was successful, including correct discovery and indexer.

    19:36:15 * Build of configuration Debug for project t4 *
    make all
    'Building file: ../src/t4.c'
    'Invoking: Cross ARM C Compiler'
    aarch64-none-elf-gcc -mcpu=generic+simd -mcmodel=small -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -MMD -MP -MF"src/t4.d" -MT"src/t4.d" -c -o "src/t4.o" "../src/t4.c"
    'Finished building: ../src/t4.c'
    ' '
    'Building target: t4.elf'
    'Invoking: Cross ARM C Linker'
    aarch64-none-elf-gcc -mcpu=generic+simd -mcmodel=small -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -Wl,-Map,"t4.map" --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lc -lm -lrdimon -Wl,--end-group -o "t4.elf" ./src/t4.o
    'Finished building target: t4.elf'
    ' '
    'Invoking: Cross ARM GNU Create Flash Image'
    aarch64-none-elf-objcopy "t4.elf" -O ihex "t4.hex"
    'Finished building: t4.hex'
    ' '
    'Invoking: Cross ARM GNU Create Listing'
    aarch64-none-elf-objdump "t4.elf" --source --all-headers --demangle --line-numbers --wide > "t4.lst"
    'Finished building: t4.lst'
    ' '
    'Invoking: Cross ARM GNU Print Size'
    aarch64-none-elf-size --format=berkeley "t4.elf"
    text data bss dec hex filename
    17168 4288 468 21924 55a4 t4.elf
    'Finished building: t4.siz'
    ' '

    19:36:17 Build Finished (took 1s.187ms)

    Note: there is an error logged initially (Program "echo" not found in PATH) that is due to a bug in CDT, which is trying to run the discovery process before the toolchain is properly configured, but if happens only when the project is created, and, if you delete it, it does not happen again.

     
  • Resolution: 'Program "gcc" not found in PATH' was due to a misconfigured PATH, a relative path was used with a wrong reference point.

    Recommandation: to avoid problems, use an absolute path. Although it is stored in the .cproject file, during the project life span it is stored in the workspace, so projects are portable and can be moved from workspace to workspace (even between windows and non windows) without problems.

     
    • status: open-accepted --> closed-works-for-me
     
  • Iulia Vasii
    Iulia Vasii
    2013-10-24

    I did everything you said, absolute toolchain path, read documentation, configured make & rm as mentioned in the doc, same result. To be sure I'm not doing something stupid, I followed 'Create a test project' tutorial using gcc-arm-none-eabi toolchain and not linaro, same story. On Windows, the error is obvious:

    11:43:32 * Running scanner discovery: CDT GCC Built-in Compiler Settings Cross ARM *
    g++ ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD D:/WORKSPACES/workspace_LS2_3/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.
    Cannot run program "g++": Launching failed
    Error: Program "g++" not found in PATH

    On Linux, because gcc/g++ are by default in system path, there are no errors reported in Problems view, but the Scanner Discovery console complains:

    11:39:34 * Running scanner discovery: CDT GCC Built-in Compiler Settings Cross ARM *
    g++ ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD /home/iulia/workspaces/workspace_dev/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
    g++: error: ${FLAGS}: No such file or directory
    g++: error: ${cross_toolchain_flags}: No such file or directory

    This may be the case on Mac OS too (host you are using), to work by chance as it does on Linux. In the test you did previously, can you please enable Scanner Discovery console and check the log?

     
  • I ran my test on a Windows machine too, so there should not be a platform problem.

    Could you retry the test on a fresh Eclipse?

    • unpack a new Eclipse Kepler CDT
    • install the plug-in
    • create a new project in a new workspace

    If this test fails, you are systematically doing something wrong. If this test passes, the problem should be due to an interference with some other plug-ins.

     
1 2 3 > >> (Page 1 of 3)