Commit graph

18 commits

Author SHA1 Message Date
Colin Cross
b60190a4f8 Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules
Export Soong cc modules to Make using a new soong_cc_prebuilt.mk that
bypasses all of prebuilt_internal.mk, dynamic_binary.mk and binary.mk.
This also means that stripping is handled in Soong instead of Make.

Relands If9008c50920779048480f5eeeb0084f26006c998 with fixes for
mac builds.

Bug: 113936524
Test: m checkbuild
Change-Id: I9710ff57f0793f36eb889eabd08bd60a365a88dd
2018-09-10 23:12:12 -07:00
Colin Cross
cb9342eabd Revert "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules"
This reverts commit e2874cd99d.

Reason for revert: broke mac builds
Bug: 113936524

Change-Id: Id0311d6b202b18e80953da632133548d56ed851a
2018-09-10 21:35:34 +00:00
Colin Cross
e2874cd99d Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules
Export Soong cc modules to Make using a new soong_cc_prebuilt.mk that
bypasses all of prebuilt_internal.mk, dynamic_binary.mk and binary.mk.
This also means that stripping is handled in Soong instead of Make.

Bug: 113936524
Test: m checkbuild
Change-Id: If9008c50920779048480f5eeeb0084f26006c998
2018-09-10 11:04:01 -07:00
Colin Cross
88f6fefeb4 Add stripping and toc support to Soong cc_prebuilt modules
Bug: 113936524
Test: m checkbuild
Change-Id: I67ec2e94d349924c3e209939030b204fdaff9c47
2018-09-05 16:30:16 -07:00
Colin Cross
1ab10a7310 Don't clear flags in prebuiltLibraryLinker.linkerFlags
linkerFlags takes the current flags struct, it should return it
unmodified if it has nothing to do, not return an empty one.

Bug: 113837811
Test: m SANITIZE_TARGET=address
Change-Id: I35ec260f49c832a5b50ff77395eda618679e6ef9
2018-09-04 11:02:37 -07:00
Yi Kong
0098166cb4 Prebuilts shouldn't inherit linker interface
Prebuilts doesn't go through linking stage, thus it should not inherit
any dependencies or flags from linker.go.

Test: m checkbuild
Bug: 29275768
Change-Id: I1f1dc5d65c2fc2dd905e8df44e08d5c83b224d0c
2018-08-30 14:33:06 -07:00
Colin Cross
ae88703df5 Move ModuleContext.ModuleBuild to ModuleContext.Build
Now that android.ModuleContext does not include blueprint.ModuleContext
we can rename android.ModuleContext.ModuleBuild to
android.ModuleContext.Build without colliding with
blueprint.ModuleContext.Build.  Leave ModuleBuild as a wrapper around
Build for now to avoid having to update all the users outside
build/soong simultaneously.

Test: m checkbuild
Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
2017-10-24 10:59:00 -07:00
Colin Cross
5c51792926 Make binaries executable
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file.  Also remove InstallFile and rename
InstallFileName to InstallFile.

Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
2017-08-31 13:48:52 -07:00
Colin Cross
74d73e2bfb Rename java_prebuilt_library to java_import
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.

Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
2017-08-11 15:24:11 -07:00
Colin Cross
94921e78df Copy prebuilt binaries
The final name of the prebuilt binary is going to match the basename
of the return value of link(), so copy the binary to the intermediates
directory to a file name that honors the name and stem properties of
the module.

Test: manual
Change-Id: Ieed4df79b11382924ca0be8e940d3279b45f748a
2017-08-08 16:23:32 -07:00
Colin Cross
36242850fd Refactor factories
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.

Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
2017-06-30 21:08:36 +00:00
Leo Li
74f7b97d3f Make factory functions in cc/prebuilt.go public.
Test: refactoring CL.

Change-Id: Icf4628df082d2b5a41a9108f85cb73dab42839ab
2017-05-17 16:33:20 -07:00
Colin Cross
de89fb8707 Add support for binary and static library and prebuilts
Add cc_prebuilt_library_static and cc_prebuilt_binary module types.

Bug: 35576244
Test: Add cc_prebuilt_library_static and cc_prebuilt_binary modules
      and verify they are used
Change-Id: I708ec7b1ed1a0eddae083159575ae04d5ea25a37
2017-03-17 14:06:28 -07:00
Colin Cross
dfee1bcf43 Rename to cc_prebuilts_library_shared
Rename cc_prebuilts_shared_library to cc_prebuilts_library_shared
to match cc_library_shared.

Test: builds
Change-Id: I2f48263c3a0830a99ace4e2374de4a702d48c2e4
2017-03-17 14:06:28 -07:00
Colin Cross
ab3b7323c4 Remove boolean arguments from NewLibrary()
NewLibrary is going to be used for header only libraries.  Instead
of adding more boolean arguments, replace the existing ones with
BuildOnlyStatic and BuildOnlyShared calls on the libraryDecorator
returned by NewLibrary.

Test: m -j, compare build.ninja
Change-Id: Id390b66cbf2a5f0932b32f40a5e18eb9e3852ee7
2016-12-13 14:50:51 -08:00
Colin Cross
bba99041db Split cc_prebuilt_shared_library into static variants
Prebuilts must have every variant that their source module has, so
split all cc_prebuilt_shared_library modules into both static and
shared variants.

Test: m -j checkbuild
Change-Id: I3c32315227f779e832e041cfab604ff7402c7e13
2016-11-29 15:29:34 -08:00
Dan Willemsen
5cb580f407 Start using "struct Objects" to store object Paths
So that we can represent other files that get generated along with the
objects, like the gcno coverage information, and per-file clang-tidy
runs.

Test: Soong's build.ninja identical before/after
Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
2016-10-31 16:18:49 -07:00
Colin Cross
ce75d2c6a2 Initial prebuilt support
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts.  Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.

Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
2016-10-13 14:52:47 -07:00