Forum Discussion

dncmrc's avatar
dncmrc
Icon for Occasional Contributor rankOccasional Contributor
5 years ago
Solved

nios2-elf-gcc.exe: error: CreateProcess: No such file or directory

Hi,

Windows 10 Pro

2004

19041.450

Quartus Prime Pro 19.4, build 64

All Intel and Nios SW is on a local drive.

I get this error in the NiosII shell:

"nios2-elf-gcc.exe: error: CreateProcess: No such file or directory"

Do you have any hints or path available?

Regards.

  • As a solution to the issue nios2-elf-gcc.exe: fatal error: cannot execute 'cc1': CreateProcess: No such file or directory we have found useful what follows.

    Before running make.exe on the generated Makefile, add this to your bash script:

    export WSLENV=PATH/l:${WSLENV}
    sed -i 's/\(adjust-path[-mixed]*\) = .*/\1 = $1/' Makefile

    WSLEN fixes missing pathnames, while sed basically removes the effect of adjust-path.

    This is an issue introduced by a Windows update but I still believe Intel should provide a fix or patch for it. We wasted several days on it.

13 Replies

  • dncmrc's avatar
    dncmrc
    Icon for Occasional Contributor rankOccasional Contributor

    I installed now 20.2 and it gives the same error but a bit more info:

    ...

    Info: Compiling cpu.c to obj/default/./cpu.o
    nios2-elf-gcc.exe -xc -MP -MMD -c -IE:/FPGA/dp_demo/s10_rx_cts/software/btc_dprx_syslib -IE:/FPGA/dp_demo/s10_rx_cts/software/btc_dptx_syslib -IE:/FPGA/dp_demo/s10_rx_cts/software/dp_demo_bsp/HAL/inc -IE:/FPGA/dp_demo/s10_rx_cts/software/dp_demo_bsp -IE:/FPGA/dp_demo/s10_rx_cts/software/dp_demo_bsp/drivers/inc -IE:/FPGA/dp_demo/s10_rx_cts/software/btc_dprx_syslib -IE:/FPGA/dp_demo/s10_rx_cts/software/btc_dptx_syslib -IE:/FPGA/dp_demo/s10_rx_cts/software/btc_dptxll_syslib -pipe -D__hal__ -DALT_NO_C_PLUS_PLUS -DALT_NO_CLEAN_EXIT -D'exit(a)=_exit(a)' -DALT_NO_EXIT -DALT_NO_INSTRUCTION_EMULATION -DALT_USE_SMALL_DRIVERS -DSMALL_C_LIB -DALT_SINGLE_THREADED -O2 -g -Wall -Wformat-security -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global -o obj/default/./cpu.o cpu.c
    nios2-elf-gcc.exe: fatal error: cannot execute 'cc1': CreateProcess: No such file or directory
    compilation terminated.
    Makefile:740: recipe for target 'obj/default/./cpu.o' failed
    make: *** [obj/default/./cpu.o] Error 1

    ...

    • dncmrc's avatar
      dncmrc
      Icon for Occasional Contributor rankOccasional Contributor

      Easy way to replicate:

      1.- create an empty C source file (e.g. a.c)

      2.- execute gcc from the nios shell

      nios2-elf-gcc.exe -c a.c

      and you'll get the error.

      • dncmrc's avatar
        dncmrc
        Icon for Occasional Contributor rankOccasional Contributor

        Another bit of info. We had a second PC where our original script was working (i.e. nios2-elf-gcc.exe was not failing). Today we updated this PC to Windows 19041.450 and after that we get the same error message also on this second PC!

  • Eliath_G_Intel's avatar
    Eliath_G_Intel
    Icon for Occasional Contributor rankOccasional Contributor

    Hi Marco!

    Thanks for reaching us,

    Please follow the next steps:


    1. Install WSL
    2. Open the terminal
    3. run $ nios2_command_shell.sh
    4. run the tests you need to make , at this point it should work properly.


    As resume, you need to have WSL correctly installed.

    Please try those steps and let me know the results.


    Best regards,

    -Eliath Guzman


    • dncmrc's avatar
      dncmrc
      Icon for Occasional Contributor rankOccasional Contributor

      Hi Eliath,

      I tried what you suggest and I got the same error.

      We have had WSL correctly installed from the very beginning. Please read my messages above. The issue started after the latest Windows 10 updates.

      Regards

      • Suri's avatar
        Suri
        Icon for New Contributor rankNew Contributor

        Hello Intel support team,

        Is there any solution for this error?

        Me too getting the same error after updating the Windows. I tried to reinstall everything. But, getting same error. Please let me know the solution since it is very urgent.

    • billmax's avatar
      billmax
      Icon for New Contributor rankNew Contributor

      I have the same or similar problem.

      My wsl (v2) is up to date as is my Win10 version (2004). It appears the problem is paths.

      The $PATH in nios command shell contains

      /mnt/e/intelFPGA/20.1/nios2eds/bin/gnu/H-i686-pc-linux-gnu/bin

      That path doesn't exist in my installation: however this one does

      /mnt/e/intelFPGA/20.1/nios2eds/bin/gnu/H-x86_64-mingw32/bin

      Neither of those paths (or their windows equivalents) is in my windows path environment or subsequently in my wsl $PATH.

      Should the 20.1 quartus full install have added a path for nios2eds, and if so which?

      • SHard2's avatar
        SHard2
        Icon for Occasional Contributor rankOccasional Contributor

        Hi

        I have exactly the same error. Is there any resolution to this?

        Regards

        Simon

  • billmax's avatar
    billmax
    Icon for New Contributor rankNew Contributor

    @Eliath_G_Intel,

    My workaround is a combination of things.

    I manually added a couple of sdk paths to my windows environment Path. (E:\intelFPGA\20.1\nios2eds\bin;E:\intelFPGA\20.1\nios2eds\bin\gnu\H-x86_64-mingw32\bin)

    I rebooted wsl (by restarting LxssManager service) to get the updated $PATH.

    I edited the Makefile to change "Microsoft" to "microsoft"

    • billmax's avatar
      billmax
      Icon for New Contributor rankNew Contributor

      Additional details to workarounds/corrections

      There are problems trying to create a new app or create a new format Makefile for an older app.

      I had to manually create a wsl env for SOPC_KIT_NIOS2. In wsl:

      export SOPC_KIT_NIOS2=/mnt/e/intelFPGA/20.1/nios2eds

      Then for any create-this-app change "Microsoft" to "microsoft"

      Then edit the resulting created Makefile to change "Microsoft" to "microsoft"

      and change

      APP_LDFLAGS += -msys-lib=$(call adjust-path-mixed,$(SYS_LIB))

      to

      APP_LDFLAGS += -msys-lib=hal_bsp

      additional:

      change Makefile to

      BUILD_PRE_PROCESS := touch $(ELF).srec

      (per this post )

      modify nios2-download and nios2-configure-sof scripts to use lower-case 'm'

      • dncmrc's avatar
        dncmrc
        Icon for Occasional Contributor rankOccasional Contributor

        As a solution to the issue nios2-elf-gcc.exe: fatal error: cannot execute 'cc1': CreateProcess: No such file or directory we have found useful what follows.

        Before running make.exe on the generated Makefile, add this to your bash script:

        export WSLENV=PATH/l:${WSLENV}
        sed -i 's/\(adjust-path[-mixed]*\) = .*/\1 = $1/' Makefile

        WSLEN fixes missing pathnames, while sed basically removes the effect of adjust-path.

        This is an issue introduced by a Windows update but I still believe Intel should provide a fix or patch for it. We wasted several days on it.