cancel
Showing results for 
Search instead for 
Did you mean: 

Error compiling with makefile, threadX and NextDuo

massimoperdigo
Associate III

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).

 

1 ACCEPTED SOLUTION

Accepted Solutions
akorsich
Associate

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.)

View solution in original post

1 REPLY 1
akorsich
Associate

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.)