Commit Graph

941 Commits

Author SHA1 Message Date
Colin Cross 54c7112c43 Simplify arch target handling
Soong's multi-architecture building has grown complex, with the
combination of HostOrDevice+HostType+Arch necessary to determine how to
build a variant of a module, and three separate mutators to split each
into its variations.

Combine HostOrDevice+HostType into Os, which will be Linux, Darwin,
Windows, or Android.  Store Os+Arch as a single Target.

Change-Id: Iae677eff61a851b65a7192a47f2dc17c1abb4160
2016-06-02 17:37:02 -07:00
Dan Willemsen 0d4e7bb37f Add support for logtags am: 0fda89f4a8
am: c6b1ed56b7

* commit 'c6b1ed56b7ae2d0243e2403b5ef510eb8646ee68':
  Add support for logtags

Change-Id: I455605463380060601f2be7b84dbfc0801a04a40
2016-06-01 23:54:11 +00:00
Dan Willemsen c6b1ed56b7 Add support for logtags
am: 0fda89f4a8

* commit '0fda89f4a80223d0adb01e0f44a0575c83956ea0':
  Add support for logtags

Change-Id: I81e4e56e2229d78e16c687f2e3b2fee18fdb6c7d
2016-06-01 23:47:42 +00:00
Dan Willemsen 0fda89f4a8 Add support for logtags
This lets modules declare logtags files, which will then be exported to
make using LOCAL_LOGTAGS_FILES. Make still generates event-log-tags and
the java code.

Bug: 28989759
Change-Id: Ie6be79d3ef8a17a74d42eba681a25a08b4c0e7ae
2016-06-01 15:31:28 -07:00
Colin Cross 8332e0e52d Merge changes I92cea061,I67705c5c am: 1cdcf50b4b
am: d2420c22d7

* commit 'd2420c22d7c07215ce07e742a1680831c2936d20':
  Add spaces around := when dumping assignments
  Fix govet issue

Change-Id: Ice058419ead096aff6c280444e2850ef1dd141c2
2016-06-01 05:05:57 +00:00
Colin Cross d2420c22d7 Merge changes I92cea061,I67705c5c
am: 1cdcf50b4b

* commit '1cdcf50b4b68243795b40b75fd4d9b91478ccb90':
  Add spaces around := when dumping assignments
  Fix govet issue

Change-Id: I3b7767ef6e271c8be7db36847279d292f3094bfc
2016-06-01 05:01:55 +00:00
Colin Cross 1cdcf50b4b Merge changes I92cea061,I67705c5c
* changes:
  Add spaces around := when dumping assignments
  Fix govet issue
2016-06-01 04:53:26 +00:00
Dan Willemsen 636a1bcbf6 Start using blueprint_go_binary am: c2aa4a9c52
am: efc8c86371

* commit 'efc8c863714ab271332a3e3ad2f0924c427ae3af':
  Start using blueprint_go_binary

Change-Id: I46a091a683013823ee601055c4afcd84ad66ab16
2016-06-01 02:49:28 +00:00
Dan Willemsen efc8c86371 Start using blueprint_go_binary
am: c2aa4a9c52

* commit 'c2aa4a9c52426e3cb9b14788096a817c85ea17aa':
  Start using blueprint_go_binary

Change-Id: I394b666653cc0a09bdecd67e949e48817a1d07ed
2016-06-01 02:45:33 +00:00
Dan Willemsen c2aa4a9c52 Start using blueprint_go_binary
And install the tools into a more obvious location. soong_env is not
moved, since we need it to exist early, so that we can use it in
soong.bash in case there's a build failure.

Change-Id: I9bd1fa320d84d180b2cf3deb90782d380666f7a6
2016-05-31 18:31:56 -07:00
Dan Willemsen 389dd5da20 Support installing non-native arch binaries am: 17f052647f
am: a3ecd8752f

* commit 'a3ecd8752faa4738af75d3ffedff76828cbdfd66':
  Support installing non-native arch binaries

Change-Id: I572140eb973445602d478fe42da32a7a439264bf
2016-06-01 01:15:38 +00:00
Dan Willemsen a3ecd8752f Support installing non-native arch binaries
am: 17f052647f

* commit '17f052647f5e4afcb3f5c4142d9a2ccec627faab':
  Support installing non-native arch binaries

Change-Id: I66ec9efe6e1362c31f1b0388e26a5815a70ae7bc
2016-06-01 01:11:52 +00:00
Dan Willemsen 17f052647f Support installing non-native arch binaries
For the x86_arm target, which uses two 32-bit architectures, x86
libraries should be installed into ".../lib", and arm libraries should
be installed into ".../lib/arm".

