Build GCC which always enable --eh-frame-hdr

Previously GCC disable --eh-frame-hdr for static executable.
Android needs --eh-frame-hdr at least for X86 and MIPS which use
eh frames.

See
1. example: 23e3137ee2897464b051599b85a09f130d3ad05d
2. patch for 4.8 https://android-review.googlesource.com/#/c/63181
3. backport to 4.6/4.7: https://android-review.googlesource.com/#/c/63182

Change-Id: I07e0d6a6388068c573f873e2cf2f9a687d271b13
diff --git a/build/tools/build-gcc.sh b/build/tools/build-gcc.sh
index c7fc70b..f98601e 100755
--- a/build/tools/build-gcc.sh
+++ b/build/tools/build-gcc.sh
@@ -342,6 +342,9 @@
     ;;
 esac
 
+# Enable linker option -eh-frame-hdr also for static executable
+EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --enable-eh-frame-hdr-for-static"
+
 cd $BUILD_OUT && run \
 $BUILD_SRCDIR/configure --target=$ABI_CONFIGURE_TARGET \
                         --enable-initfini-array \
diff --git a/build/tools/build-host-gcc.sh b/build/tools/build-host-gcc.sh
index 30b56a4..5d18279 100755
--- a/build/tools/build-host-gcc.sh
+++ b/build/tools/build-host-gcc.sh
@@ -1398,6 +1398,7 @@
     ARGS=$ARGS" --disable-nls"
     ARGS=$ARGS" --disable-werror"
     ARGS=$ARGS" --enable-target-optspace"
+    ARGS=$ARGS" --enable-eh-frame-hdr-for-static"
     # TODO: Build fails for libsanitizer which appears in 4.8. Disable for now.
     ARGS=$ARGS" --disable-libsanitizer"