Move brillo closer to Android.

Hiding our legacy cruft seemed like a good idea, but in practice it will only
mean worse interoperability.

Plus we got it wrong, as the recent `putw` example showed.

Change-Id: I167c7168eff133889028089c22a7a0dfb8d6d0cf
This commit is contained in:
Elliott Hughes 2016-08-10 14:06:14 -07:00
parent f5042cab10
commit 5ffed9b856
10 changed files with 170 additions and 4351 deletions

View file

@ -1630,11 +1630,6 @@ cc_library {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.arm.map",
product_variables: {
brillo: {
version_script: "libc.arm.brillo.map",
},
},
shared: {
srcs: [
@ -1657,11 +1652,6 @@ cc_library {
mips: {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.mips.map",
product_variables: {
brillo: {
version_script: "libc.mips.brillo.map",
},
},
},
mips64: {
// Don't re-export new/delete and friends, even if the compiler really wants to.
@ -1673,11 +1663,6 @@ cc_library {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.x86.map",
product_variables: {
brillo: {
version_script: "libc.x86.brillo.map",
},
},
},
x86_64: {
// Don't re-export new/delete and friends, even if the compiler really wants to.

View file

@ -50,8 +50,8 @@
extern "C" {
// Brillo and LP64 don't need to support any legacy cruft.
#if !defined(__BRILLO__) && !defined(__LP64__)
// LP64 doesn't need to support any legacy cruft.
#if !defined(__LP64__)
// These were accidentally declared in <unistd.h> because we stupidly used to inline
// getpagesize() and __getpageshift(). Needed for backwards compatibility with old NDK apps.
@ -375,14 +375,11 @@ int dlmalloc_trim(size_t) {
return 0;
}
#endif // !defined(__BRILLO__) && !defined (__LP64__)
#if !defined(__LP64__)
// LP32's <stdio.h> had putw (but not getw).
// TODO: does brillo intentionally include this, or is there a missing `nobrillo`?
int putw(int value, FILE* fp) {
return fwrite(&value, sizeof(value), 1, fp) == 1 ? 0 : EOF;
}
#endif
#endif // !defined (__LP64__)
} // extern "C"

File diff suppressed because it is too large Load diff

View file

@ -1268,7 +1268,7 @@ LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduce
LIBC_O {
global:
bsd_signal; # arm x86 mips nobrillo versioned=26
bsd_signal; # arm x86 mips versioned=26
catclose; # future
catgets; # future
catopen; # future
@ -1396,11 +1396,11 @@ LIBC_PRIVATE {
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__futex_wait; # arm x86 mips
__futex_wake; # arm x86 mips
__gedf2; # arm
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__get_thread; # arm x86 mips
__get_tls; # arm x86 mips
__getdents64; # arm x86 mips
__gnu_ldivmod_helper; # arm
__gnu_uldivmod_helper; # arm
@ -1430,21 +1430,21 @@ LIBC_PRIVATE {
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__open; # arm x86 mips
__page_shift; # arm x86 mips
__page_size; # arm x86 mips
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__pthread_gettid; # arm x86 mips
__restore_core_regs; # arm
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sdidinit; # arm x86 mips
__set_errno; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__sinit; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
@ -1460,7 +1460,7 @@ LIBC_PRIVATE {
__udivsi3; # arm
__unorddf2; # arm
__unordsf2; # arm
__wait4; # arm x86 mips nobrillo
__wait4; # arm x86 mips
_fwalk; # arm x86 mips
_Unwind_Backtrace; # arm
_Unwind_Complete; # arm
@ -1481,40 +1481,40 @@ LIBC_PRIVATE {
android_getaddrinfofornetcontext;
android_gethostbyaddrfornet;
android_gethostbynamefornet;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
arc4random_addrandom; # arm x86 mips
arc4random_stir; # arm x86 mips
atexit; # arm
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
bcopy; # arm x86 mips
bzero; # arm x86 mips
dlmalloc; # arm x86 mips
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
ftime; # arm x86 mips
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getdents; # arm x86 mips
getdtablesize; # arm x86 mips
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
index; # arm x86 mips
issetugid; # arm x86 mips
memswap; # arm x86 mips
pthread_attr_getstackaddr; # arm x86 mips
pthread_attr_setstackaddr; # arm x86 mips
restore_core_regs; # arm
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
strntoimax; # arm x86 mips
strntoumax; # arm x86 mips
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_PLATFORM {

View file

@ -1293,7 +1293,7 @@ LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduce
LIBC_O {
global:
bsd_signal; # arm x86 mips nobrillo versioned=26
bsd_signal; # arm x86 mips versioned=26
catclose; # future
catgets; # future
catopen; # future
@ -1421,11 +1421,11 @@ LIBC_PRIVATE {
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__futex_wait; # arm x86 mips
__futex_wake; # arm x86 mips
__gedf2; # arm
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__get_thread; # arm x86 mips
__get_tls; # arm x86 mips
__getdents64; # arm x86 mips
__gnu_ldivmod_helper; # arm
__gnu_uldivmod_helper; # arm
@ -1455,21 +1455,21 @@ LIBC_PRIVATE {
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__open; # arm x86 mips
__page_shift; # arm x86 mips
__page_size; # arm x86 mips
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__pthread_gettid; # arm x86 mips
__restore_core_regs; # arm
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sdidinit; # arm x86 mips
__set_errno; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__sinit; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
@ -1486,7 +1486,7 @@ LIBC_PRIVATE {
__umoddi3; # x86 mips
__unorddf2; # arm
__unordsf2; # arm
__wait4; # arm x86 mips nobrillo
__wait4; # arm x86 mips
_fwalk; # arm x86 mips
_Unwind_Backtrace; # arm
_Unwind_Complete; # arm
@ -1507,40 +1507,40 @@ LIBC_PRIVATE {
android_getaddrinfofornetcontext;
android_gethostbyaddrfornet;
android_gethostbynamefornet;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
arc4random_addrandom; # arm x86 mips
arc4random_stir; # arm x86 mips
atexit; # arm
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
bcopy; # arm x86 mips
bzero; # arm x86 mips
dlmalloc; # arm x86 mips
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
ftime; # arm x86 mips
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getdents; # arm x86 mips
getdtablesize; # arm x86 mips
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
index; # arm x86 mips
issetugid; # arm x86 mips
memswap; # arm x86 mips
pthread_attr_getstackaddr; # arm x86 mips
pthread_attr_setstackaddr; # arm x86 mips
restore_core_regs; # arm
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
strntoimax; # arm x86 mips
strntoumax; # arm x86 mips
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_PLATFORM {

File diff suppressed because it is too large Load diff

View file

@ -1252,7 +1252,7 @@ LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduce
LIBC_O {
global:
bsd_signal; # arm x86 mips nobrillo versioned=26
bsd_signal; # arm x86 mips versioned=26
catclose; # future
catgets; # future
catopen; # future
@ -1290,24 +1290,24 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__bionic_brk; # arm x86 mips
__divdi3; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__futex_wait; # arm x86 mips
__futex_wake; # arm x86 mips
__get_thread; # arm x86 mips
__get_tls; # arm x86 mips
__getdents64; # arm x86 mips
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__open; # arm x86 mips
__page_shift; # arm x86 mips
__page_size; # arm x86 mips
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__pthread_gettid; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sdidinit; # arm x86 mips
__set_errno; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__sinit; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
@ -1318,44 +1318,44 @@ LIBC_PRIVATE {
__swsetup; # arm x86 mips
__udivdi3; # arm x86 mips
__umoddi3; # x86 mips
__wait4; # arm x86 mips nobrillo
__wait4; # arm x86 mips
_fwalk; # arm x86 mips
android_getaddrinfofornet;
android_getaddrinfofornetcontext;
android_gethostbyaddrfornet;
android_gethostbynamefornet;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
arc4random_addrandom; # arm x86 mips
arc4random_stir; # arm x86 mips
bcopy; # arm x86 mips
bzero; # arm x86 mips
dlmalloc; # arm x86 mips
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
ftime; # arm x86 mips
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getdents; # arm x86 mips
getdtablesize; # arm x86 mips
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
index; # arm x86 mips
issetugid; # arm x86 mips
memswap; # arm x86 mips
pthread_attr_getstackaddr; # arm x86 mips
pthread_attr_setstackaddr; # arm x86 mips
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
strntoimax; # arm x86 mips
strntoumax; # arm x86 mips
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_PLATFORM {

File diff suppressed because it is too large Load diff

View file

@ -1250,7 +1250,7 @@ LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduce
LIBC_O {
global:
bsd_signal; # arm x86 mips nobrillo versioned=26
bsd_signal; # arm x86 mips versioned=26
catclose; # future
catgets; # future
catopen; # future
@ -1289,24 +1289,24 @@ LIBC_PRIVATE {
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__divdi3; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__futex_wait; # arm x86 mips
__futex_wake; # arm x86 mips
__get_thread; # arm x86 mips
__get_tls; # arm x86 mips
__getdents64; # arm x86 mips
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__open; # arm x86 mips
__page_shift; # arm x86 mips
__page_size; # arm x86 mips
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__pthread_gettid; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sdidinit; # arm x86 mips
__set_errno; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__sinit; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
@ -1317,44 +1317,44 @@ LIBC_PRIVATE {
__swsetup; # arm x86 mips
__udivdi3; # arm x86 mips
__umoddi3; # x86 mips
__wait4; # arm x86 mips nobrillo
__wait4; # arm x86 mips
_fwalk; # arm x86 mips
android_getaddrinfofornet;
android_getaddrinfofornetcontext;
android_gethostbyaddrfornet;
android_gethostbynamefornet;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
arc4random_addrandom; # arm x86 mips
arc4random_stir; # arm x86 mips
bcopy; # arm x86 mips
bzero; # arm x86 mips
dlmalloc; # arm x86 mips
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
ftime; # arm x86 mips
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getdents; # arm x86 mips
getdtablesize; # arm x86 mips
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
index; # arm x86 mips
issetugid; # arm x86 mips
memswap; # arm x86 mips
pthread_attr_getstackaddr; # arm x86 mips
pthread_attr_setstackaddr; # arm x86 mips
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
strntoimax; # arm x86 mips
strntoumax; # arm x86 mips
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_PLATFORM {

View file

@ -37,8 +37,6 @@ def has_arch_tags(tags):
for arch in all_arches:
if arch in tags:
return True
if 'nobrillo' in tags:
return True
return False
@ -49,28 +47,21 @@ class VersionScriptGenerator(object):
basename = os.path.basename(script)
dirname = os.path.dirname(script)
for arch in all_arches:
for brillo in [False, True]:
has_nobrillo = False
name = basename.split(".")[0] + "." + arch + (".brillo" if brillo else "") + ".map"
tmp_path = os.path.join(bionic_temp, name)
dest_path = os.path.join(dirname, name)
with open(tmp_path, "w") as fout:
with open(script, "r") as fin:
fout.write("# %s\n" % warning)
for line in fin:
index = line.find("#")
if index != -1:
tags = line[index+1:].split()
if arch not in tags and has_arch_tags(tags):
continue
if brillo and "nobrillo" in tags:
has_nobrillo = True
continue
fout.write(line)
if not brillo or has_nobrillo:
shutil.copyfile(tmp_path, dest_path)
name = basename.split(".")[0] + "." + arch + ".map"
tmp_path = os.path.join(bionic_temp, name)
dest_path = os.path.join(dirname, name)
with open(tmp_path, "w") as fout:
with open(script, "r") as fin:
fout.write("# %s\n" % warning)
for line in fin:
index = line.find("#")
if index != -1:
tags = line[index+1:].split()
if arch not in tags and has_arch_tags(tags):
continue
fout.write(line)
shutil.copyfile(tmp_path, dest_path)
generator = VersionScriptGenerator()
generator.run()