eclipse-plugins icon indicating copy to clipboard operation
eclipse-plugins copied to clipboard

External Builder: Cannot run program "rm": Command line too long

Open fanghuaqi opened this issue 6 months ago • 5 comments

Hello, I have a big project which have a lot of files, and I faced a issue during link and clean process, it is caused by windows 32k command line limit, I have searched in website, found the following bugs

  • related to long rm command line https://bugs.eclipse.org/bugs/show_bug.cgi?id=505882
  • related to long link command line https://bugs.eclipse.org/bugs/show_bug.cgi?id=72965

For the first one, is current embedded cdt also fixed, for our IDE based on embedded cdt, this issue still present, but I can manually change the C/C++ Build -> Tool Chain Editor -> Current builder -> Gnu Make Builder select it and do Apply and close, and then do clean project and build project, and clean project, then you will see the clean target changed.

# orginal target 
clean:
	-$(RM) $(CCM_DEPS)$(C_UPPER_DEPS)$(SECONDARY_LIST)$(SECONDARY_SIZE)$(CXXM_DEPS)$(C_DEPS)$(CC_DEPS)$(SX_DEPS)$(C++_DEPS)$(OBJS)$(CXX_DEPS)$(SECONDARY_FLASH)$(ASM_DEPS)$(S_UPPER_DEPS)$(C++M_DEPS)$(CPP_DEPS) 2222.elf
	-@echo ' '
# new target
clean:
	-$(RM) 2222.elf 2222.hex 2222.lst 2222.siz
	-@echo ' '

I have create a project to test it, you can check it in ide_better_clean-target.zip, this is a git maintained project, so just check last commit change via git log -1 -p

Regarding the link command line too long issue, we can try with gcc response file like this

We can add new line in elf generation target like this

@echo 'Building target: $@'
# Add after it
@echo 'Generate response file: [email protected]'
$(file >[email protected],$(OBJS) $(USER_OBJS) $(LIBS))
# replace key words
In later lines replace $(OBJS) $(USER_OBJS) $(LIBS) to @[email protected]

Then it can fix linker command line too long issue, but can this be done directly in embedded cdt?

Thanks Huaqi

fanghuaqi avatar Sep 25 '25 04:09 fanghuaqi

These are very old CDT issues, not specific to ECDT.

ilg-ul avatar Sep 25 '25 06:09 ilg-ul

These are very old CDT issues, not specific to ECDT.

Thanks, so if we want to fix it, it needs to be fixed in CDT, and then ECDT will be automatically fixed?

fanghuaqi avatar Sep 26 '25 01:09 fanghuaqi

For compatibility reasons, ECDT is based on slightly older code.

If the fixes are in the code that ECDT inherits, yes; if the changes are in more recent code, no.

ilg-ul avatar Sep 27 '25 08:09 ilg-ul

Okay, thanks @ilg-ul , I also create a issue in cdt https://github.com/eclipse-cdt/cdt/issues/1316, hope this old issue could be fixed soon

fanghuaqi avatar Sep 28 '25 07:09 fanghuaqi

hope this old issue could be fixed soon

Yeah, good luck with this.

ilg-ul avatar Sep 29 '25 07:09 ilg-ul