This shouldn't be necessary for binaries, but non-native binaries aren't
supported in Make right now, so we can revisit this once it's necessary.

Change-Id: I4d883c85d3ef4945ff6149d9c4fc81af5023e12b
2016-05-31 16:27:00 -07:00
Colin Cross 5126504fae Add spaces around := when dumping assignments
Add spaces around := when dumping assignments that failed translation.

Change-Id: I92cea0616a9dacd74a63b48f4626340b22542fbf
2016-05-30 13:42:19 -07:00
Colin Cross 079602cba6 Fix govet issue
Change-Id: I67705c5c1240bea6a21b7d62fd26d296d49735d4
2016-05-30 13:42:19 -07:00
Dan Willemsen 05ca2c87f0 Export GLOBAL_[CLANG_]C[PP]FLAGS_NO_OVERRIDE to Make am: 5efc706895
am: a002cea3e8

* commit 'a002cea3e8e507b739a5c0ffa0f21a89e15de8f6':
  Export GLOBAL_[CLANG_]C[PP]FLAGS_NO_OVERRIDE to Make

Change-Id: Iad1e79fb606ece2fb793ef439bd5be06244a540e
2016-05-28 02:35:21 +00:00
Dan Willemsen a002cea3e8 Export GLOBAL_[CLANG_]C[PP]FLAGS_NO_OVERRIDE to Make
am: 5efc706895

* commit '5efc70689589019e04c1a5fe8975dc2671c9ac7b':
  Export GLOBAL_[CLANG_]C[PP]FLAGS_NO_OVERRIDE to Make

Change-Id: Id5a7471f3cd83128cd537f948015eeb6dfd0bc4f
2016-05-28 02:32:54 +00:00
Dan Willemsen 5efc706895 Export GLOBAL_[CLANG_]C[PP]FLAGS_NO_OVERRIDE to Make
Change-Id: I7f2f37f63720244eb1f3340804c00ae82d36e90b
2016-05-27 15:23:38 -07:00
Dan Willemsen f05b4b634e Remove [local_]include_files am: cd114c1cb7
am: 4ae64644f1

* commit '4ae64644f1eb0b469fb281f2153f9acc8b088c89':
  Remove [local_]include_files

Change-Id: Idd9c7fec804dd2340d10a406d4772ed44d4bc50f
2016-05-26 23:29:46 +00:00
Dan Willemsen 4ae64644f1 Remove [local_]include_files
am: cd114c1cb7

* commit 'cd114c1cb707cb205ddf07e96bb61d97dfee5018':
  Remove [local_]include_files

Change-Id: Ia81168c60b0f1235f16742a23ffbb4b0c5bd6089
2016-05-26 23:27:14 +00:00
Dan Willemsen cd114c1cb7 Remove [local_]include_files
We don't actually need to do any changes to the path for the include
files, so we can just rely on the include_dir search to work.

It would still be useful to verify that the path isn't something bad,
like an absolute path, but we'll handle that by looking at the cflags in
another change.

Change-Id: I0bd609435969191c4ff91f2cd06eccfb75f5097c
2016-05-26 23:09:46 +00:00
Dan Willemsen 81d0bec0df Export TARGET_TOOLCHAIN_ROOT am: 0bd588787b
am: f56a2b16f8

* commit 'f56a2b16f8346518f365f8410b25856a5bc72913':
  Export TARGET_TOOLCHAIN_ROOT

Change-Id: Idd3fba44cf7910b97192a9b9b8ec57b2ad6a2cba
2016-05-26 22:43:26 +00:00
Dan Willemsen f56a2b16f8 Export TARGET_TOOLCHAIN_ROOT
am: 0bd588787b

* commit '0bd588787bac1d6add436f42a35359bee423b4d3':
  Export TARGET_TOOLCHAIN_ROOT

Change-Id: I0b93aa87530a29def050b1cfabde2cd11787b41d
2016-05-26 22:40:41 +00:00
Dan Willemsen 0bd588787b Export TARGET_TOOLCHAIN_ROOT
This is still used by brillo to find GCC for the kernel build.

Change-Id: I19238b1cc9c4220224048afebbdf6032015c3e89
2016-05-26 15:23:07 -07:00
Colin Cross d03eb60d23 Improve makefile parser am: 08693d2bf2
am: 21b30618ae

* commit '21b30618ae3633491deee09decbca92b05ac3993':
  Improve makefile parser

Change-Id: If0d95586af952280be210028a4a849fe7c4afc9a
2016-05-26 17:00:07 +00:00
Colin Cross 0c738b70e5 Fix blank line translation once and for all am: 7fd911f713
am: 26ab50e98d

* commit '26ab50e98d344809df349a0f87805ef67f86de21':
  Fix blank line translation once and for all

