Skip to content

MSYS2 build fails - link command is too long and fails unpredictably #2129

@Catnip-Consumer

Description

@Catnip-Consumer

The final Link command ends up being > 24KB in length. This causes compile to fail with MSYS2 (and Windows in general?) because of some arbitrary command length limitations. The solution is to use a response file to store $(OBJS_REL). However, I am not sure where the change would be best done. To fix it locally, here is the change I did:

$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
	$(file >${OBJ_DIR}/objects.rsp,$(OBJS_REL))
	@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ @objects.rsp $(LIB) | cat
	@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ <objs> <libs> | cat"
	$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent

I'm not a makefile expert someone with more experience should probably do this change in the appropriate way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions