Skip to content

Commit

Permalink
Link subproject object files directly.
Browse files Browse the repository at this point in the history
Instead of merging all subproject object files into subproject.o, we now create subproject.txt containing a list of all object files, and use these directly in SUBPROJECT_OBJ_FILES.
  • Loading branch information
triplef committed Jan 29, 2021
1 parent a2737b3 commit 434f957
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2021-01-29 Frederik Seiffert <[email protected]>

* Instance/rules.make:
* Instance/subproject.make:
* common.make:
Link subproject object files directly. Instead of merging all
subproject object files into subproject.o, we now create
subproject.txt containing a list of all object files, and use these
directly in SUBPROJECT_OBJ_FILES.
This enables building on platforms like Windows MSVC where `ld -r` is
not supported, and generally avoids issues with incremental linking
that have historically existed in some linker versions.

2021-01-18 Fred Kiefer <[email protected]>

* Documentation/news.texi: Update for upcoming release.
Expand Down
4 changes: 3 additions & 1 deletion Instance/rules.make
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ endif

ifneq ($($(GNUSTEP_INSTANCE)_SUBPROJECTS),)
SUBPROJECT_OBJ_FILES = $(foreach d, $($(GNUSTEP_INSTANCE)_SUBPROJECTS), \
$(addprefix $(GNUSTEP_BUILD_DIR)/$(d)/, $(GNUSTEP_OBJ_DIR_NAME)/$(SUBPROJECT_PRODUCT)))
$(foreach o, $(shell cat \
$(GNUSTEP_BUILD_DIR)/$(d)/$(GNUSTEP_OBJ_DIR_NAME)/$(SUBPROJECT_PRODUCT)), \
$(addprefix $(GNUSTEP_BUILD_DIR)/$(d)/, $(o))))
endif

OBJC_OBJS = $(patsubst %.m,%.m$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
Expand Down
2 changes: 1 addition & 1 deletion Instance/subproject.make
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT): $(OBJ_FILES_TO_LINK)
ifeq ($(OBJ_FILES_TO_LINK),)
$(WARNING_EMPTY_LINKING)
endif
$(ECHO_LINKING)$(OBJ_MERGE_CMD)$(END_ECHO)
@echo "$(OBJ_FILES_TO_LINK)" > $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)

#
# Build-header target for framework subprojects
Expand Down
2 changes: 1 addition & 1 deletion common.make
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ endif
#
# Common variables for subprojects
#
SUBPROJECT_PRODUCT = subproject$(OEXT)
SUBPROJECT_PRODUCT = subproject.txt

#
# Set JAVA_HOME if not set.
Expand Down

0 comments on commit 434f957

Please sign in to comment.