Change-Id: Ida205a5db5cfabeb27d5144e5916d7dce48cee66
2016-05-26 17:00:05 +00:00
Colin Cross 21b30618ae Improve makefile parser
am: 08693d2bf2

* commit '08693d2bf26e443bf9e0303b91a7cfc7e7e27e65':
  Improve makefile parser

Change-Id: If9f5b7123fad0216298b2140352b249737d1a9a6
2016-05-26 16:50:05 +00:00
Colin Cross 26ab50e98d Fix blank line translation once and for all
am: 7fd911f713

* commit '7fd911f713937029ec9a61602b2086c05a672b96':
  Fix blank line translation once and for all

Change-Id: Ie7188b30447830bda3b7a496a6519e60b2a4ca50
2016-05-26 16:49:59 +00:00
Colin Cross 08693d2bf2 Improve makefile parser
Improve the androidmk makefile parser based on ideas from go/ast and
friends:
   - Use type switching instead of the As* mess
   - Don't store endPos for every node, compute it based on the last
     known position in the node plus the length of the last token
   - Store positions as only the offset into the file, and then unpack
     them into Line/Column scanner.Position objects later

Change-Id: I87eb6661859951e6c2ea5a85db6229fa5561d615
2016-05-26 03:34:30 +00:00
Colin Cross 7fd911f713 Fix blank line translation once and for all
Track the position in the input makefile and output blueprint file
separately.  When parsing a new makefile line, increment the line in the
output position by the number of lines between the end of the last
makefile line and the beginning of this line.  Any extra blank lines
will be discarded by the blueprint printer.

Change-Id: I85c6e006667b5733b15e03b56b91caf29fbc0ea0
2016-05-26 03:34:17 +00:00
Colin Cross 8aee9c7b48 Merge "Fix non-deterministic errors with LOCAL_*_x86_64" am: ad14e6e227
am: 95879d5b51

* commit '95879d5b51ce847bc60b7448641fffce617afbc0':
  Fix non-deterministic errors with LOCAL_*_x86_64

Change-Id: I09f2416293aba18fd2faeeb16e2ef4406dab3b38
2016-05-26 03:30:56 +00:00
Colin Cross 95879d5b51 Merge "Fix non-deterministic errors with LOCAL_*_x86_64"
am: ad14e6e227

* commit 'ad14e6e2279a196366c43f9a58f46d6201d29d70':
  Fix non-deterministic errors with LOCAL_*_x86_64

Change-Id: Ia56b3affe0ab8e1ff64d9574ad311fd8e6782c30
2016-05-26 03:20:41 +00:00
Treehugger Robot ad14e6e227 Merge "Fix non-deterministic errors with LOCAL_*_x86_64" 2016-05-26 03:06:08 +00:00
Dan Willemsen 5baea967fa Add flag property checking am: 20acc5c520
am: 7c0e27d309

* commit '7c0e27d3098420776981e103fb94ce7141e19707':
  Add flag property checking

Change-Id: Idd248aec69a65264cb18c8ca96442b4bb913d12d
2016-05-26 02:29:42 +00:00
Dan Willemsen 7c0e27d309 Add flag property checking
am: 20acc5c520

* commit '20acc5c520c8d6021824b3f839000db45be36a6e':
  Add flag property checking

Change-Id: Ia9c635286974db0a363bfbc99c6366781ce12914
2016-05-26 02:18:16 +00:00
Dan Willemsen 20acc5c520 Add flag property checking
Some checks for common errors with user-provided compiler and linker
flags:

* Using -I instead of include_dirs
* Using -l<lib> in ldflags instead of host_ldlibs (or shared_libs)
* Using -L in ldflags
* Splitting a multi-word flag into two flags
* Combining two flags into one list entry
* Using a path that could search outside the source or output trees
* Using a non-whitelisted library in host_ldlibs

Maybe some of the flag checks should happen during a static analysis
pass, but we don't have one right now, and this only adds ~1/2 second to
our 73 second Mega_device runs (recompile the changed code, run
soong_build, then report unknown target).

Change-Id: Icea7436260f1caa62c0cec29817a1cfea27b3e7c
2016-05-25 17:50:05 -07:00
Colin Cross ab6e6e0135 Fix non-deterministic errors with LOCAL_*_x86_64
LOCAL_*_x86_64 was sometimes recognized as a _64 suffix and other times
as the correct _x86_64 suffix, based on the random order of the
propertyPrefixes map.  Replace the map with a slice so that the ordering
is consistent, and ensure 64 as after x86_64.

Change-Id: I1a4b4959f8ef4273ad4a1cdd0672ad557bf1891e
2016-05-25 17:17:40 -07:00
Colin Cross 0f8af7b05f Fix sanitize host builds am: b36ab1a1a0
am: ef6073265b

