Merge "Use -Werror in bionic"
diff --git a/libc/include/android/api-level.h b/libc/include/android/api-level.h
index 7e3aa99..18825e7 100644
--- a/libc/include/android/api-level.h
+++ b/libc/include/android/api-level.h
@@ -57,5 +57,6 @@
 #define __ANDROID_API_N__ 24
 #define __ANDROID_API_N_MR1__ 25
 #define __ANDROID_API_O__ 26
+#define __ANDROID_API_O_MR1__ 27
 
 #endif /* ANDROID_API_LEVEL_H */
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
index d2fe05e..13c267a 100644
--- a/libc/libc.arm.map
+++ b/libc/libc.arm.map
@@ -1318,25 +1318,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map
index 6ed6619..9d8c1b7 100644
--- a/libc/libc.arm64.map
+++ b/libc/libc.arm64.map
@@ -1238,25 +1238,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index f8e7aa1..da462d3 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -1343,25 +1343,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.mips.map b/libc/libc.mips.map
index 9295c99..3e41f95 100644
--- a/libc/libc.mips.map
+++ b/libc/libc.mips.map
@@ -1302,25 +1302,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.mips64.map b/libc/libc.mips64.map
index 6ed6619..9d8c1b7 100644
--- a/libc/libc.mips64.map
+++ b/libc/libc.mips64.map
@@ -1238,25 +1238,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.x86.map b/libc/libc.x86.map
index 7752b01..c3d678c 100644
--- a/libc/libc.x86.map
+++ b/libc/libc.x86.map
@@ -1300,25 +1300,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libc/libc.x86_64.map b/libc/libc.x86_64.map
index 6ed6619..9d8c1b7 100644
--- a/libc/libc.x86_64.map
+++ b/libc/libc.x86_64.map
@@ -1238,25 +1238,25 @@
     wctrans_l; # introduced=26
 } LIBC_N;
 
-LIBC_P {
+LIBC_P { # introduced=P
   global:
-    __freading; # future
-    __fwriting; # future
-    getentropy; # future
-    getrandom; # future
-    getlogin_r; # future
-    glob; # future
-    globfree; # future
-    hcreate; # future
-    hcreate_r; # future
-    hdestroy; # future
-    hdestroy_r; # future
-    hsearch; # future
-    hsearch_r; # future
-    iconv; # future
-    iconv_close; # future
-    iconv_open; # future
-    syncfs; # future
+    __freading;
+    __fwriting;
+    getentropy;
+    getrandom;
+    getlogin_r;
+    glob;
+    globfree;
+    hcreate;
+    hcreate_r;
+    hdestroy;
+    hdestroy_r;
+    hsearch;
+    hsearch_r;
+    iconv;
+    iconv_close;
+    iconv_open;
+    syncfs;
 } LIBC_O;
 
 LIBC_PRIVATE {
diff --git a/libdl/libdl.arm.map b/libdl/libdl.arm.map
index 9fc9d23..1fcfc58 100644
--- a/libdl/libdl.arm.map
+++ b/libdl/libdl.arm.map
@@ -34,11 +34,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.arm64.map b/libdl/libdl.arm64.map
index bde6cab..8d4019c 100644
--- a/libdl/libdl.arm64.map
+++ b/libdl/libdl.arm64.map
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.map.txt b/libdl/libdl.map.txt
index d1f4ab8..002e9f8 100644
--- a/libdl/libdl.map.txt
+++ b/libdl/libdl.map.txt
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.mips.map b/libdl/libdl.mips.map
index bde6cab..8d4019c 100644
--- a/libdl/libdl.mips.map
+++ b/libdl/libdl.mips.map
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.mips64.map b/libdl/libdl.mips64.map
index bde6cab..8d4019c 100644
--- a/libdl/libdl.mips64.map
+++ b/libdl/libdl.mips64.map
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.x86.map b/libdl/libdl.x86.map
index bde6cab..8d4019c 100644
--- a/libdl/libdl.x86.map
+++ b/libdl/libdl.x86.map
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/libdl/libdl.x86_64.map b/libdl/libdl.x86_64.map
index bde6cab..8d4019c 100644
--- a/libdl/libdl.x86_64.map
+++ b/libdl/libdl.x86_64.map
@@ -33,11 +33,11 @@
     dlvsym; # introduced=24
 } LIBC;
 
-LIBC_OMR1 { # future
+LIBC_OMR1 { # introduced=27
   global:
-    __cfi_shadow_size; # future
-    __cfi_slowpath; # future
-    __cfi_slowpath_diag; # future
+    __cfi_shadow_size;
+    __cfi_slowpath;
+    __cfi_slowpath_diag;
 } LIBC_N;
 
 LIBC_PLATFORM {
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index a5ccd0f..4799739 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -208,7 +208,17 @@
 #endif
 
 static void __linker_cannot_link(const char* argv0) {
-  async_safe_fatal("CANNOT LINK EXECUTABLE \"%s\": %s", argv0, linker_get_error_buffer());
+  async_safe_format_fd(STDERR_FILENO,
+                       "CANNOT LINK EXECUTABLE \"%s\": %s\n",
+                       argv0,
+                       linker_get_error_buffer());
+
+  async_safe_format_log(ANDROID_LOG_FATAL,
+                        "linker",
+                        "CANNOT LINK EXECUTABLE \"%s\": %s",
+                        argv0,
+                        linker_get_error_buffer());
+  _exit(EXIT_FAILURE);
 }
 
 /*
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index aaf2c37..ceb0b4d 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -162,7 +162,7 @@
   chmod(helper.c_str(), 0755);
   ExecTestHelper eth;
   eth.SetArgs({ helper.c_str(), nullptr });
-  eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, -6, error_message.c_str());
+  eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, EXIT_FAILURE, error_message.c_str());
 #endif
 }
 
diff --git a/tests/sys_random_test.cpp b/tests/sys_random_test.cpp
index a25490c..78cbf4a 100644
--- a/tests/sys_random_test.cpp
+++ b/tests/sys_random_test.cpp
@@ -72,11 +72,6 @@
 
 TEST(sys_random, getrandom) {
 #if defined(HAVE_SYS_RANDOM)
-  if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
-    return;
-  }
-
   char buf1[64];
   char buf2[64];
 
@@ -90,11 +85,6 @@
 
 TEST(sys_random, getrandom_EFAULT) {
 #if defined(HAVE_SYS_RANDOM)
-  if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
-    return;
-  }
-
   errno = 0;
   ASSERT_EQ(-1, getrandom(nullptr, 256, 0));
   ASSERT_EQ(EFAULT, errno);
@@ -105,11 +95,6 @@
 
 TEST(sys_random, getrandom_EINVAL) {
 #if defined(HAVE_SYS_RANDOM)
-  if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
-    return;
-  }
-
   errno = 0;
   char buf[64];
   ASSERT_EQ(-1, getrandom(buf, sizeof(buf), ~0));