Merge "Fix gcc test issues."
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 268db78..98f0fd7 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -62,24 +62,6 @@
 #define stdout stdout
 #define stderr stderr
 
-#define	__SLBF	0x0001		/* line buffered */
-#define	__SNBF	0x0002		/* unbuffered */
-#define	__SRD	0x0004		/* OK to read */
-#define	__SWR	0x0008		/* OK to write */
-	/* RD and WR are never simultaneously asserted */
-#define	__SRW	0x0010		/* open for reading & writing */
-#define	__SEOF	0x0020		/* found EOF */
-#define	__SERR	0x0040		/* found error */
-#define	__SMBF	0x0080		/* _buf is from malloc */
-#define	__SAPP	0x0100		/* fdopen()ed in append mode */
-#define	__SSTR	0x0200		/* this is an sprintf/snprintf string */
-/* #define __SOPT 0x0400 --- historical (do fseek() optimization). */
-/* #define __SNPT 0x0800 --- historical (do not do fseek() optimization). */
-/* #define __SOFF 0x1000 --- historical (set iff _offset is in fact correct). */
-#define	__SMOD	0x2000		/* true => fgetln modified _p text */
-#define	__SALC	0x4000		/* allocate string space dynamically */
-#define	__SIGN	0x8000		/* ignore this file in _fwalk */
-
 /*
  * The following three definitions are for ANSI C, which took them
  * from System V, which brilliantly took internal interface macros and
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 0360ba7..524e6de 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -125,6 +125,25 @@
   off64_t (*_seek64)(void*, off64_t, int);
 };
 
+// Values for `__sFILE::_flags`.
+#define __SLBF 0x0001  // Line buffered.
+#define __SNBF 0x0002  // Unbuffered.
+// RD and WR are never simultaneously asserted: use _SRW instead.
+#define __SRD  0x0004  // OK to read.
+#define __SWR  0x0008  // OK to write.
+#define __SRW  0x0010  // Open for reading & writing.
+#define __SEOF 0x0020  // Found EOF.
+#define __SERR 0x0040  // Found error.
+#define __SMBF 0x0080  // `_buf` is from malloc.
+#define __SAPP 0x0100  // fdopen()ed in append mode.
+#define __SSTR 0x0200  // This is an sprintf/snprintf string.
+// #define __SOPT 0x0400 --- historical (do fseek() optimization).
+// #define __SNPT 0x0800 --- historical (do not do fseek() optimization).
+// #define __SOFF 0x1000 --- historical (set iff _offset is in fact correct).
+#define __SMOD 0x2000  // true => fgetln modified _p text.
+#define __SALC 0x4000  // Allocate string space dynamically.
+#define __SIGN 0x8000  // Ignore this file in _fwalk.
+
 // TODO: remove remaining references to these obsolete flags.
 #define __SNPT 0
 #define __SOPT 0
diff --git a/tools/relocation_packer/Android.mk b/tools/relocation_packer/Android.mk
index 35c97a8..2bf77b9 100644
--- a/tools/relocation_packer/Android.mk
+++ b/tools/relocation_packer/Android.mk
@@ -30,7 +30,7 @@
   src/packer.cc \
   src/sleb128.cc \
 
-LOCAL_STATIC_LIBRARIES := libelf
+LOCAL_STATIC_LIBRARIES := libelf libz
 LOCAL_C_INCLUDES := external/elfutils/src/libelf
 LOCAL_MODULE := lib_relocation_packer
 
@@ -45,7 +45,7 @@
 LOCAL_CPP_EXTENSION := .cc
 
 LOCAL_SRC_FILES := src/main.cc
-LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf
+LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
 
 # Statically linking libc++ to make it work from prebuilts
 LOCAL_CXX_STL := libc++_static
@@ -70,7 +70,7 @@
   src/sleb128_unittest.cc \
   src/packer_unittest.cc \
 
-LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf
+LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
 LOCAL_C_INCLUDES := external/elfutils/src/libelf
 
 LOCAL_CPPFLAGS := $(common_cppflags)