-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
ld fails with The gap between .flash.rodata and .eh_frame_hdr must not exist to produce the final bin image.
(IDFGH-13388)
#14296
Comments
The gap between .flash.rodata and .eh_frame_hdr must not exist to produce the final bin image.
The gap between .flash.rodata and .eh_frame_hdr must not exist to produce the final bin image.
(IDFGH-13388)
@Equidamoid , I could not reproduce it with To know what exactly is wrong you may try two options:
|
@Lapshin, oh, it's not the blink example. The cmake boilerplate stuff was initially copypasted from the example and nobody bothered to rename the binary since it doesn't affect anything. Here is the partition table:
I added
|
@Equidamoid , ok, let's then add these two lines to your
Repeat the steps from my prior comment after modified |
@Equidamoid , is your project built with |
I'm pretty sure at least part of it has -fpic. Wil verify later today.
Sould I try removing it?
…On Tue, 20 Aug 2024, 14:34 Alexey Lapshin, ***@***.***> wrote:
@Equidamoid <https://github.com/Equidamoid> , is your project built with
-fpie or -fpic compile option? In case you don't know please grep build
logs for it
—
Reply to this email directly, view it on GitHub
<#14296 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACEWADGGCR7AR2VKIHPJTDZSMZUTAVCNFSM6AAAAABL6GBJFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJYG42DSNJRGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Indeed, a dependency (shared between esp and linux builds) has -fpic enabled. |
@Equidamoid , could you enable this only for linux builds? Seems it does not make sense to enable it for esp builds |
Without -fPIC I don't get the error anymore (and no, I didn't forget to uncomment it in the ld script :P). Is this a fix or a workaround? |
@Equidamoid , I think it's the solution for you. Because -fpic is usually used for linking with shared libraries OR if you want to embed your static library with position-independent code inside. In case you build a monolith application from sources to run on esp32 chip I don't see any advantages in using this flag BTW we wanted to distribute a library compiled with PIC but riscv linker is not ready for that https://sourceware.org/bugzilla/show_bug.cgi?id=31969 I'm closing this issue. If you have any others, please open a new one |
Understood. It is a solution for me indeed. And now others may be able to google this bug to find it =) Will it be worth documenting somewhere? I can imagine more people may |
@Equidamoid , thank you for your concern! I have already created a merge request in our internal repository to detect such configurations and provide a human-readable explanation to terminal if any are found. |
Answers checklist.
IDF version.
v5.3
Operating System used.
Linux
How did you build your project?
Command line with CMake
If you are using Windows, please specify command line type.
None
What is the expected behavior?
The project compiles.
What is the actual behavior?
When building the project for esp32-c3 the linker fails with:
The same project builds just fine for the esp32 and esp32-s2 targets.
Steps to reproduce.
idf_build_process
/idf_build_executable
)-DCMAKE_TOOLCHAIN_FILE=/path-to-esp-idf-v5/tools/cmake/toolchain-esp32c3.cmake
ninja flash
Unfortunately, I don't have a minimal shareable reproduction scenario.
Build or installation Logs.
The text was updated successfully, but these errors were encountered: