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: I92f2e2dac53617d595a35cc285d2bd348baa0fbd
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
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
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
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
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
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
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
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
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
Host builds don't have a separate place to install asan modules, so only
create a single variant for them.
Change-Id: I81f7090debd7935db778f8600d8cbc86dd53b1cb
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
Some more common makevars methods were required in order to remove the
"-isystem" prefixes from the toolchain.IncludeFlags() value. In Make,
the -isystem is prepended at time of use, not in TARGET_C_INCLUDES
itself.
Change-Id: If07e69ddb7357d11c7dd48ab60f503d219f29de8
Add the clang asan runtime libraries to the mips and mips64 toolchain
definitions. Fixes missing symbol build errors on asan_test.
Change-Id: I10c46599af2c7758f4726814920b8881644c6f97
This better matches the order from cc/cc.go, so that any implicit
ordering behaves the same in Make and Soong.
Change-Id: I802d725f037a22c4b2f0ae28258af95efa37ce79
-msoft-float is equivalent to -mfloat-abi=soft, which means we need to
make sure the order is correct if we also specify -mfloat-abi=softfp.
Since the Neon support (with -mfloat-abi=softfp) is in the cpu-specific
ToolchainCflags, move the generic definition into ToolchainCflags as
well.
This wasn't actually causing problems when compiling, since the normal
toolchain.Cflags is before toolchain.ToolchainCflags, but the makevars
code accidentally reversed this. That will be fixed as well, but this
will protect against similar problems in the future.
Change-Id: If6f37c845210105f84769bab45fde5d7fdc2fe09
This was in HOST_CROSS_GLOBAL_LD_DIRS, which is why it didn't get
translated over here, since Soong does not use global linking
directories. It's being moved to HOST_CROSS_GLOBAL_LDFLAGS so that it
can be shared.
Change-Id: Ie20670278a589ae3cf76e09de4079edfa800cf5b
The variable was defined, but it wasn't being exposed to the Toolchain
interface. It was also using -I instead of -isystem.
Change-Id: Iee9862a4b9c50c9497915175a23864b4b2c29c26
x86_64 and mips64 NDK prebuilt libraries are stored in .../usr/lib64,
but arm64 and all the 32-bit ABIs use .../usr/lib. Add a 64 suffix to
the path for all 64-bit ABIs except arm64.
Change-Id: I98e87ff6a7f1aa75adbeb37c5b1e7208b953322f
Static_executable was still using ModifyProperties, and was otherwise
missing things. Fix all of that up, and implement HostStaticBinaries,
which is the equivalent of BUILD_HOST_static in Make. That will default
host binaries to be static, which is useful for building SDK tools to
run with incompatible C libraries.
Change-Id: I2a62181b5d854b310edc8ae7a6bcbd30b89e7463
We don't ship binutils on Darwin, so there is no point in telling clang
to look in that path. (The path being used doesn't even exist). This
matches the Make behavior.
Change-Id: I663047057ff8df8a349483532da8018af13d50d8
On Darwin ar would fail if there is no object file to add.
We work around by adding a dummy.o.
Port to Soong of build/ 4aaa1a1fd8e7eb23ac5557cd326d1a48efdb54cd
Change-Id: I68bbebea2726058c25863d7026a645a520d05167
There's a different libgtest to use for NDK libraries built with
different STLs. And we no longer need to add the gtest include path, as
it's exported.
Change-Id: I2f804cf98e074cfd4ea6b70a445e304a8a8bce50
Set LOCAL_PATH to the path to the blueprint file so that make can
generate MODULE-IN-* rules to make mma work. Switch to using
LOCAL_PREBUILT_MODULE_FILE instead of LOCAL_SRC_FILES to specify the
location of the prebuilts relative to $(TOP).
This should also make notice files work.
Change-Id: I51c7aa1187e68c4c9095687461dd5e76cbd7292d
To allow other singletons to use new environment variables, move env.go
to the end of the source list, so that its singleton is run last.
Change-Id: Ic92308f72fc0c92a0fedbc5546e337940e32eaab