From f11aa95ee7f3c7c3a8538deefd084cdab351c01a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 25 Aug 2017 15:18:33 -0700 Subject: [PATCH] Pretend the functions didn't appear until 21. Because there was an accidental ABI breakage in 21, and we can't fix the past. It seems more useful to refuse to build code that won't work on any current or future device. Bug: https://issuetracker.google.com/37051826 Test: builds Change-Id: I4b5c30f899e2c7307642e2fb20e43a3ca14ae7fe --- libc/include/fts.h | 15 ++++++++++----- libc/libc.arm.map | 10 +++++----- libc/libc.arm64.map | 10 +++++----- libc/libc.map.txt | 10 +++++----- libc/libc.mips.map | 10 +++++----- libc/libc.mips64.map | 10 +++++----- libc/libc.x86.map | 10 +++++----- libc/libc.x86_64.map | 10 +++++----- 8 files changed, 45 insertions(+), 40 deletions(-) diff --git a/libc/include/fts.h b/libc/include/fts.h index 3649d3aff..8658fabda 100644 --- a/libc/include/fts.h +++ b/libc/include/fts.h @@ -116,11 +116,16 @@ typedef struct _ftsent { __BEGIN_DECLS -FTSENT* fts_children(FTS* __fts, int __options); -int fts_close(FTS* __fts); -FTS* fts_open(char* const* __path, int __options, int (*__comparator)(const FTSENT** __lhs, const FTSENT** __rhs)); -FTSENT* fts_read(FTS* __fts); -int fts_set(FTS* __fts, FTSENT* __entry, int __options); +/* + * Strictly these functions were available before Lollipop/21, but there was an accidental ABI + * breakage in 21 that means you can't write code that runs on current devices and pre-21 devices, + * so we break the tie in favor of current and future devices. + */ +FTSENT* fts_children(FTS* __fts, int __options) __INTRODUCED_IN(21); +int fts_close(FTS* __fts) __INTRODUCED_IN(21); +FTS* fts_open(char* const* __path, int __options, int (*__comparator)(const FTSENT** __lhs, const FTSENT** __rhs)) __INTRODUCED_IN(21); +FTSENT* fts_read(FTS* __fts) __INTRODUCED_IN(21); +int fts_set(FTS* __fts, FTSENT* __entry, int __options) __INTRODUCED_IN(21); __END_DECLS diff --git a/libc/libc.arm.map b/libc/libc.arm.map index fe1401847..31c2a532d 100644 --- a/libc/libc.arm.map +++ b/libc/libc.arm.map @@ -399,11 +399,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map index 7088adace..6cc6d6464 100644 --- a/libc/libc.arm64.map +++ b/libc/libc.arm64.map @@ -328,11 +328,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.map.txt b/libc/libc.map.txt index afc1c86ec..5cbfaeb4a 100644 --- a/libc/libc.map.txt +++ b/libc/libc.map.txt @@ -401,11 +401,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.mips.map b/libc/libc.mips.map index cb37ab2b9..34369ba00 100644 --- a/libc/libc.mips.map +++ b/libc/libc.mips.map @@ -397,11 +397,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.mips64.map b/libc/libc.mips64.map index 7088adace..6cc6d6464 100644 --- a/libc/libc.mips64.map +++ b/libc/libc.mips64.map @@ -328,11 +328,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.x86.map b/libc/libc.x86.map index 567a5bf73..76dffa555 100644 --- a/libc/libc.x86.map +++ b/libc/libc.x86.map @@ -395,11 +395,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile; diff --git a/libc/libc.x86_64.map b/libc/libc.x86_64.map index 7088adace..6cc6d6464 100644 --- a/libc/libc.x86_64.map +++ b/libc/libc.x86_64.map @@ -328,11 +328,11 @@ LIBC { ftruncate; ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21 ftrylockfile; - fts_children; - fts_close; - fts_open; - fts_read; - fts_set; + fts_children; # introduced=21 + fts_close; # introduced=21 + fts_open; # introduced=21 + fts_read; # introduced=21 + fts_set; # introduced=21 ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21 ftw64; # introduced=21 funlockfile;