Skip to content

cc1plus.exe fatal error #4682

Closed
Closed

Description

@roberbike

Hello.
I have this error compiling one proyect in windows 10.:

piobug

My platformio.ini has this flag that complile ok under linux :
build_flags =
${common.build_flags}
-D USER_SETUP_LOADED=1
-include /$PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI/User_Setups/Setup25_TTGO_T_Display.h

If I changue this line:
-include /$PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI/User_Setups/Setup25_TTGO_T_Display.h

by this other:
-include $PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI/User_Setups/Setup25_TTGO_T_Display.h

The proyect compile under windows 10 + vscode +platformio.
But not compile under linux. It is neccesary to put " / " to compile it.

There is an issue with platformio that cause this fault?

I asked here for this bug: https://community.platformio.org/t/cc1plus-exe-fatal-error/34551

Thanks.
Robert.

Activity

  1. added this to the 6.1.8 milestone on Jul 3, 2023
  2. roberbike commented on Jul 3, 2023

    @roberbike
    Author
  3. roberbike commented on Jul 3, 2023

    @roberbike
    Author

    This works under linux and windows:

    -include .pio/libdeps/${PIOENV}/TFT_eSPI/User_Setups/Setup25_TTGO_T_Display.h

  4. roberbike commented on Jul 3, 2023

    @roberbike
    Author
  5. ivankravets commented on Jul 3, 2023

    @ivankravets
    Member

    Sorry, I deleted my previous comment. This is actually a bug and we will fix it ASAP.

  6. ivankravets commented on Jul 3, 2023

    @ivankravets
    Member

    Thanks for the report. Please re-test with pio upgrade --dev.

  7. CapnBry commented on Jul 5, 2023

    @CapnBry

    I've tested with PlatformIO Core, version 6.1.9a1 as 6.1.8 has broken our build system entirely and I still have an include error issue. Our build flags have a relative path in them as the PlatformIO docs say

    Process file as if #include "file" appeared as the first line of the primary source file.

    However, the build system prepends the builder path directory as an absolute path to the include file, when it is actually in our PROJECT_DIR/include, which is already in -Iinclude

    build_flags =
    	${env_common_stm32.build_flags}
    	${radio_2400.build_flags}
    	${common_env_data.build_flags_tx}
    	-flto
    	-include target/FM30_TX.h
    

    Build output

    arm-none-eabi-gcc -o .pio\build\FM30_TX_via_DFU\FrameworkArduinoVariant\PeripheralPins.c.o -c -std=gnu11 -O2 -Wno-builtin-macro-redefined -Wall -flto -include C:\Users\bmayland\.platformio\platforms\ststm32\builder\target\FM30_TX.h ...
    

    Should I open a new issue for this or keep it here?

  8. ivankravets commented on Jul 5, 2023

    @ivankravets
    Member

    Could you provide a simple project (zip archive attached here) to reproduce this issue?

  9. CapnBry commented on Jul 5, 2023

    @CapnBry

    I apologize for my error, but I have misspoken in my previous message. The builder does properly support it if I supply an absolute path for the include file via a variable, but does not leave relative paths alone. It expands the relative path into the builder directory.

    I do not have a simple project to supply. I can work around this in our project by supplying the full path the -include file but that's a real problem because we'd now have to go back and cut new version of all our supported older versions so the build works again.

    The builder code here does not fire because the relative path does not exist (platformio/builder/tools/piobuild.py)

     if os.path.exists(p):
                    result["CCFLAGS"][i] = (f[0], os.path.abspath(p))
    
  10. ivankravets commented on Jul 5, 2023

    @ivankravets
    Member

    Please provide the 1 line from platformio.ini which works and another one that does not.

  11. CapnBry commented on Jul 5, 2023

    @CapnBry

    working

    build_flags =
    	${env_common_stm32.build_flags}
    	${radio_2400.build_flags}
    	${common_env_data.build_flags_tx}
    	-flto
    	-include ${PROJECT_DIR}/include/target/FM30_TX.h
    	-DUSBCON
    	-DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC
    	-DHSE_VALUE=16000000U
    	-DVECT_TAB_OFFSET=0x1000U
    	-Wl,--defsym=FLASH_APP_OFFSET=0x1000
    

    not working (what we had before

    build_flags =
    	${env_common_stm32.build_flags}
    	${radio_2400.build_flags}
    	${common_env_data.build_flags_tx}
    	-flto
    	-include target/FM30_TX.h
    	-DUSBCON
    	-DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC
    	-DHSE_VALUE=16000000U
    	-DVECT_TAB_OFFSET=0x1000U
    	-Wl,--defsym=FLASH_APP_OFFSET=0x1000
    
  12. ivankravets commented on Jul 5, 2023

    @ivankravets
    Member

    You need

    -include include/target/FM30_TX.h
    

    The cwd is the project root dir.

  13. CapnBry commented on Jul 5, 2023

    @CapnBry

    Oh I see! I appreciate that.

    In 6.1.8 it worked though, and for years it has worked. Not to be too snarky because I appreciate your help, but

    Process file as if #include "file" appeared as the first line of the primary source file.

    This file is in the include path and therefore should have no issue being included, so long as an absolute path was not added to it. Is there any way this can not be processed and have a bogus path added to it?

  14. ivankravets commented on Jul 5, 2023

    @ivankravets
    Member

    I think we can improve this behavior. I reopen this issue.

  15. modified the milestones: 6.1.8, 6.1.9 on Jul 5, 2023
  16. ivankravets commented on Jul 5, 2023

    @ivankravets
    Member

    Or, could I ask you to create a new issue and refer to this one? It's better for history.

  17. CapnBry commented on Jul 5, 2023

    @CapnBry

    Can do, will tag this issue in it too.

  18. added a commit that references this issue on May 28, 2024
    01ab1fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions