Skip to content

Commit a64859e

Browse files
committed
Add -O0 -g to host GCC and Binutils and add extra build step for Newlib
Signed-off-by: Yuriy Kolerov <[email protected]>
1 parent 5d014e8 commit a64859e

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

Makefile.in

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,9 @@ stamps/build-binutils-newlib: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) $(PREPARATI
661661
--disable-sim \
662662
--disable-libdecnumber \
663663
--disable-readline \
664-
$(WITH_ISA_SPEC)
664+
$(WITH_ISA_SPEC) \
665+
CFLAGS="-O0 -g" \
666+
CXXFLAGS="-O0 -g"
665667
$(MAKE) -C $(notdir $@)
666668
$(MAKE) -C $(notdir $@) install
667669
mkdir -p $(dir $@) && touch $@
@@ -682,7 +684,9 @@ stamps/build-gdb-newlib: $(GDB_SRCDIR) $(GDB_SRC_GIT) $(PREPARATION_STAMP)
682684
--disable-binutils \
683685
--disable-ld \
684686
--disable-gold \
685-
--disable-gprof
687+
--disable-gprof \
688+
CFLAGS="-O0 -g" \
689+
CXXFLAGS="-O0 -g"
686690
$(MAKE) -C $(notdir $@)
687691
$(MAKE) -C $(notdir $@) install
688692
mkdir -p $(dir $@) && touch $@
@@ -716,16 +720,18 @@ stamps/build-gcc-newlib-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binuti
716720
$(WITH_TUNE) \
717721
$(WITH_ISA_SPEC) \
718722
$(GCC_EXTRA_CONFIGURE_FLAGS) \
723+
CFLAGS="-O0 -g" \
724+
CXXFLAGS="-O0 -g" \
719725
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
720726
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
721727
$(MAKE) -C $(notdir $@) all-gcc
722728
$(MAKE) -C $(notdir $@) install-gcc
723729
mkdir -p $(dir $@) && touch $@
724730

725-
stamps/build-newlib: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib-stage1
726-
rm -rf $@ $(notdir $@)
727-
mkdir $(notdir $@)
728-
cd $(notdir $@) && $</configure \
731+
stamps/configure-newlib: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib-stage1
732+
rm -rf $@ stamps/build-newlib build-newlib
733+
mkdir build-newlib
734+
cd build-newlib && $</configure \
729735
--target=$(NEWLIB_TUPLE) \
730736
$(CONFIGURE_HOST) \
731737
--prefix=$(INSTALL_DIR) \
@@ -736,14 +742,17 @@ stamps/build-newlib: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib-
736742
CFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections $(CFLAGS_FOR_TARGET)" \
737743
CXXFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" \
738744
$(NEWLIB_TARGET_FLAGS)
745+
mkdir -p $(dir $@) && touch $@
746+
747+
stamps/build-newlib: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/configure-newlib
739748
$(MAKE) -C $(notdir $@)
740749
$(MAKE) -C $(notdir $@) install
741750
mkdir -p $(dir $@) && touch $@
742751

743-
stamps/build-newlib-nano: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib-stage1
744-
rm -rf $@ $(notdir $@)
745-
mkdir $(notdir $@)
746-
cd $(notdir $@) && $</configure \
752+
stamps/configure-newlib-nano: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib-stage1
753+
rm -rf $@ stamps/build-newlib-nano build-newlib-nano
754+
mkdir build-newlib-nano
755+
cd build-newlib-nano && $</configure \
747756
--target=$(NEWLIB_TUPLE) \
748757
$(CONFIGURE_HOST) \
749758
--prefix=$(builddir)/install-newlib-nano \
@@ -761,6 +770,9 @@ stamps/build-newlib-nano: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-ne
761770
CFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CFLAGS_FOR_TARGET)" \
762771
CXXFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" \
763772
$(NEWLIB_TARGET_FLAGS)
773+
mkdir -p $(dir $@) && touch $@
774+
775+
stamps/build-newlib-nano: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/configure-newlib-nano
764776
$(MAKE) -C $(notdir $@)
765777
$(MAKE) -C $(notdir $@) install
766778
mkdir -p $(dir $@) && touch $@
@@ -824,6 +836,8 @@ stamps/build-gcc-newlib-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-newlib
824836
$(WITH_TUNE) \
825837
$(WITH_ISA_SPEC) \
826838
$(GCC_EXTRA_CONFIGURE_FLAGS) \
839+
CFLAGS="-O0 -g" \
840+
CXXFLAGS="-O0 -g" \
827841
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
828842
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
829843
$(MAKE) -C $(notdir $@)

0 commit comments

Comments
 (0)