[Bug other/89249] New: mingw, paths with space, LTO -> collect2.exe: fatal error: CreateProcess: No such file or directory

ilg at livius dot net gcc-bugzilla@gcc.gnu.org
Fri Feb 8 10:01:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89249

            Bug ID: 89249
           Summary: mingw, paths with space, LTO -> collect2.exe: fatal
                    error: CreateProcess: No such file or directory
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ilg at livius dot net
  Target Milestone: ---

I know that supporting Windows was always a big pain, so I can fully understand
people not being over joyed when seeing such errors...

I also noticed that reports related to CreateProcess are usually refered to
mingw; or that local configurations are blamed, like wrong paths.

However, in my case, the specifics may point to a possible bug in gcc, althougt
I do not exclude an interraction with the mingw runtime.

The problem occured in a configuration which used spaces in the install path,
and went away when I moved **exactly** the same toolchain to a folder without
spaces in the names.

Another detail is that the problem occured only when using -flto, and did not
occur when exactly the same project was compiled without -flto.

The linker output with the error:

---
Building target: f4b-lto.elf
Invoking: GNU ARM Cross C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Og
-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
-ffreestanding -flto -fno-move-loop-invariants -Wall -Wextra  -g3 -T mem.ld -T
libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts"
-Wl,-Map,"f4b-lto.map" --specs=nano.specs -v -o "f4b-lto.elf" 
./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o  ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o  ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o  ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o 
./system/src/cmsis/system_stm32f4xx.o ./system/src/cmsis/vectors_stm32f407xx.o 
./src/BlinkLed.o ./src/Timer.o ./src/_initialize_hardware.o ./src/_write.o
./src/main.o ./src/stm32f4xx_hal_msp.o   
Using built-in specs.
Reading specs from c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
rename spec cpp_unique_options to nano_cpp_unique_options
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=c:/users/ilg/desktop/8.2.1\ \ \ \ \
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /Host/Work/arm-none-eabi-gcc-8.2.1-1.4/gcc/configure
--prefix=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc
--infodir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/info
--mandir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/man
--htmldir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/html
--pdfdir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/pdf
--build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
--target=arm-none-eabi --with-pkgversion='GNU MCU Eclipse ARM Embedded GCC\x2C
64-bit' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins
--enable-lto --disable-decimal-float --disable-libffi --disable-libgomp
--disable-libmudflap --disable-libquadmath --disable-libssp
--disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads
--disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes
--with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/arm-none-eabi
--with-multilib-list=rmprofile --disable-rpath --disable-build-format-warnings
--with-system-zlib
Thread model: single
gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 
COMPILER_PATH=c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../libexec/gcc/;c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../lib/gcc/;c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-ffreestanding' '-flto' '-fno-move-loop-invariants' '-Wall' '-Wextra' '-g3'
'-T' 'mem.ld' '-T' 'libs.ld' '-T' 'sections.ld' '-nostartfiles'
'-L../ldscripts' '-specs=nano.specs' '-v' '-o' 'f4b-lto.elf' '-march=armv7e-m'
 c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/collect2.exe -flto
