Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linker failure when using SPIFFS or LittleFS with Arduino as component #8768

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

blackhack
Copy link
Contributor

Description of Change

This fixes this linker error:

c:/users/david/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\framework-arduinoespressif32\libframework-arduinoespressif32.a(vfs_api.o):(.literal._ZN11VFSFileImplD2Ev+0x4): undefined reference to `vtable for fs::FileImpl'

Tests scenarios

It can be tested on any of the examples of SPIFFS or LittleFS.
For some reason it only happens when using Arduino as component on the latest version which uses IDF 5.1, no idea why a normal Arduino project links fine, because we are declaring a virtual function on the base class, but not defining it in the same class, so we should create a empty definition or just make it pure-virtual.

    if(!LittleFS.begin()){
        Serial.println("LittleFS Mount Failed");
        return;
    }

@CLAassistant
Copy link

CLAassistant commented Oct 15, 2023

CLA assistant check
All committers have signed the CLA.

@Jason2866 Jason2866 self-requested a review October 15, 2023 13:41
@Jason2866
Copy link
Collaborator

Jason2866 commented Oct 15, 2023

@me-no-dev For some strange reason the issue does not happen when the sdkconfig setting CONFIG_COMPILER_OPTIMIZATION_SIZE=y is set. So it does not happen with the Arduino Lib Builder.

@me-no-dev
Copy link
Member

Nice catch! I wonder how we have not hit this before.

@me-no-dev me-no-dev merged commit 4b3aebe into espressif:master Oct 17, 2023
36 checks passed
mhaberler pushed a commit to mhaberler/arduino-esp32 that referenced this pull request Nov 23, 2023
@tshcherban
Copy link

is this going to be cherry-picked to a 2.x release?

@Jason2866
Copy link
Collaborator

@tshcherban Just opened a PR for backporting this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants