Browse Source

Install the glibc and linux headers before stage1

I thought this was a problem with the build, but it turns out that was
actually related to my bad (and now reverted) patch from earlier this
week.

Regardless, this is the canonical way to build a cross compiler so now
that it's done I don't see a reason not to use it.
pull/32/head
Palmer Dabbelt 11 years ago
parent
commit
de00a614eb
  1. 26
      Makefile.in

26
Makefile.in

@ -63,11 +63,31 @@ stamps/build-binutils-linux: src/binutils
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
stamps/build-linux-headers:
mkdir -p $(SYSROOT)/usr/
cp -R $(srcdir)/linux-headers/include $(SYSROOT)/usr/
mkdir -p $(dir $@) && touch $@
stamps/build-glibc-linux-headers: src/glibc
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
mkdir -p $(SYSROOT)/usr/lib $(SYSROOT)/lib
cd $(notdir $@) && CC= $(CURDIR)/$</configure \
--host=riscv$(XLEN)-unknown-linux-gnu \
--prefix=/usr \
libc_cv_forced_unwind=yes \
libc_cv_c_cleanup=yes \
--enable-shared \
--enable-__thread \
--disable-multilib \
--enable-kernel=2.6.32
$(MAKE) -C $(notdir $@) install-headers install_root=$(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-glibc-linux: src/glibc stamps/build-gcc-linux-stage1
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
mkdir -p $(SYSROOT)/usr/lib $(SYSROOT)/lib
cp -R $(srcdir)/linux-headers/include $(SYSROOT)/usr/
cd $(notdir $@) && CC= $(CURDIR)/$</configure \
--host=riscv$(XLEN)-unknown-linux-gnu \
--prefix=/usr \
@ -81,7 +101,9 @@ stamps/build-glibc-linux: src/glibc stamps/build-gcc-linux-stage1
$(MAKE) -C $(notdir $@) install install_root=$(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-gcc-linux-stage1: src/gcc stamps/build-binutils-linux
stamps/build-gcc-linux-stage1: src/gcc stamps/build-binutils-linux \
stamps/build-glibc-linux-headers \
stamps/build-linux-headers
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $(CURDIR)/$</configure \

Loading…
Cancel
Save