$OpenBSD: patch-x86-mingw32-build_sh,v 1.3 2017/06/02 14:30:03 espie Exp $
Index: x86-mingw32-build.sh
--- x86-mingw32-build.sh.orig
+++ x86-mingw32-build.sh
@@ -68,7 +68,7 @@ do
     # name, bearing no resemblance to the file requested.
     #
     ( manifest=`echo *`
-      $RUN wget $DOWNLOAD_HOST/$FILE$DOWNLOAD_OPTIONS && \
+      $RUN ftp -o $FILE $DOWNLOAD_HOST/$FILE$DOWNLOAD_OPTIONS && \
       { test -f $FILE || \
 	{ for file in `echo *`
 	  do
@@ -95,7 +95,7 @@ eval $RUN $CLEAN_SLATE_AT_START
 setbuilddir "$WORKING_DIR" .
 echo "done."
 
-MAKE=${MAKE-"make"}
+MAKE=${MAKE}
 PATH=$INSTALL_DIR/bin:$PATH
 unrecoverable="$script: unrecoverable error"
 
@@ -107,6 +107,10 @@ unrecoverable="$script: unrecoverable error"
 #
 ALL_GCC=all-gcc INSTALL_GCC=install-gcc
 
+# CLANG: Use -fgnu89-inline for bootstraping and then skip it for the rebuild
+CFLAGS_FOR_GCC_0="${CFLAGS_FOR_GCC}"
+CFLAGS_FOR_GCC="${CFLAGS_FOR_GCC} -fgnu89-inline -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-enum-conversion -Wno-ignored-attributes"
+
 # Progress the build, in two stages.
 #
 for STAGE in 1 2
@@ -124,7 +128,7 @@ $script: stage $STAGE: build $COMPONENT ..."
 	$RUN setbuilddir binutils*
 	$RUN ../configure --prefix="$INSTALL_DIR" --target="$TARGET" \
 	  $GLOBAL_BASE_OPTIONS $BINUTILS_BASE_OPTIONS \
-	  --with-sysroot="${INSTALL_DIR}" || die $? \
+	  --with-sysroot="${INSTALL_DIR}" --disable-werror || die $? \
           "$unrecoverable configuring binutils"
       fi
       $RUN $MAKE CFLAGS="`echo $CFLAGS_FOR_BINUTILS`" \
@@ -164,6 +168,7 @@ $script: stage $STAGE: build $COMPONENT ..."
       # Redefine `make' goals for STAGE 2 build...
       #
       ALL_GCC="" INSTALL_GCC="install"
+      CFLAGS_FOR_GCC="${CFLAGS_FOR_GCC_0}"
       ;;
 
     headers | mingw-runtime | w32api)
