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
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
In cc/cc.go, we already add -B{GccRoot}/{GccTriple}/bin to all clang
cflags, asflags, and ldflags. So we don't need to add a linux specific
version here.
Change-Id: I42d71662c78a8170463dfec932a633e4d4ff52c8
The make macros add these to the linker lines even if the default
compiler flags are being skipped.
This also allows us to add another runpath for test binaries, which are
currently being installed in:
<out>/host/linux-x86/nativetest[64]/<test>/<binary>
So they need to use ../../lib[64] as a rpath.
Change-Id: Ia7e954cdf63bc627a8f71d01c953530355c248ab
Some of these are updates from the old build system, others are just
differences/bugs being corrected.
Change-Id: Ied7f47ade495dcb26ba3611e636869cba283860f
In make these clang-specific flags are marked as EXTRA and added after
the common flags.
This was causing differences between compiled objects in make and soong
because -fstack-protector-strong was before -fstack-protector in soong
instead of after.
Change-Id: I59dd6dcfdaf5ec9184a09e79efe80b62cfe48dbb
This centralizes verification and common operations, like converting the
path to a source file to the path for a built object.
It also embeds the configuration knowledge into the path, so that we can
remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that
leads to paths like './path' instead of just 'path' like make is doing,
causing differences in compiled binaries.
Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
In order to validate that the NDK STL paths exists, we need to know
the full path, including the Gcc version during the go execution. So
instead of returning a ninja variable reference, just return the
contents of the variable.
This also fixes a few invalid uses of armGccVersion to the proper
variable.
Change-Id: I54398ba4aa4000235b7d537a2c4efe3ecbbeec8b
This defines another mutator between HostOrDevice and Arch that will
expand host modules into a module for each host type
(Darwin/Linux/Windows) that is currently being built.
Change-Id: I4c8ac6b616c229f6bd45ad8a35902652fb6a4fff
Allow architecture toolchains to register "features" supported by the
current variant, and then apply properties from the selected features.
Equivalent to the ARCH_*_HAS_* variables in the combo makefiles.
Change-Id: Ib6823be1c1a52da677d081db9f24336a072eaf39
Various build rule changes to match AOSP:
Add libunwind_llvm and libdl as dependencies for libc++ on device
Always add libcompiler_rt-extras as a dependency
Add libm, libc, and libdl as depnendencies for libc++ static binaries
Disable some clang warnings, and add some clang filtered cflags
Add -fstack-protector to host linux builds
Add jack_flags property to java modules (currently ignored)
Change-Id: Ic0da617bdeaf25f58cb8298dd9ea91b7d6509151
Art needs a custom module type in order to perform complicated
build logic like depending on environment variables and varying
cflags based on cpu variant. Export enough of the types and
functions from cc for art_cc_library to inherit from cc_library.
While I'm touching every line, also rename the New* methods
to *Factory.
Change-Id: I7123aa47019c4ced7a1ab57c394225bc7844b5ea
Initial build logic for building android with soong. It can build
a variety of C and C++ files for arm/arm64 and host.
Change-Id: I10eb37c2c2a50be6af1bb5fd568c0962b9476bf0