http://b/28149048http://b/29823425
Disable -Wnull-dereference. The second bug above tracks that this
warning gets re-enabled.
Test: Tested build, boot and common usage for Arm, Arm64, x86, x86_64,
Mips images in AOSP and internal branch.
Change-Id: Ie41a495dd9bb247d3609f4848d7669d1faaeeb79
For acp, we've been using an old prebuilt in prebuilts/sdk, but it's not
part of the SDK. Instead, we'll use a prebuilt in the build-tools
repository.
For ijar, we've been using the host libstdc++ to workaround the lack of
libc++ on some unbundled branches. Instead, use a prebuilt that can use
libc++.
For ziptime, we've been disabling it on unbundled branches, due to the
lack of libc++. Instead, use a prebuilt version of ziptime that can use
the prebuilt libc++.
Change-Id: If80f845ea06f76e3fe6765964e77c864eaf303d0
LOCAL_LDLIBS was the only correct way to use NDK libraries, but few used
it correctly. It also often got confused with LOCAL_LDFLAGS, so move the
flags to the correct variable.
For binaries that weren't using the NDK (empty LOCAL_SDK_VERSION), it
was never valid to use LOCAL_LDLIBS, as dependencies would not be
properly set up, and could lead to random build failures. So convert any
-l linker flags to using LOCAL_SHARED_LIBRARIES automatically.
For binaries built using the NDK (LOCAL_SDK_VERSION set), they were
required to use LOCAL_LDLIBS for prebuilt NDK libraries, otherwise they
would get headers and dependencies to the platform versions. Any
non-prebuilt LOCAL_LDLIBS would miss dependencies. So move the NDK
prebuilt libraries to LDLIBS from SHARED_LIBRARIES, and move everything
else to SHARED_LIBRARIES.
So now, for device modules, LOCAL_SHARED_LIBRARIES should always be
used, and we'll do the right thing. LOCAL_LDLIBS should only be used for
host libraries from the system.
Change-Id: Ide34c7afdcfb6507a378d45a42471729e489a9e0
These are all either recently unused due to the removal of CFLAGS/etc,
or have been exported by Soong and are no longer necessary.
Change-Id: I5930d43fda21acc8202b3d8ea010fbefb6ae4cf1
At the beginning of every build, Soong has exported its version of these
variables, and has been ensuring that when sorted, the result is the
same. So these variables all have the same flags of the Soong ones, but
may be in different orders. We don't believe any of the remaining order
differences matter. As we remove the Make definitions, the exported
Soong variables will take over.
This only removes lines that change one of these variables:
[2ND_][CLANG_]HOST_CROSS_GLOBAL_CFLAGS
[2ND_][CLANG_]HOST_CROSS_GLOBAL_CONLYFLAGS
[2ND_][CLANG_]HOST_CROSS_GLOBAL_CPPFLAGS
[2ND_][CLANG_]HOST_CROSS_GLOBAL_LDFLAGS
[2ND_][CLANG_]HOST_GLOBAL_CFLAGS
[2ND_][CLANG_]HOST_GLOBAL_CONLYFLAGS
[2ND_][CLANG_]HOST_GLOBAL_CPPFLAGS
[2ND_][CLANG_]HOST_GLOBAL_LDFLAGS
[2ND_][CLANG_]TARGET_GLOBAL_CFLAGS
[2ND_][CLANG_]TARGET_GLOBAL_CONLYFLAGS
[2ND_][CLANG_]TARGET_GLOBAL_CPPFLAGS
[2ND_][CLANG_]TARGET_GLOBAL_LDFLAGS
Many other variables are unnecessary now too, but those will be removed
in another change. For those we can ensure the build.ninja file does not
change, but we expect it to change here due to the ordering differences.
Change-Id: I0bd0778706d02ee27b2784dd8dc6b2c71d37bd3a
These have all been strictly checked by Soong, so the values currently
match. Just remove them so that the make variables exported by Soong
will take over.
This also removes some of the GCC reconfiguration, since we haven't
implemented that in Soong. If it becomes useful in the future, we'll
implement it there.
Some things like TARGET_TOOCHAIN_ROOT can nearly be removed, but are
used before the Soong-exported make_vars.mk is loaded. In that case,
added to the clang cflags, so it can be removed once the cflags are
removed.
Others, like LLVM_PREBUILTS_VERSION are loaded even earlier -- in
envsetup.sh before we've even configured Soong. So for now, keep the
Make definition, and continue ensuring it's the same as the Soong
version.
Change-Id: I554b27062ac43610828a8c06d640d919a2dc21ca
* Call clang-tidy before every C/C++ compilation if
(1) clang-tidy is found at $(PATH_TO_CLANG_TIDY)
(2) $(my_clang) is true
(3) LOCAL_TIDY is 1 or true, or
LOCAL_TIDY is undefined and WITH_TIDY is 1 or true.
* clang-tidy is called with -checks=$(my_tidy_checks),
which has default '-*,google*,-google-readability*'
and can be overwritten by WITH_TIDY_CHECKS.
* LOCAL_TIDY_CHECKS is appended to $(my_tidy_checks)
* Extra flags are passed to clang-tidy through
WITH_TIDY_FLAGS or LOCAL_TIDY_FLAGS.
* To quickly find and fix clang-tidy warnings, set $(WITH_TIDY_ONLY)
to 1 or true to skip compilation of C/C++ files.
* Add a PHONY tidy_only target,
which includes all $(cpp_objects) and $(c_objects).
* The 'mm' and 'mmm' functions are changed to call make with
the 'tidy_only' target when WITH_TIDY_ONLY is true or 1.
In that case, only clang-tidy is called for C and C++ files.
Bug: http://b/27779618
Change-Id: I8adcfff217d68af49849b79aacee7d7654cafb1b
To generate partition tables in the Android build system, simply add
the path to a .bpt file to the BOARD_BPT_INPUT_FILES variable.
BOARD_BPT_INPUT_FILES += "hardware/bsp/vendor/soc/board/board-specific.bpt"
The variable BOARD_BPT_DISK_SIZE can be used to specify or override
the disk size, for example:
BOARD_BPT_DISK_SIZE := "10 GiB"
Additional arguments to 'bpttool make_table' can be specified in the
variable BOARD_BPT_MAKE_TABLE_ARGS.
If BOARD_BPT_INPUT_FILES is set, the build system generates two files
partition-table.img
partition-table.bpt
in ${ANDROID_PRODUCT_OUT} using 'bpttool make_table'. The former is
the binary partition tables generated using bptool's --output_gpt
option and the latter is a JSON file generated using the --output_json
option. These files will also be put in the IMAGES/ directory of
target-files.zip when running 'm dist'.
BUG=27831397
TEST=Manually tested.
Change-Id: Iedd15354afb2dd483dcb9bc001360b2a37fd6dc0
Now that mac compatibility has been fixed
BUG: 27657762
Change-Id: I49933ccedf74b9d172967dad721971a752047da6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Bug: 19735423
- Unlike other archs, x86_64 has both usr/lib and usr/lib64. we need
to search for libm.so and libc.so in lib64/. Otherwise the linker
will report error.
Change-Id: I2859bee066a9eb100828d90da8adf0f9817d77e6
(cherry picked from commit 57ef7ea490)
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.
Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).
In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.
We generate prebuilt module only if it's not already defined in the
source tree.
Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb)
We don't need to run rmtypedefs in javac compilation now, because the
runtime libraries are compiled by only jack, which takes care of
rmtypedefs by itself.
Bug: 27828139
Change-Id: Ie480ae5aead8f3f58f956978fc4a05c28a35dec6
The following variables are introduced
BOARD_BVB_ENABLE: can be set to true to build boot.img and system.img
files compatible with Brillo Verfied Boot.
BOARD_BVB_ROLLBACK_INDEX: can be set to an integer to use for the
rollback index.
BOARD_BVB_KEY_PATH, BOARD_BVB_ALGORITHM: If set, the former must be a
path to the private key used to sign the boot image and the latter must
be the algorithm to use. If unset, a test-key stored in the tree will
be used.
BOARD_BVB_MAKE_BOOT_IMAGE_ARGS: Extra options to pass to 'bvbtool
make_boot_image'.
BOARD_BVB_SIGN_BOOT_IMAGE_ARGS: Extra options to pass to 'bvbtool
sign_boot_image'.
BOARD_BVB_ADD_IMAGE_HASHES_ARGS: Extra options to pass to 'bvbtool
add_image_hashes'.
BOARD_CUSTOM_BVBTOOL: Can be set to specify what bvbtool program to
use.
The existing BOARD_KERNEL_CMDLINE variable is also used, as are existing
kernel and initrd-related variables. Therefore, simply adding
BOARD_BVB_ENABLE := true
to an existing Makefile should do the trick.
Bug: 26185038
TEST=Added 'BOARD_BVB_ENABLE := true' to hardware/bsp/intel/soc/edison/soc.mk
and built an image and then ran bvbtool's info_boot_image and
info_image_hashes commands on the resulting boot.img and system.img
files and verified that the information was correct. Also ran 'm dist'
and verified that the boot.img and system.img files in the resulting
target_files.zip file had similar information.
Change-Id: I08045ed8b0cbddc7c3acdd3a6f2c4bb75cb44bbc
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
Currently, we're building against the native host version of libc++ and
other headers. Instead, use prebuilts of ckati/makeparallel built with
Soong against the included libc++ and sysroot. Building ckati /
makeparallel doesn't work well in unbundled branches that don't have all
of the libc++ dependencies to do successful host builds.
KATI is default variable defined when running under Kati, don't use it
for other purposes. Use CKATI instead.
Bug: 27533820
Change-Id: I82d66f5e34e3341a3cee4c5c83cd1d9a54d057ff
* 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
Change-Id: I5edb25b52998d871385dd000778db2ce83224078
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.
The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.
windows-x86/bin <- defaults to 32-bit executables
windows-x86/lib <- 32-bit libraries, like before
windows-x86/lib64 <- 64-bit libraries
windows-x86/obj <- 32-bit intermediates
windows-x86/obj64 <- 64-bit intermediates
Then modules are registered with the names:
host_cross_liblog <- 32-bit, like before
host_cross_liblog_64 <- 64-bit
Bug: 26957718
Change-Id: I9f119411acb43e973ec1e6bca3c1dc291c91556c
config.mk needs to know TARGET_BUILD_PDK in order to select prebuilt
tools. Move the selection of TARGET_BUILD_PDK into config.mk.
Change-Id: I1f73c92917887f27259b2db64b3779a2fe0df162
New version of build/ execute the tools from prebuilts/sdk/tools in
place, old versions copy them to $(HOST_OUT_EXECUTABLES). build/ and
prebuilts/sdk often use mixed versions, set a flag that
prebuilts/sdk/tools/Android.mk can use to determine when it is using an
old build/ directory.
Change-Id: Iad2f96c35203fd3b0976946d229bfa8ab4acb150
Building with USE_NINJA=false and piping build output to a file will
result in ANSI color codes in the build output. Only force ANSI codes
on when building with ninja, which strips the ANSI codes when writing
build output to a non-TTY.
Change-Id: Ifd2fb53799fd99c23b7ad91cdb84d943bf707db0
- 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
The lack of a changing timestamp improves reproducibility of builds, and
helps create smaller OTAs.
Bug: 24204119
Change-Id: I68acfb53be962ffd5c488337517dadb950a13b6f