Skip to content

Commit bddf9d0

Browse files
fix optional libload inclusion [fix #388]
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent 2e76f2f commit bddf9d0

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/linker.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ linker_script: $(STATIC_FILES) $(LINKED_FILES) $(SHARED_FILES)
5454
$(Q)$(call APPEND,provide ___ctors_count = .ctors.length / 3)
5555
$(Q)$(call APPEND,provide ___dtors_count = .dtors.length / 3)
5656
$(Q)$(call APPEND,provide ___fini_array_count = .fini_array.length / 3)
57-
$(Q)$(call APPEND,require __start$(comma) lib.LibLoad if .libs.length)
57+
$(Q)$(call APPEND,require __start)
58+
$(Q)$(call APPEND,library "../lib/libload/libload.lib" neveroptional)
59+
$(Q)$(call APPEND,require lib.LibLoad if .libs.length)
5860
$(Q)$(call APPEND)
5961
$(Q)$(call APPEND_FILES,source ,crt,$(sort $(CRT_FILES)))
6062
$(Q)$(call APPEND_FILES,source ,ce,$(sort $(CE_FILES)))

src/makefile.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ MKDIR = $(call NATIVEMKDR,$(call QUOTE_ARG,$(call NATIVEPATH,$1)))
110110
UPDIR_ADD = $(subst ../,_../,$(subst \,/,$1))
111111
UPDIR_RM = $(subst _../,../,$(subst \,/,$1))
112112

113+
FASMG_LIB = $(patsubst %,"%",$(subst ",\",$(subst \,\\,$(call NATIVEPATH,$1))))
113114
FASMG_FILES = $(subst $(space),$(comma) ,$(patsubst %,"%",$(subst ",\",$(subst \,\\,$(call NATIVEPATH,$1)))))#"
114115
LINKER_SCRIPT ?= $(CEDEV_TOOLCHAIN)/meta/linker_script
115116

@@ -165,11 +166,10 @@ endif
165166
# find all required/optional libload libraries
166167
LIBLOAD_LIBS ?= $(wildcard $(CEDEV_TOOLCHAIN)/lib/libload/*.lib) $(EXTRA_LIBLOAD_LIBS)
167168
LIBLOAD_LIBS := $(filter-out %libload.lib,$(LIBLOAD_LIBS))
168-
REQ_LIBLOAD := $(CEDEV_TOOLCHAIN)/lib/libload/libload.lib
169-
REQ_LIBLOAD += $(filter-out $(addprefix %,$(addsuffix .lib,$(LIBLOAD_OPTIONAL))),$(LIBLOAD_LIBS))
169+
REQ_LIBLOAD := $(filter-out $(addprefix %,$(addsuffix .lib,$(LIBLOAD_OPTIONAL))),$(LIBLOAD_LIBS))
170170
OPT_LIBLOAD := $(filter $(addprefix %,$(addsuffix .lib,$(LIBLOAD_OPTIONAL))),$(LIBLOAD_LIBS))
171-
REQ_LIBLOAD := $(patsubst %,"%",$(subst ",\",$(subst \,\\,$(call NATIVEPATH,$(REQ_LIBLOAD)))))
172-
OPT_LIBLOAD := $(patsubst %,"%",$(subst ",\",$(subst \,\\,$(call NATIVEPATH,$(OPT_LIBLOAD)))))
171+
REQ_LIBLOAD := $(call FASMG_LIB,$(REQ_LIBLOAD))
172+
OPT_LIBLOAD := $(call FASMG_LIB,$(OPT_LIBLOAD))
173173
OPT_LIBLOAD := $(foreach lib,$(OPT_LIBLOAD),$(lib)$(space)optional)
174174
LDLIBS := $(subst $(space),$(comma)$(space),$(strip $(REQ_LIBLOAD)$(space)$(OPT_LIBLOAD)))
175175
LDLIBS := $(subst $(comma)$(space)optional,$(space)optional,$(LDLIBS))

tools/fasmg/fasmg-ez80

Submodule fasmg-ez80 updated 1 file

0 commit comments

Comments
 (0)