Skip to main content
Associate III
July 23, 2024
Solved

Error compiling with makefile, threadX and NextDuo

  • July 23, 2024
  • 1 reply
  • 2129 views

Hello,

I have an issue when compiling a makefile from a project using an STM32H5 and ThreadX with NetXduo library.
this is the error i have:

make[1]: arm-none-eabi-gcc: Argument list too long
make[1]: *** [Makefile:1119: build/TheBlueBox-v2_AZURE_NS.elf] Error 127
make[1]: Leaving directory '/cygdrive/c/TheBlueBox/FW/TheBlueBox_AZURE/TheBlueBox-v2_AZURE/Makefile/NonSecure'
make: *** [Makefile:88: all] Error 2

Argument list is too long... What should i do?
i am compiling with windows 10.

I've attached the makefile (All has been generated with cubemx 6.12.0).

 

This topic has been closed for replies.
Best answer by akorsich

The list of objects created by the makefile is very long.

 

I found a solution here on StackOverflow https://stackoverflow.com/questions/54975220/arm-non-eabi-ld-argument-list-too-long

 

but simple answer is replace the following in the makefile:

 

$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
	$(SZ) $@

 

with this:

 

$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
	@echo "INPUT($(OBJECTS))" > $(BUILD_DIR)/objects.txt
	$(CC) $(BUILD_DIR)/objects.txt $(LDFLAGS) -o $@
	-rm -f $(BUILD_DIR)/objects.txt
	$(SZ) $@

 

(creates a text file to store the list of objects too, passes that to the compiler, and deletes the file.)

1 reply

akorsichBest answer
Associate
July 24, 2024

The list of objects created by the makefile is very long.

 

I found a solution here on StackOverflow https://stackoverflow.com/questions/54975220/arm-non-eabi-ld-argument-list-too-long

 

but simple answer is replace the following in the makefile:

 

$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
	$(SZ) $@

 

with this:

 

$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
	@echo "INPUT($(OBJECTS))" > $(BUILD_DIR)/objects.txt
	$(CC) $(BUILD_DIR)/objects.txt $(LDFLAGS) -o $@
	-rm -f $(BUILD_DIR)/objects.txt
	$(SZ) $@

 

(creates a text file to store the list of objects too, passes that to the compiler, and deletes the file.)