Skip to content

Commit

Permalink
Linker definition in toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Nov 18, 2016
1 parent 5197e2c commit 3dc186b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion makefiles/defs.mk
Expand Up @@ -46,5 +46,5 @@ MODOBJS += $(OOBJDIR)/mod_$$(LIBNAME_$(1)).o
$(OOBJDIR)/mod_$$(LIBNAME_$(1)).o: $$(OBJS_$(1))
@ mkdir -p $$(dir $$@)
$(QECHO) MODLD $$(patsubst %/,%,$(1))
$(Q) $(CC) $(CFLAGS) -Lld -Tmodule.ld -r -s -o $$@ $$?
$(Q) $(LD) $(CFLAGS) -Lld -Tmodule.ld -r -o $$@ $$?
endef
2 changes: 1 addition & 1 deletion makefiles/rules.mk
Expand Up @@ -37,7 +37,7 @@ $(OOBJDIR)/%.o: $(SRCDIR)/%.s
$(BIN).elf: $(KERNOBJS) $(OOBJDIR)/modules-linked.o
@ mkdir -p $(dir $@)
$(QECHO) LD $(subst $(OIMGDIR)/,,$@)
$(Q) $(CC) $(CFLAGS) -Lld -Tsystem.ld -o $@ -Wl,--start-group $^ -Wl,--end-group
$(Q) $(LD) $(CFLAGS) -Lld -Tsystem.ld -o $@ -Wl,--start-group $^ -Wl,--end-group

$(BIN).elf.strip: $(BIN).elf
$(Q) $(STRIP) -o $@ $^
Expand Down
1 change: 1 addition & 0 deletions makefiles/toolchain.mk
Expand Up @@ -26,6 +26,7 @@ else
endif

CC=$(PREFIX)g++
LD=$(PREFIX)g++
AR=$(PREFIX)ar
OBJCOPY=$(PREFIX)objcopy
STRIP=$(PREFIX)strip
Expand Down

0 comments on commit 3dc186b

Please sign in to comment.