Commit graph

480 commits

Author SHA1 Message Date
Christopher Ferris
9ce28844db Update to v4.19 kernel headers.
Test: Builds and boots.
Change-Id: I99a9ed79666e143b47f02ca4e59eed94f69b7e4a
(cherry picked from commit a981e2e52e)
2018-10-30 09:21:16 -07:00
Christopher Ferris
f2484aaed7 Fix handling of #elif.
When a construct like:

if defined(something)
  blocks1
elif 1
  blocks2
else
  blocks3
endif

The parser would put the first clause but then simply omit the elif and
put all of blocks2 without a terminating #endif. The code also did
something similar when the #else was an #endif.

Also convert all of the unit tests to real unit tests and only run
them if you run cpp.py by itself. Added new unit tests to cover the
new cases.

Test: Ran cpp.py unit tests.
Test: Reran update_all.py and verified nothing changed, and that running
Test: it on the new kernel headers that exposed this problem.
Change-Id: Ie168511303c4e15afdb60c37baef75a966ca29a8
2018-10-26 22:42:26 +00:00
Christopher Ferris
76a1d45599 Update to v4.17.3 kernel headers.
Test: Builds, boots on a walleye.
Change-Id: I389d8b61ec00ea309e38d1b1a2e0dace48c21edb
2018-06-27 14:12:29 -07:00
Christopher Ferris
764049dce4 Modify the script to use the linux source tree.
The current code checks out the android kernel tree. Long ago, we moved
to using the linux kernel source code. Modify the script to actually
do this.

Bug: 6653610

Test: Ran the script using the --download_kernel option and without.
Change-Id: I769e769edea272f4f8c9c8d2e76bd336059c66e3
2018-05-24 15:10:33 -07:00
Christopher Ferris
5ed15ba733 Remove ion.h from bionic uapi headers.
Bug: 77976082

Test: Ran the generate script and verified ion.h is deleted.
Change-Id: I33b3aeef66f08f35dd496a073931b2fe2c80a1d6
2018-04-24 13:33:30 -07:00
Christopher Ferris
038ef23f62 Use the ion.h from the kernel headers.
All code that needs to use the frozen version of ion.h header should
have a copy, so move to the version as parsed from the real headers.

Test: Compiled and boots.
Change-Id: If9feae9c163ca64c4862045e86611fd3cf1fc18e
2018-02-22 20:22:14 +00:00
Christopher Ferris
934ec94955 Update to v4.15 kernel headers.
Test: Compiles, boots bullhead/hikey960.
Change-Id: I118beb8b6cac0881b1270f9bf6981959297a41a8
2018-02-01 10:51:01 -08:00
Elliott Hughes
64f355ffbd Use in_addr in ip_mreq_source and ip_msfilter.
This adds a new mechanism to say "replace struct S with #include <bits/S.h>".

Also switch epoll_event over to the new mechanism.

Also use the kernel's struct sockaddr_storage directly rather than behind
an unnecessary #define.

This patch also removes some dead code in the header scrubber. This code
still needs rewriting completely. I learned that a "block" isn't necessarily
a single struct definition, say; it might be a run of them. It seems like
a block is a run of preprocessor directives or a run of regular code.

Bug: https://issuetracker.google.com/36987220
Test: new test
Change-Id: Ic6a5c09559766a4babe3cd4c3ea538b885e07308
2017-12-14 10:07:27 -08:00
Elliott Hughes
8c75675ec6 Merge "Change ARG_MAX/_SC_ARG_MAX back to a constant." 2017-11-16 21:46:49 +00:00
Elliott Hughes
baed51ee3a Change ARG_MAX/_SC_ARG_MAX back to a constant.
As per the lkml thread https://lkml.org/lkml/2017/11/1/946.