--sysroot=c:\users\ilg\desktop\8.2.1     1.4-20190207-1853\bin\../arm-none-eabi
-X -o f4b-lto.elf -L../ldscripts -Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1
-Lc:/users/ilg/desktop/8.2.1     1.4-20190207-1853/bin/../lib/gcc
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib
-Lc:/users/ilg/desktop/8.2.1     1.4-20190207-1853/bin/../arm-none-eabi/lib
--gc-sections -Map f4b-lto.map ./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f4xx.o
./system/src/cmsis/vectors_stm32f407xx.o ./src/BlinkLed.o ./src/Timer.o
./src/_initialize_hardware.o ./src/_write.o ./src/main.o
./src/stm32f4xx_hal_msp.o -lstdc++_nano -lm --start-group -lgcc -lg_nano
-lc_nano --end-group --start-group -lgcc -lc_nano --end-group -T mem.ld -T
libs.ld -T sections.ld
collect2.exe: fatal error: CreateProcess: No such file or directory
compilation terminated.
make: *** [makefile:64: f4b-lto.elf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
---

The offending name is 'c:/users/ilg/desktop/8.2.1     1.4-20190207-1853/bin'.

After replacing the spaces with a dash, the link step was ok:

---
Building target: f4b-lto.elf
Invoking: GNU ARM Cross C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Og
-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
-ffreestanding -flto -fno-move-loop-invariants -Wall -Wextra  -g3 -T mem.ld -T
libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts"
-Wl,-Map,"f4b-lto.map" --specs=nano.specs -v -o "f4b-lto.elf" 
./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o  ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o  ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o  ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o 
./system/src/cmsis/system_stm32f4xx.o ./system/src/cmsis/vectors_stm32f407xx.o 
./src/BlinkLed.o ./src/Timer.o ./src/_initialize_hardware.o ./src/_write.o
./src/main.o ./src/stm32f4xx_hal_msp.o   
Using built-in specs.
Reading specs from
c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
rename spec cpp_unique_options to nano_cpp_unique_options
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /Host/Work/arm-none-eabi-gcc-8.2.1-1.4/gcc/configure
--prefix=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc
--infodir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/info
--mandir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/man
--htmldir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/html
--pdfdir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/pdf
--build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
--target=arm-none-eabi --with-pkgversion='GNU MCU Eclipse ARM Embedded GCC\x2C
64-bit' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins
--enable-lto --disable-decimal-float --disable-libffi --disable-libgomp
--disable-libmudflap --disable-libquadmath --disable-libssp
--disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads
--disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes
--with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/arm-none-eabi
--with-multilib-list=rmprofile --disable-rpath --disable-build-format-warnings
--with-system-zlib
Thread model: single
gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 
COMPILER_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-ffreestanding' '-flto' '-fno-move-loop-invariants' '-Wall' '-Wextra' '-g3'
'-T' 'mem.ld' '-T' 'libs.ld' '-T' 'sections.ld' '-nostartfiles'
'-L../ldscripts' '-specs=nano.specs' '-v' '-o' 'f4b-lto.elf' '-march=armv7e-m'

c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/collect2.exe
-flto
--sysroot=c:\users\ilg\desktop\8.2.1-1.4-20190207-1853\bin\../arm-none-eabi -X
-o f4b-lto.elf -L../ldscripts
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib
-Lc:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib
--gc-sections -Map f4b-lto.map ./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f4xx.o
./system/src/cmsis/vectors_stm32f407xx.o ./src/BlinkLed.o ./src/Timer.o
./src/_initialize_hardware.o ./src/_write.o ./src/main.o
./src/stm32f4xx_hal_msp.o -lstdc++_nano -lm --start-group -lgcc -lg_nano
-lc_nano --end-group --start-group -lgcc -lc_nano --end-group -T mem.ld -T
libs.ld -T sections.ld
c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/lto-wrapper.exe
./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f4xx.o
./system/src/cmsis/vectors_stm32f407xx.o ./src/BlinkLed.o ./src/Timer.o
./src/_initialize_hardware.o ./src/_write.o ./src/main.o
./src/stm32f4xx_hal_msp.o 
arm-none-eabi-g++ @C:\Users\ilg\AppData\Local\Temp\ccEwHABd
Using built-in specs.
Reading specs from
c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
rename spec cpp_unique_options to nano_cpp_unique_options
COLLECT_GCC=arm-none-eabi-g++
Target: arm-none-eabi
Configured with: /Host/Work/arm-none-eabi-gcc-8.2.1-1.4/gcc/configure
--prefix=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc
--infodir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/info
--mandir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/man
--htmldir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/html
--pdfdir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/pdf
--build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
--target=arm-none-eabi --with-pkgversion='GNU MCU Eclipse ARM Embedded GCC\x2C
64-bit' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins
--enable-lto --disable-decimal-float --disable-libffi --disable-libgomp
--disable-libmudflap --disable-libquadmath --disable-libssp
--disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads
--disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes
--with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/arm-none-eabi
--with-multilib-list=rmprofile --disable-rpath --disable-build-format-warnings
--with-system-zlib
Thread model: single
gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-mcpu=cortex-m4'
'-mfloat-abi=soft'  '-Og' '-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-fno-move-loop-invariants' '-Wextra' '-g3' '-T' 'mem.ld' '-T' 'libs.ld' '-T'
'sections.ld' '-nostartfiles' '-L../ldscripts' '-specs=nano.specs' '-v' 
'-dumpdir' './' '-dumpbase' 'f4b-lto.elf.wpa'
'-fltrans-output-list=C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans.out'
'-fwpa' '-march=armv7e-m'

c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/arm-none-eabi/8.2.1/lto1.exe
-quiet -dumpdir ./ -dumpbase f4b-lto.elf.wpa -mcpu=cortex-m4 -mfloat-abi=soft
-mcpu=cortex-m4 -mthumb -mfloat-abi=soft -march=armv7e-m -auxbase stm32f4xx_hal
-g3 -Og -Og -Wextra -version -fno-openmp -fno-openacc -fmessage-length=0
-fsigned-char -ffunction-sections -fdata-sections -fno-move-loop-invariants
-fltrans-output-list=C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans.out -fwpa
@C:\Users\ilg\AppData\Local\Temp\ccNMzFgH
GNU GIMPLE (GNU MCU Eclipse ARM Embedded GCC, 64-bit) version 8.2.1 20181213
(release) [gcc-8-branch revision 267074] (arm-none-eabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU GIMPLE (GNU MCU Eclipse ARM Embedded GCC, 64-bit) version 8.2.1 20181213
(release) [gcc-8-branch revision 267074] (arm-none-eabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COMPILER_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-mcpu=cortex-m4'
'-mfloat-abi=soft'  '-Og' '-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-fno-move-loop-invariants' '-Wextra' '-g3' '-T' 'mem.ld' '-T' 'libs.ld' '-T'
'sections.ld' '-nostartfiles' '-L../ldscripts' '-specs=nano.specs' '-v' 
'-dumpdir' './' '-dumpbase' 'f4b-lto.elf.wpa'
'-fltrans-output-list=C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans.out'
'-fwpa' '-march=armv7e-m'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -march=armv7e-m -r
-nostdlib -o C:\Users\ilg\AppData\Local\Temp\ccXSGpBYdebugobj
C:\Users\ilg\AppData\Local\Temp\cckhSqwJdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cc5FxM2wdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cckuo93mdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cch75PPgdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cc8C50hddebugobjtem
C:\Users\ilg\AppData\Local\Temp\cc5vvwYbdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccezFo7cdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccRJrCCfdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccsn1FFkdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cctYKysodebugobjtem
C:\Users\ilg\AppData\Local\Temp\cc4jVjSvdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccDSQRqCdebugobjtem
C:\Users\ilg\AppData\Local\Temp\cc6t99rMdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccR8QIyWdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccXRnUxYdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccvnwwnZdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccbzifT2debugobjtem
C:\Users\ilg\AppData\Local\Temp\cchyjUR7debugobjtem
C:\Users\ilg\AppData\Local\Temp\ccnV6hGgdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccJMPhksdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccDx0FuFdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccNESo4Sdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccL1ttg9debugobjtem
C:\Users\ilg\AppData\Local\Temp\cczjpscrdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccTJERdIdebugobjtem
C:\Users\ilg\AppData\Local\Temp\ccxESMi3debugobjtem
C:\Users\ilg\AppData\Local\Temp\cc7CjJFqdebugobjtem
arm-none-eabi-g++ @C:\Users\ilg\AppData\Local\Temp\ccTzgy7o
Using built-in specs.
Reading specs from
c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
rename spec cpp_unique_options to nano_cpp_unique_options
COLLECT_GCC=arm-none-eabi-g++
Target: arm-none-eabi
Configured with: /Host/Work/arm-none-eabi-gcc-8.2.1-1.4/gcc/configure
--prefix=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc
--infodir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/info
--mandir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/man
--htmldir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/html
--pdfdir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/pdf
--build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
--target=arm-none-eabi --with-pkgversion='GNU MCU Eclipse ARM Embedded GCC\x2C
64-bit' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins
--enable-lto --disable-decimal-float --disable-libffi --disable-libgomp
--disable-libmudflap --disable-libquadmath --disable-libssp
--disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads
--disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes
--with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/arm-none-eabi
--with-multilib-list=rmprofile --disable-rpath --disable-build-format-warnings
--with-system-zlib
Thread model: single
gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-mcpu=cortex-m4'
'-mfloat-abi=soft'  '-Og' '-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-fno-move-loop-invariants' '-Wextra' '-g3' '-T' 'mem.ld' '-T' 'libs.ld' '-T'
'sections.ld' '-nostartfiles' '-L../ldscripts' '-specs=nano.specs' '-v' 
'-dumpdir' './' '-dumpbase' 'f4b-lto.elf.ltrans0' '-fltrans' '-o'
'C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans0.ltrans.o' '-march=armv7e-m'

c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/arm-none-eabi/8.2.1/lto1.exe
-quiet -dumpdir ./ -dumpbase f4b-lto.elf.ltrans0 -mcpu=cortex-m4
-mfloat-abi=soft -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -march=armv7e-m
-auxbase-strip C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans0.ltrans.o -g3
-Og -Og -Wextra -version -fno-openmp -fno-openacc -fmessage-length=0
-fsigned-char -ffunction-sections -fdata-sections -fno-move-loop-invariants
-fltrans @C:\Users\ilg\AppData\Local\Temp\cc6fdxVa -o
C:\Users\ilg\AppData\Local\Temp\ccqmesT9.s
GNU GIMPLE (GNU MCU Eclipse ARM Embedded GCC, 64-bit) version 8.2.1 20181213
(release) [gcc-8-branch revision 267074] (arm-none-eabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU GIMPLE (GNU MCU Eclipse ARM Embedded GCC, 64-bit) version 8.2.1 20181213
(release) [gcc-8-branch revision 267074] (arm-none-eabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-mcpu=cortex-m4'
'-mfloat-abi=soft'  '-Og' '-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-fno-move-loop-invariants' '-Wextra' '-g3' '-T' 'mem.ld' '-T' 'libs.ld' '-T'
'sections.ld' '-nostartfiles' '-L../ldscripts' '-specs=nano.specs' '-v' 
'-dumpdir' './' '-dumpbase' 'f4b-lto.elf.ltrans0' '-fltrans' '-o'
'C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans0.ltrans.o' '-march=armv7e-m'

c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/as.exe
-v -march=armv7e-m -mfloat-abi=soft -mfloat-abi=soft -meabi=5 -o
C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans0.ltrans.o
C:\Users\ilg\AppData\Local\Temp\ccqmesT9.s
GNU assembler version 2.31.51 (arm-none-eabi) using BFD version (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 2.31.51.20181213
COMPILER_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/lib/gcc/../../libexec/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../libexec/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/;c:/users/ilg/desktop/8.2.1-1.4-20190207-1853/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-mcpu=cortex-m4'
'-mfloat-abi=soft'  '-Og' '-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-fno-move-loop-invariants' '-Wextra' '-g3' '-T' 'mem.ld' '-T' 'libs.ld' '-T'
'sections.ld' '-nostartfiles' '-L../ldscripts' '-specs=nano.specs' '-v' 
'-dumpdir' './' '-dumpbase' 'f4b-lto.elf.ltrans0' '-fltrans' '-o'
'C:\Users\ilg\AppData\Local\Temp\cc7QvyUG.ltrans0.ltrans.o' '-march=armv7e-m'
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-ffreestanding' '-flto' '-fno-move-loop-invariants' '-Wall' '-Wextra' '-g3'
'-T' 'mem.ld' '-T' 'libs.ld' '-T' 'sections.ld' '-nostartfiles'
'-L../ldscripts' '-specs=nano.specs' '-v' '-o' 'f4b-lto.elf' '-march=armv7e-m'
Finished building target: f4b-lto.elf
---

In the initial folder using spaces, a project not using -flto link passed:

---
Building target: f4b.elf
Invoking: GNU ARM Cross C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Og
-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
-ffreestanding -fno-move-loop-invariants -Wall -Wextra  -g3 -T mem.ld -T
libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts"
-Wl,-Map,"f4b.map" --specs=nano.specs -v -o "f4b.elf" 
./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o  ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o  ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o  ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o 
./system/src/cmsis/system_stm32f4xx.o ./system/src/cmsis/vectors_stm32f407xx.o 
./src/BlinkLed.o ./src/Timer.o ./src/_initialize_hardware.o ./src/_write.o
./src/main.o ./src/stm32f4xx_hal_msp.o   
Using built-in specs.
Reading specs from c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
rename spec cpp_unique_options to nano_cpp_unique_options
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=c:/users/ilg/desktop/8.2.1\ \ \ \ \
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /Host/Work/arm-none-eabi-gcc-8.2.1-1.4/gcc/configure
--prefix=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc
--infodir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/info
--mandir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/man
--htmldir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/html
--pdfdir=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/share/doc/pdf
--build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
--target=arm-none-eabi --with-pkgversion='GNU MCU Eclipse ARM Embedded GCC\x2C
64-bit' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins
--enable-lto --disable-decimal-float --disable-libffi --disable-libgomp
--disable-libmudflap --disable-libquadmath --disable-libssp
--disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads
--disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes
--with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/Host/Work/arm-none-eabi-gcc-8.2.1-1.4/install/win64/arm-none-eabi-gcc/arm-none-eabi
--with-multilib-list=rmprofile --disable-rpath --disable-build-format-warnings
--with-system-zlib
Thread model: single
gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU MCU
Eclipse ARM Embedded GCC, 64-bit) 
COMPILER_PATH=c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../libexec/gcc/;c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp/;c:/users/ilg/desktop/8.2.1
   
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../lib/gcc/;c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/;c:/users/ilg/desktop/8.2.1
    1.4-20190207-1853/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-ffreestanding' '-fno-move-loop-invariants' '-Wall' '-Wextra' '-g3' '-T'
'mem.ld' '-T' 'libs.ld' '-T' 'sections.ld' '-nostartfiles' '-L../ldscripts'
'-specs=nano.specs' '-v' '-o' 'f4b.elf' '-march=armv7e-m'
 c:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../libexec/gcc/arm-none-eabi/8.2.1/collect2.exe
--sysroot=c:\users\ilg\desktop\8.2.1     1.4-20190207-1853\bin\../arm-none-eabi
-X -o f4b.elf -L../ldscripts -Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../arm-none-eabi/lib/thumb/v7e-m/nofp
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1
-Lc:/users/ilg/desktop/8.2.1     1.4-20190207-1853/bin/../lib/gcc
-Lc:/users/ilg/desktop/8.2.1    
1.4-20190207-1853/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib
-Lc:/users/ilg/desktop/8.2.1     1.4-20190207-1853/bin/../arm-none-eabi/lib
--gc-sections -Map f4b.map ./system/src/stm32f4-hal/stm32f4xx_hal.o
./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o
./system/src/stm32f4-hal/stm32f4xx_hal_dfsdm.o
./system/src/stm32f4-hal/stm32f4xx_hal_flash.o
./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o
./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o
./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o
./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o ./system/src/newlib/_cxx.o
./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o
./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o
./system/src/newlib/assert.o ./system/src/diag/Trace.o
./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o
./system/src/cortexm/_reset_hardware.o
./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f4xx.o
./system/src/cmsis/vectors_stm32f407xx.o ./src/BlinkLed.o ./src/Timer.o
./src/_initialize_hardware.o ./src/_write.o ./src/main.o
./src/stm32f4xx_hal_msp.o -lstdc++_nano -lm --start-group -lgcc -lg_nano
-lc_nano --end-group --start-group -lgcc -lc_nano --end-group -T mem.ld -T
libs.ld -T sections.ld
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mfloat-abi=soft' '-Og'
'-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections'
'-ffreestanding' '-fno-move-loop-invariants' '-Wall' '-Wextra' '-g3' '-T'
'mem.ld' '-T' 'libs.ld' '-T' 'sections.ld' '-nostartfiles' '-L../ldscripts'
'-specs=nano.specs' '-v' '-o' 'f4b.elf' '-march=armv7e-m'
Finished building target: f4b.elf
---


I might be wrong, but, if I read the message 'collect2.exe: fatal error:
CreateProcess...' correctly, it looks like collect2 is not able to start a
subprocess, probably lto-wrapper.exe or lto1.exe.

A possible reason for this is that collect2 gets confused by the space in the
path. lto*.exe are not in the system path, only '<top>/bin' is, where gcc/g++
are located. From here gcc/g++ probably compute a relative path to
'<top>/libexec/gcc/arm-none-eabi/8.2.1', where they find collect2.

collect2 must do the same to locate lto*.exe.

I'm not very familiar with the source code, so I don't know exactly where to
search for, but one starting point would be to investigate why gcc/g++ properly
identify collect2, and collect2 fails to identify lto*. Normally they shuld all
share the code to compute the relative path, but maybe they do not, or do not
call it the same.

If someone with more deep knowledge on how things work can suggest a place to
add extra debug messages, I can build new binaries to further investigate.


More information about the Gcc-bugs mailing list