Commit graph

12 commits

Author SHA1 Message Date
Dan Albert
c3144b1553 ndk: Use prebuilt NDK CRT objects.
Change-Id: Ie8d58fa7c4ef2a62338c20c3078603ac98be0f9c
2015-04-29 10:27:00 -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
Colin Cross
1332b0035c Move config into common and provide helper
Using ctx.Config().(Config) everywhere is a mouthful, and it is
inefficient to do the type assertion.  Put the Config interface into
the context, and provide an AConfig() to return the Config already
converted to the right type.

Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
2015-04-08 15:19:24 -07:00
Colin Cross
581c189988 Add yacc and lex support
Add support for yacc (.y or .yy) and lex (.l or .ll) files.  Also
tweak locations of .o files for normal and generated sources to
makes sure they don't collide.

Change-Id: I03172cddbdc022525bf392a81d72050406b8cdb3
2015-04-08 15:17:45 -07:00
Colin Cross
7d21c4430d Use @files for ld and ar
ld and ar command lines often end up larger than ARG_MAX, use Ninja's
rsp file support to automatically write the object files to a temporary
file and pass it in using @file support.

This isn't going to work on Darwin host builds, where the host
toolchains don't support @.

Change-Id: Ida2f4e114ab02df6967e863577fa324e197827d5
2015-04-02 14:48:55 -07:00
Colin Cross
bfae8859f2 Support prefix_symbols for linker
The linker needs to add __dl_ to the beginning of all of its symbols
to avoid conflicts.  Add support for a prefix_symbols property, and
insert an objcopy --prefix_symbols build step to produce the final
binary.

Change-Id: I70de7c830cd64305e5900c6de53efecea2e17c75
2015-03-27 15:58:24 -07:00
Colin Cross
ed4cf0b655 Refactor ccDynamic for static binaries
ccLibrary uses ccDynamic for linking shared libraries, but bypasses
it by calling directly into ccBase for static libraries.  Instead of
duplicating the same mess for ccBinary, rename ccDynamic to ccLinked
and add the logic for dealing with static or shared linkage.  This
also allows moving the stl logic out of ccBase and into ccLinked.

Change-Id: Idfa6d86de16911c8851f694d6ed92681c8939281
2015-03-27 15:57:49 -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
Colin Cross
70b4059e3f Update import paths for changes to blueprint
Blueprint has been modified to include a canonical import path,
update soong to match.

Change-Id: If29d31afbf3bf2e6364961a66456fa5f8f738455
2015-03-23 12:57:34 -07:00
Colin Cross
3075ad07e4 Add dependencies on late static libraries
Late static libraries were added to the build command line, but not
the implicit dependencies.

Change-Id: I20ed8be6ae1ec7c1b78f16a6d1da7d1535ff5cba
2015-03-17 10:47:08 -07:00
Colin Cross
77b00fa6f1 Add late static libraries for libgcc
libgcc has to be last on the command line, after -lc for libc.

Change-Id: I5c867cef59ca84e23ff5cea406da3ec3f261aa76
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