Bug: http://b/65818597
Test: ran tests
Change-Id: I7a0610e6903e6761f2b31416e2f5017bd7a60659
2017-11-15 15:14:35 -08:00
Christopher Ferris
1308ad3ab3 Update to kernel headers v4.14.
Remove the hiding of the kernel structure binder_fd_array_object. This
structure now matches the structure used in the binder code.

Load the libclang_android.so shared library directly for parsing.
This file changed name in a recent update to the prebuilts.

Test: Compiles arm/arm64/x86/x86_64.
Test: Boots on hikey and boots on a sailfish.
Test: Ran bionic unit tests on hikey and sailfish.
Change-Id: I141a4b93ac3511cd58f4d12bb3c0d4efaa4c2742
2017-11-15 12:23:56 -08:00
Stephen Crane
77bb564dc7 Use env to invoke python
/usr/bin/python may be python3. We should respect PATH to find the python
executable so it can be locally overridden to be python2.

Test: Build libc, repo upload
Change-Id: Iaddd7cd4a1c2177c32786e4fa0fc664ab0ad36de
2017-08-31 15:11:50 -07:00
Christopher Ferris
02ce96835b Revert "Revert "Move back to the previous version of ion.h.""
This reverts commit 89d6c321f8.

Reason for revert: Still a bunch of branches/builds depending on this incorrectly.

Change-Id: I8de678848b0e5445837c02c0942f7388d27dbfd7
2017-08-03 18:55:45 +00:00
Christopher Ferris
89d6c321f8 Revert "Move back to the previous version of ion.h."
This reverts commit 1a0344d65d.

Reason for revert: Fixed the original problem.

Change-Id: Ibf4ba05160048a3216e0cc49cc88519f73d00fa4
2017-08-01 19:32:14 +00:00
Christopher Ferris
1a0344d65d Move back to the previous version of ion.h.
The new kernel headers changed this and lots of parts of the tree
want the old definition, so restore the previous version.

Test: Builds.
Change-Id: I725e56bb7c51c9fcd23ebc4b67eac33d66e196e7
2017-07-29 13:45:07 -07:00
Christopher Ferris
525ce914ed Update to kernel headers v4.12.3.
Test: Built angler.
Change-Id: Icbcf4fac2334de8409b049ed7a3b4c24b4e98ce9
2017-07-27 16:01:39 -07:00
Elliott Hughes
5059939c87 Enable exporting the non-uapi scsi headers.
Callers are supposed to #include <scsi/sg.h> but if we tell soong to add
bionic/libc/kernel/android/ to the include path, the uapi headers in there
would be (unintentionally) accessible as either <linux/name.h> or
<uapi/linux/name.h>.

Bug: N/A (hit while upgrading strace to 4.17)
Test: builds
Change-Id: I8d47dd51da688c38f747a255d401dfb2c209c805
2017-05-25 19:17:55 -07:00
Elliott Hughes
96c1db7b9d Remove the repetitive warnings from the uapi headers.
Having

  WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS

every four lines made the headers harder to read, made the diffs much worse
each time we upgraded, and wasn't really providing any benefit. Before the
next uapi update, let's just stop doing this.

