From d10d9a1770fa5f404a0bbd63e37aad9d68094f43 Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Fri, 15 Jul 2011 02:21:27 +0000 Subject: [PATCH] arch/*-pc: Attempt to fix both x86_64 and i386 builds on x86_64 hosts Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@40148 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/i386-pc/kernel/mmakefile.src | 2 +- arch/x86_64-pc/kernel/mmakefile.src | 2 +- config/make.tmpl | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/i386-pc/kernel/mmakefile.src b/arch/i386-pc/kernel/mmakefile.src index fce0d37a29..ab49e948c0 100644 --- a/arch/i386-pc/kernel/mmakefile.src +++ b/arch/i386-pc/kernel/mmakefile.src @@ -21,7 +21,7 @@ kernel-kernel-pc-i386 :: $(OUTDIR)/smpboot.bin.o kernel-kernel-pc-i386-kobj :: $(OUTDIR)/smpboot.bin.o %rule_compile basename=smpbootstrap targetdir=$(OBJDIR) -%rule_link_binary file=$(OUTDIR)/smpboot.bin.o name=smpbootstrap objs=$(OBJDIR)/smpbootstrap.o ldflags="--oformat=elf32-i386" +%rule_link_binary file=$(OUTDIR)/smpboot.bin.o name=smpbootstrap objs=$(OBJDIR)/smpbootstrap.o ldflags="-m elf_i386" -include $(OBJDIR)/smpbootstrap.d diff --git a/arch/x86_64-pc/kernel/mmakefile.src b/arch/x86_64-pc/kernel/mmakefile.src index c35d041347..dfac3a65c9 100644 --- a/arch/x86_64-pc/kernel/mmakefile.src +++ b/arch/x86_64-pc/kernel/mmakefile.src @@ -34,7 +34,7 @@ kernel-kernel-pc-x86_64-pkg :: $(DESTDIR)/smpboot.bin.o USER_CFLAGS := -m32 %rule_compile basename=smpbootstrap targetdir=$(OBJDIR) -%rule_link_binary file=$(DESTDIR)/smpboot.bin.o name=smpbootstrap objs=$(OBJDIR)/smpbootstrap.o +%rule_link_binary file=$(DESTDIR)/smpboot.bin.o name=smpbootstrap objs=$(OBJDIR)/smpbootstrap.o ldflags="-m elf_i386" -include $(OBJDIR)/smpbootstrap.d diff --git a/config/make.tmpl b/config/make.tmpl index 18eff6b1c7..2cc2717c66 100644 --- a/config/make.tmpl +++ b/config/make.tmpl @@ -2652,9 +2652,8 @@ BD_TMPDIR := $(GENDIR)/$(CURDIR) %(file) : %(objs) $(BD_OUTDIR) @$(ECHO) Linking $(subst $(TARGETDIR)/,,$@)... - @$(CC) -Wl,-Ttext=%(start) -nostartfiles -nostdlib -o $(BD_TMPDIR)/%(name).elf %(objs) - @$(OBJCOPY) --target binary $(BD_TMPDIR)/%(name).elf $(BD_TMPDIR)/%(name) - @cd $(BD_TMPDIR) && $(KERNEL_LD) -r --format binary %(ldflags) %(name) -o $@ + $(LD) %(ldflags) --entry=0 -oformat=binary -Ttext=%(start) -o $(BD_TMPDIR)/%(name) %(objs) + cd $(BD_TMPDIR) && $(AROS_LD) -r --format binary %(name) -o $@ GLOB_MKDIRS += $(BD_OUTDIR) -- 2.11.4.GIT