Commit graph

21 commits

Author SHA1 Message Date
Dan Willemsen
7a0f848998 Align flags with make
This pulls a number of cflag changes from make since our last sync.

Change-Id: I8c77fc215ed7677b8ac15a6d39143b519068dd55
2016-01-12 23:30:13 -08:00
Dan Willemsen
c7e4597461 Enforce linker version-scripts are valid
See build/ commit da9c00da5f7b

Change-Id: I65878931ab61124ae75e2c738cc733adfb107afc
2015-12-11 21:21:28 +00:00
Dan Willemsen
34cc69e4bf Use Path instead of string for file paths
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
2015-12-09 14:29:12 -08:00
Dan Willemsen
34fc3b1e84 Expose real GccVersion
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
2015-12-07 14:02:37 -08:00
Dan Willemsen
490fd49557 Support cross-compiling Windows binaries on Linux
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
2015-11-30 15:28:31 -08:00
Colin Cross
b0cba6a00f Add x86
Change-Id: I28e78cd49b184e0aa50c1c562b6bf719300e0832
2015-11-24 21:34:26 +00:00
Colin Cross
c4bde76832 Add toolchain cflags that are always used
Some cflags are part of the toolchain selection and should not be
removed by no_default_compiler_flags = true, for example -m32 for x86
compiles.  Removing all the cflags results in hacks such as in crt.mk
where the bare minimum cflags are reinserted.

Add new toolchain interface functions ToolchainCflags, ToolchainLdflags
and ToolchainClangCflags that will always be used.

Change-Id: I0ba02d7611e2afb9ad913319740e00c1bb2d654c
2015-11-24 21:33:15 +00:00
Colin Cross
c5c24ade63 Add arch features
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
2015-11-23 14:55:26 -08:00
Dan Willemsen
6d11dd87c0 cc: Filter out unknown clang cflags from InstructionSetFlags
-funswitch-loops is in the arm instruction set flags, but unsupported by
clang. Make removes clang unknown cflags from the instruction set flags.
This was producing a warning, causing -Werror to fail on libm.

Change-Id: Ibc69c9af04a738aa8adeb5549900e2b53ab754f0
2015-11-03 14:30:12 -08:00
Dan Willemsen
e65404514c Updates from make
Contains equivalent changes for:

  561b4c1 Set mcpu targets based on cpu variant.
  6a66a88 Stop encoding absolute paths in symbols
  63e3b02 Enable color output from gcc and clang
  eb3e3fa Use exported includes for libc++.
  3a0a891 Link libgtest_main before libgtest

Change-Id: I45a06c02e9af1d40f0c52f1e6a20d6cd382a27fb
2015-10-20 16:44:55 -07:00
Dan Willemsen
87b17d1ff4 Use SRCDIR as a working directory
The existing behavior of using the build directory as the working
directory is useful if you want to move/copy the output directory around
and SRCDIR still refers the the source. But, it's more useful to have
the source directory be the working directory. Tools like cpp(__FILE__)
and other debug prints embed relative paths from the working directory.
We also have tools that expect the working directory to be $TOP.

Change-Id: Ia0f1d3c6b7df72d61cf5628efa2baa98bd19775b
2015-09-17 23:42:25 -07:00
Dan Willemsen
3bf6b47229 Update flags to match make
Change-Id: I8ba24723d5b507fa178255c124b11356719700cb
2015-09-15 22:20:03 +00:00
Dan Willemsen
f5a959c99f Fix arm cflags
-mthumb-interwork was missing from the beginning.

The Clang cflags copy was only a shallow copy, so our clang-specific
fixups were affecting the GCC cflags as well.

The cortex-a15 replacement was removed from build/core with this change:
https://android-review.googlesource.com/#/c/143851

Change-Id: Ib6300e064f6ec4f6a7174d5e2aeacad1c359f7ea
2015-07-13 13:52:30 -07:00
Colin Cross
6bedfaaeea cc: remove incorrect arch cflags
arm and host builds both got some extra global cflags from arm64,
remove them.

Change-Id: Ie4dcbb114714f4ae8b45304755978d66e13e889c
2015-04-30 16:35:03 -07:00
Colin Cross
c1e814dbf1 cc: remove --fix-cortex-a8 from non-Cortex A8 devcies
Pass --fix-cortex-a8 only on Cortex A8 and generic ARM builds, and
pass --no-fix-cortex-a8 on everything else.

Change-Id: I4b12afee4de443b5d55df66be3c6a05251715e31
2015-04-28 14:11:56 -07:00
Colin Cross
28344528cf Simplify flags in c compiling, fix NDK build warnings
Reduce the number of flags variables when compiling C by getting
rid of the separately-tracked IncludeDirs variables, and putting
them directly in GlobalFlags.  Also changes exportedIncludeDirs
to exportedFlags, which will allow exporting flags besides -I.

Also fixes a bug when building a module with the NDK and -Werror
by passing NDK exported include directories with -isystem instead
of -I, which will ignore warnings from those includes.

Also fixes a bug where the default includes were being inserted
into all cflags by the arm and arm64 toolchain modules.

Change-Id: Ice97f84e637b21d20c38c85b881afa315f9f92ae
2015-04-22 14:08:45 -07:00
Dan Albert
be96168ee3 Add support for building NDK modules.
Change-Id: I2c5ede530e40a635e26ae45950580ef450e7dcc6
2015-03-26 21:58:12 -07:00
Colin Cross
97ba073833 Export cc types for art to inherit from
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
2015-03-25 11:33:06 -07:00
Tim Kilbourn
1a9bf268ad Add an instruction_set property to Arch
Used to allow switching between thumb and arm ISAs

Change-Id: I94aa83cee7179e83c97eedc32fd216965b626d33
2015-03-18 17:19:35 -07:00
Colin Cross
13af54da2d Fix arm compile flags to match makefile build
Fix a few flags that don't match the makefile build flags in
build/core/combo/TARGET_linux-arm.mk

Change-Id: Ib951da32d7828aff17a32f10ba18ed678b3571de
2015-03-16 16:22:52 -07:00
Colin Cross
3f40fa460d Add soong_build primary builder
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
2015-03-13 20:28:16 -07:00