Bug: N/A
Test: builds, manually inspected files look right
Change-Id: Id7088cf750894c9d24950f3d53587fe3156c4f7d
2017-05-25 13:48:01 -07:00
Elliott Hughes
497ad30d7d Make union semun usable.
This is a bit bogus because it's been removed from glibc (though not
thoroughly) and is never useful on Android (because the system calls
in question are compiled out of Android kernels, and SELinux would
disallow them even if you weren't running an Android kernel). This
also means that on glibc you need to include <linux/sem.h> for this
and on bionic you need <sys/sem.h> (and for either if you #include
the other file, you won't get this union).

Bug: https://github.com/android-ndk/ndk/issues/400
Test: added new test
Change-Id: I47f721da77515531f616d6ad8479bfbc9b60ee47
2017-05-18 15:05:26 -07:00
Christopher Ferris
ee1e0a34ae Update static functions/macro definitions.
Fix the list of static functions coming from swab.h to match the
ones exported by glibc.

Force the definition of __HAVE_BUILTIN_BSWAP{16,32,64}__ so the headers
use the builtin.

Add a unit test to guarantee that kernel header updates do not break this.

Test: Built and booted angler.
Test: Built the bionic unit tests for arm, arm64, mips, x86, x86_64.
Test: Ran the new test on angler and glibc.

Change-Id: I4ce229e3f198c204186d72bf22dd97b5cdf239e4
2017-04-21 20:59:53 -07:00
Christopher Ferris
b7e8fe5412 Merge "Refactor the kernel update scripts." 2017-03-03 23:40:12 +00:00
Christopher Ferris
15d3fef0da Refactor the kernel update scripts.
The previous versions of the scripts did a lot of redundant changes
and were hard to follow.

I rewrote most of update_all.py so that it's clear about what's going on.

I updated clean_header.py to change the cleanupFile function so that
there is no magic about where the destination file is going to wind up.
Now the caller specifies the final location.

I updated utils.py so that if you are trying to do an update in one
location, but your lunch target is from another location, it causes
an error.

Bug: 35726570

Change-Id: Ic5a44d90c2774a627eecde34c0c403bc925a497c
Test: Ran the updater and verified it works properly.
Test: Verified that doing an update in one tree to another tree
Test: fails.
2017-03-02 15:21:42 -08:00
Christopher Ferris
5f41ce25c6 Merge "Update to kernel headers v4.10." 2017-02-27 20:09:54 +00:00
Elliott Hughes
893fd97cdc Use <linux/eventpoll.h> to implement <sys/epoll.h>.
Bug: https://github.com/android-ndk/ndk/issues/302
Test: builds
Change-Id: Ia3074326a128c38f2488e342c028cc030801cfd9
2017-02-23 17:26:24 -08:00
Christopher Ferris
48af7cb2e2 Update to kernel headers v4.10.
Test: Built angler, booted on angler, ran bionic unit tests.
Change-Id: Ia24511e74106116ea84b44ab724865ec492de8f9
2017-02-21 14:42:34 -08:00
Treehugger Robot
b88112dcfc Merge "bionic: move ADF uapi header out of bionic" 2017-02-01 04:38:15 +00:00
Greg Hackmann
7518109063 bionic: move ADF uapi header out of bionic
ADF isn't a candidate for upstreaming and isn't (directly) usable from
unprivileged NDK code, so it makes more sense to keep video/adf.h as a
private header inside libadf, where it'll still be usable by HWC
implementations without shipping in the NDK.

libadf exports its entire include/ directory, so this shouldn't have any
impact on HWC implementations that already link against libadf.

Test: mmm system/core/adf/libadf
Test: /data/nativetest64/adf-unit-tests/adf-unit-tests (on Nexus 9)
Change-Id: I6573f539cfd7fc65433237d0b115b8b7b2728133
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-01-27 13:01:51 -08:00
Christopher Ferris
351a796d2d Update to kernel headers v4.9.6.
Test: Built arm/arm64/x86/x86_64 targets.
Change-Id: Id4d2711aaa96fe537f3726a0a89f2959e9cca34a
2017-01-27 10:49:48 -08:00
Christopher Ferris
6a9755d20a Update to kernel headers v4.9.3.
Test: Built arm, arm64, x86, x86_64 targets.
Test: Booted on angler, and ran bionic unit tests (32 bit and 64 bit).

Change-Id: I14a8dcbea11b41f83431eabed6590cd25af07b1d
2017-01-25 16:23:56 -08:00
Christopher Ferris
49f525c47b Update to kernel headers v4.8.14.
Test: Built mips/arm/arm64/x86/x86_64. Built and booted angler.
Change-Id: Icedb035769d8a41a170a6f1ecd707113e332d8dd
2016-12-12 19:08:01 -08:00
Christopher Ferris
106b3a8a7d Update to kernel headers v4.7.2.
Modify the kernel header update script to rename C++ keyword
struct members to something else. This fixes problems when including
these kernel files in C++ code.

Also, make a manual change to linux/fib_rules.h and comment out the
value FRA_PAD since it conflicts with a special android kernel value
FRA_UID_START that has not been upstreamed yet.

Test: Built aosp_angler, aosp_x86_64, aosp_mips (bionic only)
Test: Booted on angler and ran bionic unit tests
Test: Built these changes in internal master

Change-Id: Ia22b7e3ca409404696dba76311f49157f4a9ceed
2016-08-29 12:07:13 -07:00
Elliott Hughes
7c59f3f6f3 Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>.
Also fix <sys/ipc.h>.

Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.

x86 -- which works differently to everything else -- tested on the host.

Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
2016-08-18 15:23:38 -07:00
Elliott Hughes
38dba2e7e1 Fix sysconf(_SC_ARG_MAX).
ARG_MAX hasn't been a constant since Linux 2.6.23.

Bug: http://lists.landley.net/pipermail/toybox-landley.net/2016-August/008592.html
Change-Id: I1eddb562751604c75b89fa610d79be0655c53693
Test: ran the bionic tests on device and against glibc
2016-08-10 15:51:06 -07:00
Christopher Ferris
5956b4e314 More kernel header cleanup.
Modify the generate script to add a new option and copy the types.h
arm header file since it's not currently being created properly. Also
manually generate the arm types.h uapi header since it's not being
properly generated right now.

Modify both generate scripts to delete the target directories before
adding the files to handle moved/deleted header files.

Move the common/scsi headers into android and delete the common
directory. Change the scripts to reflect this change.

Update the scsi headers since they've been modified in upstream kernels.

Bug: 30072483

Change-Id: Ia43d4b238b6a041350d60cc30184ecbd4829d7d5
2016-07-22 12:21:25 -07:00
Christopher Ferris
d6e8b8ca56 Move/remove android only kernel uapi headers.
Move all of the uapi kernel headers that are only found in the android
kernel, and are still used by the tree into their own directory.

Delete all of these files that are not used.

Also, delete binder.h from the linux directory since it already exists
in the linux/android directory.

Bug: 30072483
Change-Id: I879f16e366f7670b8be3546b0a9cf9567fce6526
2016-07-19 12:43:56 -07:00
Christopher Ferris
2974eeca4c Update the kernel header documentation.
Change the references to using the android kernel source, to use
the linux stable source code repository.

Change-Id: Ibc6c90fc67c80bef235459bb3af31656f4d403ac
2016-07-08 15:29:51 -07:00
Christopher Ferris
82ef6a19cb Updated to v4.4.11 kernel headers.
Change-Id: I6b55a921670d32d7bfff3c304d8001058409d3f7
2016-05-19 17:03:14 -07:00
Christopher Ferris
05d08e9716 Updated to v4.4.1 kernel headers.
Small modifications needed to allow compilation with the new headers:

- Manually modify bionic/libc/kernel/uapi/asm-mips/asm/siginfo.h to
  remove the uapi from the include.
- PR_XXX defines are now available for mips, so remove the definition
  from linker_mips.cpp.

Bug: 23789423
Change-Id: I6dc8a03b012426d3a937db15cb24d3a50fab5a8c
2016-02-05 16:03:55 -08:00
Elliott Hughes
f8a2243ebe <netinet/udp.h> should include <linux/udp.h>.
The comment about "other stuff" referred to pre-uapi headers. Everything
in the current <linux/udp.h> should be exposed to userspace. The only
problem is that BSD and Linux use different names for the members of
struct udphdr. We can move the Linux udphdr out of the way and use an
anonymous union to get the best of both worlds. (Though unfortunately
this means that code that includes <linux/udp.h> directly instead of
using <netinet/udp.h> now won't have any definition of struct udphdr.
We've taken the stance in the past that you shouldn't include a linux/
header if there's a standard equivalent --- you should rely on us
transitively including it for you.)

Change-Id: Ie625892441b0edd8df3b76d3fcf2cbe299077bc4
2015-09-22 12:34:13 -07:00
Christopher Ferris
6048173b36 Import scsi headers.
Linux's scsi headers are a mix of userspace-facing and kernel-facing
declarations that can't be directly used by userspace.  The glibc
maintainers manually copy-and-pasted these definitions into their own
scsi headers and haven't substantially updated them in 15 years.  musl
has a similar set of definitions in its scsi headers.

This change generates the scsi headers from external/kernel-headers,
using the updated generation script so that the single modified scsi.h
takes the place of the non-modified one.

Change-Id: Ic14d155aa534b0edc1ee686d61113ce5cdf0e6af
2015-09-17 21:22:44 -07:00
Christopher Ferris
d12c332018 Add support for manually modified kernel headers.
This changes the scripts so that if some kernel files exists
in external/kernel-headers/modified, that they will be preferred
over the same files found in original. This is to support the case
where the kernel headers cannot be taken without some small modifications.

Included with this change, is a general cleanup of the python scripts.

This also modifies the generate uapi headers script to indicate if the
source of the modified headers has changed.

Change-Id: Id13523b244ced52a2ecd9f1399c43996dd8296fa
2015-09-17 21:02:52 -07:00
Christopher Ferris
915bf813ad Update to v3.18.21 kernel headers.
Change-Id: I4ade68d62981c7f6f361750cc811e8d84be9d5b9
2015-09-02 17:23:31 -07:00
Christopher Ferris
dda4fd4644 Update to v3.18.18 kernel headers.
Change-Id: I0a0f423bda89500ad8e13a80582f05ec8bc756ea
2015-07-13 17:21:18 -07:00
Tao Bao
7592008030 Update the search path for libclang.so
Prebuilt shared libraries (libclang.so, libLLVM.so and etc) have been
moved to prebuilts/sdk/tools/linux/lib64. Update the search path in
cpp.py to match the change.

Bug: 20485471
Change-Id: Ib7784db4d5529d16a1e2bfc07cb0237929bc5a64
2015-04-22 10:47:01 -07:00
Christopher Ferris
e01d32f802 Upgrade kernel headers to 3.18.10.
Change-Id: Iff1f1c830780585990856a5114b559c61282dcd6
2015-03-31 14:57:48 -07:00
Yabin Cui
2d8f9b5aea Define MAXHOSTNAMELEN explicitly in source files.
Bug: 19093777
Bug: 19092844
Change-Id: I0778507ca2d5c008abb9a6d6315d0909263a8817
2015-02-09 19:56:47 -08:00
Tao Bao
d7db594b8d Switch kernel header parsing to python libclang
Replace the tokenizer in cpp.py with libclang.

Bug: 18937958
Change-Id: I27630904c6d2849418cd5ca3d3c612ec3078686d
2015-02-06 14:48:41 -08:00
Christopher Ferris
82d7504cd7 Update kernel headers to v3.18.3.
Bug: 19127803
Change-Id: I67fa0832322ddd0032d909476047578be052bcf2
2015-01-26 10:57:07 -08:00
Kyunam Jo
fa343e630d fix runtime issues for scripts
now, some script to update kernel-headers is not working.
because of wrong variable value and test codes.
so this issue is fixed.

Change-Id: Iffae9607858cc3c1c58fa24244be217b5a1ab06e
2014-12-10 07:53:07 +00:00
Christopher Ferris
cbf33a9988 am d5e1c583: Merge "Move to v3.16.3 kernel headers."
* commit 'd5e1c583a66a821c7d7e8f43e1238a4569981b90':
  Move to v3.16.3 kernel headers.
2014-09-18 21:48:49 +00:00