* commit 'ef6073265bb5fb164eaf5cc981db7b2dd915dfae':
  Fix sanitize host builds

Change-Id: I3faf7520a77c31c30b30c454d9586c36781849f9
2016-05-25 19:50:06 +00:00
Colin Cross ef6073265b Fix sanitize host builds
am: b36ab1a1a0

* commit 'b36ab1a1a0355d15d692e2b6ff5955cae1275174':
  Fix sanitize host builds

Change-Id: If49c199b05902d2662472a3e99903104b2839a2e
2016-05-25 19:45:49 +00:00
Colin Cross b36ab1a1a0 Fix sanitize host builds
Host builds don't have a separate place to install asan modules, so only
create a single variant for them.

Change-Id: I81f7090debd7935db778f8600d8cbc86dd53b1cb
2016-05-25 12:35:53 -07:00
Colin Cross 390f076154 Support sanitizer variants inside make builds am: bc6fb16b26
am: 991008ce19

* commit '991008ce19f63117f72553d8d46f21304342d8f9':
  Support sanitizer variants inside make builds

Change-Id: I646ce88d295f8090602860fe514fcd71debe4601
2016-05-25 19:33:13 +00:00
Colin Cross 991008ce19 Support sanitizer variants inside make builds
am: bc6fb16b26

* commit 'bc6fb16b26dedee0e9f10239cb9a6c8a3e647b04':
  Support sanitizer variants inside make builds

Change-Id: I5c75ac2dcc8a11eba3155e0d1d382edb176e8de7
2016-05-25 19:29:07 +00:00
Colin Cross bc6fb16b26 Support sanitizer variants inside make builds
Create both sanitized and unsanitized variants inside make builds with
sanitizers enabled.  Only export the sanitized version to make, and
always install the sanitized version in /data to match the make build.

Change-Id: I5a17bcbddc7a9d871c929c84d3c116228ef3258f
2016-05-24 17:14:15 -07:00
Dan Willemsen d6e7df3545 Stop sorting (C|CPP|LD)FLAGS when checking am: 9598e1048a
am: a897cbfd33

* commit 'a897cbfd3399cd93bf2bb87a8aa6cef5bcd2a750':
  Stop sorting (C|CPP|LD)FLAGS when checking

Change-Id: I9f5f85edcfb5708d9b375e3e6fa4a46bf369bf15
2016-05-24 01:11:41 +00:00
Dan Willemsen f1a1389e65 Fix and check CLANG_CONFIG_UNKNOWN_CFLAGS am: e8c5237775
am: c99fc3d097

* commit 'c99fc3d097eb72e4045d935bbd2997ce39d928df':
  Fix and check CLANG_CONFIG_UNKNOWN_CFLAGS

Change-Id: I1085f05f212c9165e5026efe9886d4a152a0ea45
2016-05-24 01:11:41 +00:00
Dan Willemsen a897cbfd33 Stop sorting (C|CPP|LD)FLAGS when checking
am: 9598e1048a

* commit '9598e1048a890810fc35b9655ee603a6994e8665':
  Stop sorting (C|CPP|LD)FLAGS when checking

Change-Id: I04fc04fb2d019777d68c26262c6636fb6b18d806
2016-05-24 01:09:14 +00:00
Dan Willemsen c99fc3d097 Fix and check CLANG_CONFIG_UNKNOWN_CFLAGS
am: e8c5237775

* commit 'e8c5237775f413bbb56084e19054a3d979e15985':
  Fix and check CLANG_CONFIG_UNKNOWN_CFLAGS

Change-Id: I3725569bc11883534d4a41035d91a9599200a756
2016-05-24 01:09:13 +00:00
Dan Willemsen 9598e1048a Stop sorting (C|CPP|LD)FLAGS when checking
Make isn't defining these anymore, so we don't need to sort them before
comparing.

Change-Id: Ia2f13f665309569ee8c564a8fb82639d174a83bb
2016-05-23 15:15:13 -07:00
Dan Willemsen 637583fc52 Check more Make variables am: 558e517ae9
am: e9b7ce1d10

* commit 'e9b7ce1d10210ddd79e060f182c38f9699508dc1':
  Check more Make variables

Change-Id: Iaf0c1e05c7c4bf00ff94b80a5cc526af70e1da71
2016-05-23 19:34:37 +00:00
Dan Willemsen e9b7ce1d10 Check more Make variables
am: 558e517ae9

* commit '558e517ae99d018305a45da6f46ee2a53f47c928':
  Check more Make variables

Change-Id: I6d661d3815302209bf158feaa9f1bb1094b10e12
2016-05-23 19:31:30 +00:00