1. 06 May, 2016 2 commits
    • Ying Wang's avatar
      We still use acp in copy-file-to-target in this branch. · 8e770bc6
      Ying Wang authored
      Change-Id: Ibae51f8db69d8ab3b5ae7c086f519236e5d2043e
      8e770bc6
    • Ying Wang's avatar
      Harden dependency on generated sources. · bb37c657
      Ying Wang authored
      Previously if a library has custom generated headers in
      LOCAL_GENERATED_SOURCES and export its include path with
      LOCAL_EXPORT_C_INCLUDE_DIRS, there is almost no way for the users of the
      library to set up dependency of their object files on the generated
      headers.
      This change makes the generated sources dependency of the library's
      export_includes, which is guaranteed generated before client code gets
      compiled.
      
      Also we added proto-generated cpp files to my_generated_sources so that
      we can deal solely with $(my_generated_sources). Because many
      Android.mks assume the generted .pb.hs are in $(generated_sources_dir)
      instead of $(intermediates), we have to generate the source files in
      $(generated_sources_dir) and make a copy in $(intermediates).
      
      Bug: 28622149
      Change-Id: I73b21443fa706f3735faf16356ed8c08fbfecca6
      (Cherry-pick from commit 05f9f358)
      bb37c657
  2. 25 Apr, 2016 1 commit
  3. 29 Mar, 2016 2 commits
    • Shinichiro Hamaji's avatar
      Replace last -includes by .KATI_DEPFILE · 0f846c73
      Shinichiro Hamaji authored
      There was a typo in binary.mk. compile-dotdot-XXX-file in
      definitions.mk was also using -include.
      
      Bug: 26839129
      Bug: 27886012
      Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
      (cherry picked from commit 72904774)
      0f846c73
    • Shinichiro Hamaji's avatar
      Use KATI_DEPFILE for .P associated with object files · 2fb7b61a
      Shinichiro Hamaji authored
      Also specify "-d keepdepfile" to ninja so .P files won't be
      deleted by ninja.
      
      -include for .s files are removed because GCC doesn't
      generate .d files for .s files.
      
      Bug: 26839129
      Bug: 27886012
      Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
      (cherry picked from commit 4037c422)
      2fb7b61a
  4. 27 Feb, 2016 1 commit
    • Chih-Hung Hsieh's avatar
      Use newest clang static analyzers. · 71d8cbd9
      Chih-Hung Hsieh authored
      * When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
        call new clang ccc-analyzer or c++-analyzer.
      * Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
        call compiler with -fsyntax-only.
      * Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
      * ccc-analyzer executes the original compilation command to generate
        object files before calling clang with --analyze to do static analysis.
      * When clang is called with --analyze, macro __clang_analyzer__ is defined.
      
      BUG: 13287788
      
      (cherry picked from commit 765c1ea6d7272fae04d435b9bac79087a2f6aabf)
      
      Change-Id: I6e51e51ff4ed3ce514f60d090494dcdf6e520b04
      71d8cbd9
  5. 04 Feb, 2016 1 commit
    • Dan Willemsen's avatar
      Fix unused src tracking for generated .o files · 444c323b
      Dan Willemsen authored
      *.o files that are passed in via LOCAL_GENERATED_SOURCES are added
      directly to all_objects, they are not mixed with the normal_objects that
      we track. So omit them from they my_gen_src_files list so that we don't
      warn that they're unused.
      
      Change-Id: I94b85504032e70fbcc00207d6200557700dd0a89
      444c323b
  6. 02 Feb, 2016 1 commit
    • Dan Willemsen's avatar
      Track ObjC object mapping · 62f2e56c
      Dan Willemsen authored
      Objective-C .m/.mm files were not being tracked, so they were showing
      up as unused source files (on Darwin). They were also triggering an
      internal build system warning because the new object list did not
      match the current list.
      
      Change-Id: I01fff8c5587fe168106c60782080d60744311f6f
      62f2e56c
  7. 28 Jan, 2016 1 commit
    • Dan Willemsen's avatar
      Order objects based on LOCAL_SRC_FILES and LOCAL_GENERATED_SOURCES · 3bb168f1
      Dan Willemsen authored
      We have been reordering objects to the linker based on how they were
      generated. In soong, they're ordered based on the order listed in the
      src_files.
      
      Keep track of which source files created which object files so that we
      can create the ordered list. Optionally change the order, based on
      BINARY_OBJECTS_ORDER. That way we can compare make and soong builds.
      
      Since we're keeping track of the used source files, warn when an entry
      in LOCAL_SRC_FILES is not used. (whether it is an unused file like a
      header, or a typo)
      
      LOCAL_GENERATED_SOURCES is not verified, since it is valid to add
      headers and other files in that list (to set up dependencies).
      
      Change-Id: I1dfbbb3aa570c11c1db3b7133e46ed0b8c3b8989
      3bb168f1
  8. 26 Jan, 2016 1 commit
    • Shinichiro Hamaji's avatar
      Use dependency files generated by llvm-rs-cc · 2e45fd03
      Shinichiro Hamaji authored
      This was a regression since kati has been introduced. This CL
      introduces include-depfile function to make it easier to write
      Makefiles which work with both make and kati.
      
      As ninja can handle only a single dependency file per a build
      rule, now we merge multiple .d files generated by llvm-rs-cc
      into a .d file.
      
      Change-Id: Iaf64a8f0523ab98115837e6e06abd50f06620363
      2e45fd03
  9. 20 Jan, 2016 2 commits
    • Christopher Wiley's avatar
      Separate aidl dependencies from compiler dependencies · 087f3273
      Christopher Wiley authored
      Both aidl and clang/gcc were putting their dependencies in the same
      place.  Move aidl's dependencies to a file ending with .aidl.P rather
      than the compiler's .P.
      
      While here, inform kati that we have these special dep files.
      
      Bug:26409006
      Test: Rebuild, note both files being generated
      
      Change-Id: I29d2eea822235d60713c2059f3a314e475eb5aa3
      087f3273
    • Christopher Wiley's avatar
      Keep aidl generated C++ inside the generated folder · 257796c6
      Christopher Wiley authored
      Transform ../ to dotdot/ for C++ generateds from .aidl source files.
      This forces us to use one layer of indirection to calculate the build
      rules for .aidl files, since we can no longer use a pattern rule.
      
      This was tested by modifying system/tools/aidl's Android.mk to refer to
      its .aidl files by going up two directories and then repeating the
      directories again.  When I print the build rules with $(info) I see that
      dotdot/ appears in appropriate places (C++ paths, but not .aidl paths).
      
      Bug: 26407018
      Test: Described above.
      
      Change-Id: I397c9d10408c0c66d8b5a247a1f34eb4bf4f74ce
      257796c6
  10. 19 Jan, 2016 1 commit
    • Dan Willemsen's avatar
      Pass the arm/thumb cflags to assembly files · 45d38c06
      Dan Willemsen authored
      This effectively changes the default instruction set of assembly files
      from arm to thumb in order to match the default for C/C++.
      
      Change-Id: I8684f144a1195b53b3e0fdd04cacf77f6a131c7e
      45d38c06
  11. 13 Jan, 2016 1 commit
    • Ying Wang's avatar
      Generate .c for .y and .l · f0ebe165
      Ying Wang authored
      - For .l/.y source files, generate .c files; for .ll/.yy source files,
        generate c++ files.
      - Simplified the rules by adding the generated sources to
        my_generated_sources.
      - Simplified generated header file naming by always using .h extension
        with bison's "--defines=" option.
      - Removed the unnecesarry conditional inclusion to the generated
        headers. Bison already automatically generates such things.
      
      Bug: 26492989
      Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
      f0ebe165
  12. 12 Jan, 2016 1 commit
    • Ying Wang's avatar
      Generate .c for .y and .l · 64088f24
      Ying Wang authored
      - For .l/.y source files, generate .c files; for .ll/.yy source files,
        generate c++ files.
      - Simplified the rules by adding the generated sources to
        my_generated_sources.
      - Simplified generated header file naming by always using .h extension
        with bison's "--defines=" option.
      - Removed the unnecesarry conditional inclusion to the generated
        headers. Bison already automatically generates such things.
      
      Bug: 26492989
      Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
      64088f24
  13. 06 Jan, 2016 1 commit
    • Chih-Hung Hsieh's avatar
      Change USE_CLANG_PLATFORM_BUILD default to true. · b5da9d94
      Chih-Hung Hsieh authored
      When USE_CLANG_PLATFORM_BUILD is not set, default will be clang/llvm.
      USE_CLANG_PLATFORM_BUILD=false can be used to select gcc as default.
      
      Bug: 23163853
      Bug: 26102335
      Change-Id: I434176732fa4a382be9d8d8642a1c705b023cf84
      b5da9d94
  14. 15 Dec, 2015 1 commit
    • Ying Wang's avatar
      Disable .toc optimization for host modules. · c01f2dcb
      Ying Wang authored
      Host binaries may be run during the build process and the internal
      implementation of the shared libraries makes a difference for the build
      result. This change makes sure host tools get re-linked and re-run when
      any of its dependency libraries gets updated.
      DEX2OAT is such a host tool. We also changed DEX2OAT as full dependency
      of dex-preoptimization, so we rebuild the odex files if DEX2OAT itself,
      or any dependency libraries changed.
      
      Bug: 24597504
      Change-Id: Idf0d9be82ccebd826d9c5b405a39cff437e0af29
      c01f2dcb
  15. 13 Dec, 2015 1 commit
  16. 11 Dec, 2015 1 commit
    • Dan Albert's avatar
      Use lib64 for mips64 as well. · 445bc2fc
      Dan Albert authored
      This was previously working because for some reason prebuilts/ndk had
      a tangled mess of hand assembled symlinks that pointed lib -> lib64
      for the multilib architectures.
      
      Change-Id: I294d67f58f2008b1a53790cf676f5223df449cbc
      445bc2fc
  17. 10 Dec, 2015 2 commits
    • Chih-Hung Hsieh's avatar
      Change USE_CLANG_PLATFORM_BUILD default to true. · 3c8036da
      Chih-Hung Hsieh authored
      When USE_CLANG_PLATFORM_BUILD is not set, default will be clang/llvm.
      USE_CLANG_PLATFORM_BUILD=false can be used to select gcc as default.
      
      BUG: 23163853
      BUG: 26102335
      
      Change-Id: I00604c2aef4849e8c3505b2c4002eb1c46cd1fd1
      3c8036da
    • Dan Albert's avatar
      Fix the mips build. · 8dca15f2
      Dan Albert authored
      The linker can't do --hash-style=gnu for mips.
      
      Change-Id: I66a77067f8be6fc92ca686d3e6e159beb72cf76b
      8dca15f2
  18. 09 Dec, 2015 2 commits
  19. 04 Dec, 2015 1 commit
    • Dan Willemsen's avatar
      Sanity check LOCAL_SRC_FILES_EXCLUDE · c29172c3
      Dan Willemsen authored
      Error out if there is a file listed in LOCAL_SRC_FILES_EXCLUDE but not in
      LOCAL_SRC_FILES. This should catch typos or other mistakes that would
      otherwise be missed.
      
      Change-Id: Iaddf575a6ce35238998ac47b59591a7d05fbcd0d
      c29172c3
  20. 01 Dec, 2015 1 commit
    • Colin Cross's avatar
      Make export_includes a restat rule · 6b9bddde
      Colin Cross authored
      There is currently an intentional incremental rebuild issue with
      import_includes.  export_includes might get updated with an identical
      version, but we don't want to force everything downstream of it to
      rebuild.
      
      When BUILDING_WITH_NINJA==true, only update export_includes if it
      changes, and use .KATI_RESTAT to only run downstream rules if it
      changes.  import_includes will only be updated if one of the
      export_includes files is updated, so object files can have a normal
      dependency on import_includes instead of an order-only dependency.
      All downstream object files will now be recompiled if their imported
      include paths change.
      
      Bug: 25910568
      Change-Id: I626f3b24ac02ac1309049cf1ce66cfe8ec816513
      6b9bddde
  21. 25 Nov, 2015 1 commit
  22. 19 Nov, 2015 2 commits
    • Christopher Wiley's avatar
      Fix race in C++ AIDL file generation · 2d91c61e
      Christopher Wiley authored
      The export_includes file for a library needs to express a dependency on
      all generated exported headers.  For aidl generated headers, express a
      dependency on the .cpp file instead, since the generator promises to
      generate this file last.  Unfortunately, the C++ headers generated from
      a .aidl file depend on the contents of the file.
      
      Change-Id: I9402b364e4538b502c0958ac8c7bd72cb0add724
      2d91c61e
    • Christopher Wiley's avatar
      Export generated AIDL headers · c7e936f5
      Christopher Wiley authored
      It is common for developers to generate/compile AIDL in a static
      library, then link that library into an executable.  When doing this,
      developers need to export the generated headers.
      
      Bug: 25779424
      Test: a refactoring of the aidl Android.mk shows this works
      
      Change-Id: I4f7d471a601d2a683cb5a9da5e02e3fab576c26a
      c7e936f5
  23. 17 Nov, 2015 1 commit
  24. 04 Nov, 2015 1 commit
    • Shinichiro Hamaji's avatar
      Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries · 0e7587a9
      Shinichiro Hamaji authored
      When a shared object is rebuilt, all dependent libraries and
      executables are rebuilt. Such rebuild is unnecessary when there
      is no interface change. With this patch, .toc files will be
      generated for all .so files. The rule which generates .toc files
      has ninja's restat=1 and .toc files are not changed ninja won't
      rebuild dependent targets.
      
      Performance:
      
      $ m && touch bionic/libc/stdio/stdio.c && time m
      Before: 1m03s (2563 targets)
      After: 21s (90 targets)
      
      Bug: 24597504
      Change-Id: Ia5dd950273d143f4e99eee8bef7478f1a94cd138
      0e7587a9
  25. 26 Oct, 2015 1 commit
  26. 19 Oct, 2015 1 commit
  27. 17 Oct, 2015 1 commit
    • Colin Cross's avatar
      Add support for LOCAL_SRC_FILES_EXCLUDE · a04abc8e
      Colin Cross authored
      LOCAL_SRC_FILES_EXCLUDE will be used to filter files out of
      LOCAL_SRC_FILES.  A common usage will be to use
      LOCAL_SRC_FILES_EXCLUDE_<arch> to remove a source file that will be
      replaced with an arch-optimized version.
      
      Change-Id: I75cc6114c47fb784bab65cae8f618c4f395f07bb
      a04abc8e
  28. 14 Oct, 2015 1 commit
  29. 08 Oct, 2015 1 commit
  30. 28 Sep, 2015 2 commits
    • Colin Cross's avatar
      Don't add dependencies on Makefiles when using ninja · a4447e8c
      Colin Cross authored
      Ninja has an implicit dependency on the command being run, and kati will
      regenerate the ninja manifest if any read makefile changes, so there is no
      need to have dependencies on makefiles.
      This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
      a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't
      include base_rules.mk, but it will fix the most common ones.
      
      Bug: 23566977
      Change-Id: I66de882421376303ab7233c8ce7274548f6b2199
      a4447e8c
    • Nicolas Geoffray's avatar
      Make linker configurable through environment. · b7c9f327
      Nicolas Geoffray authored
      Change-Id: I152ad7b41cfa05f2f59f51c6d8bd1e427f1a1649
      b7c9f327
  31. 26 Sep, 2015 1 commit
    • Shinichiro Hamaji's avatar
      Use gomacc even for FDO build · 09295a82
      Shinichiro Hamaji authored
      Goma's client recognizes -fprofile-use= flag so shoulde be
      compatible with Android's FDO build.
      
      Change-Id: I0d21d6f530cd05770f8dc12e9dc33a5db49a9c7d
      09295a82
  32. 23 Sep, 2015 2 commits