Commit graph

37845 commits

Author SHA1 Message Date
Elliott Hughes
edf386b1f9 Use more compiler builtins for libm.
Once we have an llvm with https://reviews.llvm.org/D136508, we will be
able to defer to more compiler builtins, but for now let's do what we
can...

Test: llvm-objdump (plus the tests still pass!)
Change-Id: Ia5c704409ca88ab1a02342c1b5dde8525da95243
2022-12-12 16:40:46 +00:00
Elliott Hughes
a9fd9c2a44 Merge "Remove obsolete hacks for the fabs() family." am: 81168c00d8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2328560

Change-Id: Id9b3e842d935d5b369ebdb61b4175f5805d634f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 19:33:35 +00:00
Elliott Hughes
81168c00d8 Merge "Remove obsolete hacks for the fabs() family." 2022-12-08 18:03:06 +00:00
Elliott Hughes
591a2a798d Remove obsolete hacks for the fabs() family.
We don't support GCC any more, and clang's got better since this commit
was written. It doesn't produce _identical_ code, but it's a similar
single-instruction bit twiddle.

This also doesn't regress x86 for fabsl (that code looks the same before
and after) and there is no riscv32.

Test: llvm-objdump -d
Change-Id: I7acea6fd26f8760763f3744201ed42a99186562b
2022-12-05 20:58:15 +00:00
Elliott Hughes
73b32e5b0c Merge "Spring cleaning for the seccomp allowlist." am: c40ea825e7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324303

Change-Id: Ie570cec14ef055e6258001d9e950adb559175b30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 16:24:17 +00:00
Elliott Hughes
c40ea825e7 Merge "Spring cleaning for the seccomp allowlist." 2022-12-05 15:53:28 +00:00
Treehugger Robot
765b7e5952 Merge "Nullability check for stdlib module." am: 3f7c5a1753
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2320769

Change-Id: I40fd23c4977aaed762b3973c99bca947f8f55f3b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-03 07:24:29 +00:00
Treehugger Robot
3f7c5a1753 Merge "Nullability check for stdlib module." 2022-12-03 06:44:29 +00:00
Elliott Hughes
e5f266f6c4 Merge "Explicitly mention bionic's single C.UTF-8 locale." am: a226fb81f8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324302

Change-Id: I51b5665faea288a57535eff4cab1bec14fc115b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 22:29:19 +00:00
Elliott Hughes
a226fb81f8 Merge "Explicitly mention bionic's single C.UTF-8 locale." 2022-12-02 22:10:02 +00:00
zijunzhao
5a918d922b Nullability check for stdlib module.
Bugs: b/245972273
Test: None

Change-Id: Ib33a5359a924c21888f268158c4d7f824740dd55
2022-12-02 21:00:02 +00:00
Elliott Hughes
f9941705aa Spring cleaning for the seccomp allowlist.
Remove copy_file_range(2), preadv2(2), and pwritev2(2), all of which are
now in SYSCALLS.TXT.

Remove semtimedop_time64(2) since it doesn't make any sense to have an
exception for just the 64-bit-time_t-on-LP32 variant of a syscall we
don't even use --- this is the least likely variant of that syscall
to need an exception!

