-ifeq "$(ROOT)" ""
- cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
- cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
- cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
- cd $(DIR_APP) && sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in
+ifeq "$(PASS)" "2"
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/gcc-4.4.3-startfiles_fix-1.patch
+
+ cd $(DIR_APP) && sed -i gcc/Makefile.in \
+ -e 's@\./fixinc\.sh@-c true@' \
+ -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
+
+ for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
+ -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h); do \
+ echo "Processing $${file}..."; \
+ sed -i $${file} \
+ -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
+ -e 's@/usr@/tools@g'; \
+ echo '#undef STANDARD_INCLUDE_DIR' >> $${file}; \
+ echo '#define STANDARD_INCLUDE_DIR 0' >> $${file}; \
+ echo '#define STANDARD_STARTFILE_PREFIX_1 ""' >> $${file}; \
+ echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
+ done
+endif
+endif