Also clean up the unnecessary foo:foo syntax (you only need the : if you
want the generated stub to have a different name, and here the names
were all identical _and_ the whole point of this file is to list
syscalls that we're not generating stubs for, this was doubly useless),
simplify the signatures to just the types (which is all we need), and
improve some of the commentary.

Test: treehugger
Change-Id: I691b5758a2165be9bbeafdd83f0c64d7eea987e5
2022-12-02 20:18:35 +00:00
Elliott Hughes
046fe15fb5 Explicitly mention bionic's single C.UTF-8 locale.
Test: treehugger
Change-Id: Iea45c0211d3476579f9778dfc7a0111f2e54a983
2022-12-02 20:15:42 +00:00
Elliott Hughes
23b2611cf8 Merge "fcntl: remove some duplication, fix a bug." am: 8262ca1dd8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2324643

Change-Id: Ia75e0bc052e3df46e4334cc7625b2180d03451de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 17:44:41 +00:00
Elliott Hughes
8262ca1dd8 Merge "fcntl: remove some duplication, fix a bug." 2022-12-02 17:19:16 +00:00
Jooyung Han
fa8b45adff Merge "linker_namespace: move sonames instead of copying" am: d2e85ae45b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2319860

Change-Id: I353715ed4c72fa02177349012faad23e7d11c871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 06:31:13 +00:00
Jooyung Han
d2e85ae45b Merge "linker_namespace: move sonames instead of copying" 2022-12-02 06:12:43 +00:00
Elliott Hughes
1e59e2a88d fcntl: remove some duplication, fix a bug.
Treehugger didn't test 32-bit (and neither, of course, had I), so we
didn't notice until the next day that I'd only added the new check to
the 64-bit codepath. Let's just unify the two, since there's only one
line of meaningful difference.

Bug: http://b/261092827
Test: treehugger
Change-Id: I5178257a76fe24a340b3659c85ad29ed0a7b8b50
2022-12-02 02:56:50 +00:00
Florian Mayer
9bf7ccd3cc Merge "[MTE] test for exception cleanup." am: 7c2ce66b52
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2175188

Change-Id: I1cf60c15fac5dab7590e24dc5abedbd7c2750190
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 01:23:21 +00:00
Florian Mayer
7c2ce66b52 Merge "[MTE] test for exception cleanup." 2022-12-02 00:54:32 +00:00
Elliott Hughes
6198821b0a Merge "Add some missing "Available since" documentation." am: 008aa172d4
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2322714

Change-Id: Ib66f734da746bd1c0590a74220c903bf77d27c43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 16:26:32 +00:00
Elliott Hughes
57c8d0adcb Merge "Tell people when they've messed up with fcntl(FD_SETFD)." am: 43ed024522
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1990812

Change-Id: Ied843d7e9d8fa603f3e76cd6de760efdb29a610e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 16:26:08 +00:00
Elliott Hughes
008aa172d4 Merge "Add some missing "Available since" documentation." 2022-12-01 16:21:58 +00:00
Elliott Hughes
43ed024522 Merge "Tell people when they've messed up with fcntl(FD_SETFD)." 2022-12-01 15:58:39 +00:00
Jooyung Han
57b03decd1 linker_namespace: move sonames instead of copying
android_namespace_link_t::shared_lib_sonames_ is unorderd_set<string>.
When initializing, it's copied a few times unnecessarily.
- when add_linked_namespace is called
- when android_namespace_link_t() is called
- when push_back is called.

Now, it's moved around after the initial creation.

Bug: n/a
Test: atest --test-mapping .
Change-Id: I283954bb0c0bbf94ebd74407137f492e08fd41bd
2022-12-01 16:23:03 +09:00
Elliott Hughes
dfe67d266c Tell people when they've messed up with fcntl(FD_SETFD).
This is a subtle bug that even experts struggle with.

Test: treehugger
Change-Id: If9cf16a1c32c836f5688bb3374cfd21d55125b17
2022-11-30 20:19:22 +00:00
Elliott Hughes
d4fd67ce69 Add some missing "Available since" documentation.
Also fix formatting of `errno` in one function.

Test: treehugger
Change-Id: Ibf362bcd36c901dab2a422afe09e0f78011315aa
2022-11-30 19:55:32 +00:00
Treehugger Robot
9c3f282c5a Merge "Remove stale TODO." am: 196e5b8514
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2309326

Change-Id: I7bf028c6b0aaf320db1a5ef3d25fd9866385a24b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 14:27:38 +00:00
Treehugger Robot
196e5b8514 Merge "Remove stale TODO." 2022-11-30 13:54:47 +00:00
Elliott Hughes
d2eaa336bd Merge "Remove remaining "ASCII binary blobs"." am: c88467704f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2309609

Change-Id: I7d3fdfc5ef55caa41cf14453b56103ba2deae09b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 16:40:23 +00:00
Elliott Hughes
c88467704f Merge "Remove remaining "ASCII binary blobs"." 2022-11-29 16:24:11 +00:00
Elliott Hughes
a0faeb299d Remove remaining "ASCII binary blobs".
We stopped accepting new code in this form (compiler output from
compilers we don't have compiling source we don't have [or possibly the
same source we do have --- how would be know?]) years ago, but never
went back to clean up existing instances.

This doesn't affect the string/memory routines, which are intelligible,
nor all of the libm stuff (we're keeping the intelligible subset), but
does affect all the trig functions.

The right way to do this is to either have commented hand-written
assembler (which we have always taken, and will continue to take) or to
have C/C++ source that can be built with LLVM (which will then be built
as part of the regular build). This is what we do for arm/arm64, for
example, with the C/C++ source coming from
https://github.com/ARM-software/optimized-routines and being mirrored
in external/arm-optimized-routines, and built by Android's clang at
build time.

Test: treehugger
Change-Id: Icd69ef34b8a9ea16ea2b7d5d6587c2a9143b7740
2022-11-18 20:15:40 +00:00
Martin Stjernholm
4c4015b3cc Remove stale TODO.
As of https://r.android.com/2304013 classloader namespaces are no
longer called "classloader-namespace". However, this whole TODO is
stale - it was supposed to be addressed in O and it only applies to
compat code for SDK < 24, so there is no use fixing it now.

Test: N/A - comment change only
Bug: 258340826
Change-Id: Id09e262191cea236224196a4a4268331d5cf84c6
2022-11-18 13:54:14 +00:00
Elliott Hughes
4bfa3e385d Merge "Move to arm-optimized-routines memset()." am: db681c0223
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2307216

Change-Id: I60bcf6ed92653f6b8fa92021b715362821827cc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 22:40:01 +00:00
Elliott Hughes
db681c0223 Merge "Move to arm-optimized-routines memset()." 2022-11-17 22:18:42 +00:00
Elliott Hughes
b968a2fc3e Merge "Switch to the arm-optimized-routines memcpy() and memmove()." am: 361ab5beab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305594

Change-Id: I2f57a9a160d3ea92a04e9bc7ac5cbd6b5504ea8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 19:48:54 +00:00
Elliott Hughes
023e4e7840 Move to arm-optimized-routines memset().
This one's a bit simpler, because there is only one upstream memset()
implementation.

Test: treehugger
Change-Id: I2536d0eb72adaacfa6a0e40d2bd29fc833988c16
2022-11-17 19:28:06 +00:00
Elliott Hughes
361ab5beab Merge "Switch to the arm-optimized-routines memcpy() and memmove()." 2022-11-17 19:25:25 +00:00
Elliott Hughes
1c652bded3 Merge "Add invalid riscv64 ELF files for the linker tests." am: 1b1bb3543d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2303265

Change-Id: I15d5f9530fd8b077842f6a6b6b4702a8aa4ff12e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 16:25:47 +00:00
Elliott Hughes
1b1bb3543d Merge "Add invalid riscv64 ELF files for the linker tests." 2022-11-17 15:51:01 +00:00
Elliott Hughes
7daf4596b7 Switch to the arm-optimized-routines memcpy() and memmove().
Outsource this to them, and choose the best of the two options available
based on the hardware we're running on.

Test: treehugger
Change-Id: I2fa7555c971b64a6decca132210e901ffa248efa
2022-11-17 00:38:49 +00:00
Treehugger Robot
265920e997 Merge "Implement __memset_chk as a copy & paste of __memcpy_chk." am: d26d3c0b5c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305394

Change-Id: Ia29bbd268c3e5eb558728baf73a901abb1edd416
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 23:51:03 +00:00
Treehugger Robot
d26d3c0b5c Merge "Implement __memset_chk as a copy & paste of __memcpy_chk." 2022-11-16 23:33:14 +00:00
Treehugger Robot
4895b28b50 Merge "Move memcpy_base.S into memcpy.S." am: 6c599e3a67
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305393

Change-Id: Iff6c5e640f203b56b4e4bb0270850bdfcb129b51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 22:12:50 +00:00
Treehugger Robot
c7a0f0edc5 Merge "Remove assembler wmemmove()." am: 06868c8646
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305392

Change-Id: Iaa17a2c05ecb684c5ef193feda96314ab9c82563
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 22:11:59 +00:00
Treehugger Robot
6c599e3a67 Merge "Move memcpy_base.S into memcpy.S." 2022-11-16 22:11:53 +00:00
Treehugger Robot
06868c8646 Merge "Remove assembler wmemmove()." 2022-11-16 21:59:04 +00:00
Elliott Hughes
3cc366d3a2 Implement __memset_chk as a copy & paste of __memcpy_chk.
These two will stay behind when we move memcpy()/memmove()/memset() over
to arm-optimized-routines (which leaves fortify to us).

Test: treehugger
Change-Id: Ie683f71a5a141263ce3f4e8811df9eaf667584f4
2022-11-16 21:07:56 +00:00
Elliott Hughes
d5ac40cc9f Move memcpy_base.S into memcpy.S.
Just to make it clear that there's nothing interesting going on here ---
there's just one user, and the only symbol here is __memcpy().

Test: treehugger
Change-Id: I62d72c43c4c6d30442f05c1e08a0cb1a1ec42a8a
2022-11-16 18:50:54 +00:00
Elliott Hughes
0d4d276253 Remove assembler wmemmove().
The compiler turns our C wmemmove() into one shift instruction and a
branch, which is plenty for a function no-one uses anyway.

Why don't I just leave this alone, since we already have it? Because I'm
looking at finishing the project of "switch to arm-optimized-routines"
and getting rid of our assembler here, and Arm agrees that this isn't
worth having optimized assembler for in their optimized assembler
project, judging by its absence.

Test: treehugger
Change-Id: I985801241a8cbd7dbda51a447946affb1402effb
2022-11-16 18:44:56 +00:00