Commit graph

434 commits

Author SHA1 Message Date
Christopher Ferris
44203f3316 Fix whole static lib handling of duplicate names.
If LOCAL_WHOLE_STATIC_LIBRARIES contains a library that has
two files that have the same name but are in different
directories, only the first gets included.

This fix detects this case, and uses the m option to ar to force the
duplicate object to the end of the archive. After this, using the p
option gets the correct object file.

Change-Id: I2e183f48cef3c79499d4ab8ff147444611ff938b
2015-01-07 18:19:54 -08:00
Stephen Hines
1568029218 Add more support for GLOBAL_CONLYFLAGS.
This will be necessary to support -std=gnu99 mode for clang 3.6, which
defaults to C11 mode (unlike prior releases that use C99).

Change-Id: Iea84582f9f12ba76b988463cbc0a20bd61042538
2014-12-01 15:36:26 -08:00
Dan Albert
e440c3c07b Revert "Fix the libgcc/libatomic link order."
This caused a lot of failures in the libc++ tests, since linking
libgcc.a before libc++.so means that the wrong unwinder will be used.

This patch is still correct, but I will revert for now while I find a
good way to apply it without breaking unwinding.

This reverts commit 741b36e922.

Change-Id: I57e0b89534adf5c1677dbf2f64ac750e74bd5fbf
2014-11-20 15:10:00 -08:00
Ying Wang
634f7992f0 Use ALL_MODULES.$(m).INSTALLED in modules-for-tag-list
Previously we store tag's installed modules in a separate variable
ALL_MODULE_TAGS.$(tag). However we only record the main installed file
for a module, but omit affiliated files like .odex.
With this change, we handle the tagged module the same way as modules in
PRODUCT_PACKAGES.

Change-Id: I7972528a4df5a4ba8bc98930864da9672d32d7fe
2014-11-18 12:48:07 -08:00
Dan Albert
9b0ccb7480 Merge "Fix the libgcc/libatomic link order." 2014-11-17 23:55:57 +00:00
Miao Wang
e23e8080c6 Add -Wl,--hash-style=sysv flag to rs: transform-bc-to-so for compatibility lib.
Bug 18395015

Change-Id: Ib9aecf347c685c8b8b725eecfbc0cec03d9b2c1b
2014-11-15 14:25:33 -08:00
Dan Albert
741b36e922 Fix the libgcc/libatomic link order.
The previous position of libgcc.a/libatomic.a on the link line causes
the linker to prefer satisfying dependencies from these libraries from
other libraries that might include them, rather than from libgcc.a (or
libatomic.a) itself. This imposes an ABI requirement that those
intermediate shared libraries _always_ export those symbols, which is
undesirable.

Change-Id: Ib593236b475d3e98356b2b1be6f96cee2b67378f
2014-11-13 21:29:28 -08:00
Dan Albert
e088c0d281 Refactor transform-o-to-* definitions.
Previously, there was one generic definition for each of the
transform-o-to-* functions in definitions.mk, and one target specific
one in each combo/TARGET_*.mk. The generic one was entirely unused,
and the target specific ones were all nearly identical.

Changing anything in these functions was tedious at best, and often
error prone. The differences between any 32-bit arch and its 64-bit
equivalent were restricted to the name of the linker, and the ARM and
MIPS definitions were identical. The few differences between ARM and
x86 looked to be compatibility for an old (ca. 2008) toolchain issue
with --gc-sections, and a bug (LDFLAGS coming first rather than
later).

To simplify things, I've moved the definitions for these out of
combo/TARGET_*.mk and back into definitions.mk. The differences
between ARM and x86 have been scrapped. Anything that really does
still need to be target specific can be handled as I have the linker:
add a TARGET_FOO variable to the given target and then add it to the
generic definition.

Change-Id: I54dc1bffc32ac39f27f0b87247dd6a6dbaf0b162
2014-11-13 16:21:46 -08:00
Ying Wang
b45f7c35b1 am 8683612f: Merge "definitions.mk: look for definitions.mk in device/*/build also"
* commit '8683612fbd15640ae59daf7ba7c36e1f2ff8e687':
  definitions.mk: look for definitions.mk in device/*/build also
2014-11-05 19:01:47 +00:00
Andrew Boie
388c04dd6b definitions.mk: look for definitions.mk in device/*/build also
build/core/Makefile looks for build tasks in either device/*/build/tasks
or vendor/*/build/tasks. Do the same with vendor-specific definitions.mk.

Change-Id: Ib4fd00a1d0effe8e347382a922da101ce26bf696
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2014-10-28 08:36:00 -07:00
Stephen Hines
0d07cfeaf8 am a503fb36: PIE executables created with mingw use "mainCRTStartup" as their entry point.
* commit 'a503fb362918363b28637b487eba83e9ad647ceb':
  PIE executables created with mingw use "mainCRTStartup" as their entry point.
2014-10-02 15:23:41 +00:00
Stephen Hines
a503fb3629 PIE executables created with mingw use "mainCRTStartup" as their entry point.
Bug: 14416410

Our linker uses "start" as the primary entry point, so we need to adjust this
for mingw-based Windows compiles, or nothing will execute correctly.

Change-Id: I6e99f43e075ef9f00500099ce34ec4425c996454
2014-10-02 00:57:09 -07:00
Ying Wang
c811481734 am a6a6c35c: Return "none" if no matching arch found
* commit 'a6a6c35c3afdf9c4bcd05ea5e4c40983e7e49246':
  Return "none" if no matching arch found
2014-09-26 21:57:12 +00:00
Ying Wang
a6a6c35c3a Return "none" if no matching arch found
So result of get-prebuilt-src-arch can be passed to
LOCAL_MODULE_TARGET_ARCH, which takes empty string as "any" actually.

Change-Id: I916c9738ccce4a94ac084fb4141d54659e896a1f
2014-09-26 10:41:27 -07:00
Tim Murray
3a20a17111 am 965fa22d: am 039cd7e0: Merge "Add LOCAL_NO_FPIE."
* commit '965fa22d85aa1af3974c5f32e3c3325e66781f73':
  Add LOCAL_NO_FPIE.
2014-09-03 23:07:46 +00:00
Tim Murray
595d0dbd5b Add LOCAL_NO_FPIE.
Not all executables should be built with -pie.

bug 15814177

Change-Id: I402e8a531866b507ee80a0bf677f9f3551ca7693
2014-09-03 15:39:50 -07:00
Stephen Hines
2138f5ecbc am 52626d2a: Fix build breakage due to incorrect bcc_compat RS_TRIPLE.
* commit '52626d2a7b4767905e8a369ddc8316c1290ad156':
  Fix build breakage due to incorrect bcc_compat RS_TRIPLE.
2014-09-03 14:34:52 +00:00
Stephen Hines
5c72544d48 Fix build breakage due to incorrect bcc_compat RS_TRIPLE.
Bug: 17333374
Change-Id: I13582ce0cde86f7b3728aa4f45a5197438d65a2d
(cherry picked from commit 52626d2a7b)
2014-09-02 21:46:25 -07:00
Stephen Hines
52626d2a7b Fix build breakage due to incorrect bcc_compat RS_TRIPLE.
Bug: 17333374
Change-Id: I13582ce0cde86f7b3728aa4f45a5197438d65a2d
2014-09-02 19:09:35 -07:00
Dan Albert
c3733c7765 am 467f8f32: am df73a5fa: Merge "Performance improvement for whole static libs"
* commit '467f8f326b979b43b6be48d5294f0627cf8fdd71':
  Performance improvement for whole static libs
2014-08-20 21:28:49 +00:00
Dan Albert
e0f44ac25d Performance improvement for whole static libs
Improves performance for LOCAL_WHOLE_STATIC_LIBS by copying the first .a
to the new .a rather than extracting and recreating

Change-Id: Iecdb5e4bb2ce987bb41a70c3393d18a6d72ae689
2014-08-20 13:58:36 -07:00
Ying Wang
0a5db68c01 am 66a2aa21: am 9c80e8a5: Merge "Apply TARGET_GLOBAL_LDFLAGS to transform-bc-to-so"
* commit '66a2aa2180ca161bf73d2554972f9952b8e1bb7d':
  Apply TARGET_GLOBAL_LDFLAGS to transform-bc-to-so
2014-08-14 02:22:56 +00:00
Ying Wang
bfd651600c Apply TARGET_GLOBAL_LDFLAGS to transform-bc-to-so
This fixes mips unbundled build since we switched to mips64el toolchain
for both mips and mips64.
TODO: multilib build support.

Change-Id: I7add92d2cecfc3ab739785ceef6700240a25093a
2014-08-13 19:03:16 -07:00
Ying Wang
903e2dd014 Apply TARGET_GLOBAL_LDFLAGS to transform-bc-to-so
This fixes mips unbundled build since we switched to mips64el toolchain
for both mips and mips64.
TODO: multilib build support.

Change-Id: I7add92d2cecfc3ab739785ceef6700240a25093a
2014-08-13 18:47:50 -07:00
Dan Albert
04cf315970 Inhibit implicit -Bsymolic in -shared.
Bug: 16853291

Change-Id: Id70488b077256a70137c4417f21be2c2d1d4341c
(cherry picked from commit b6bb71b85d)
2014-08-08 08:15:19 -07:00
Dan Albert
908ab54fda Fix uses of -fPIC and -fPIE.
We've been using -fPIC and -fPIE together in the global cflags all this
time. These options are incompatible. The only reason we haven't been
hit by this before is because of the forced -Bsymbolic in GCC. To fix
this, pass -fpic when compiling objects for shared libraries and -fpie
when compiling objects for executables. For static libraries, also use
-fpic. We have to do this because static libraries might be included in
either a shared library or an executable. Code compiled with -fpie
cannot be included in a shared library, but code compiled with -fpic
may be included in an executable.

We've also been using -fpic and -fPIC together. These are different
options, and only the latter will take effect.
http://stackoverflow.com/a/967010

The final thing this fixes is that we had -f(PIC|PIE) flags being passed
to link commands. These are compile time flags, and don't do anything at
link time.

Bug: 16823325
Change-Id: Ic76f47e63dc2c81b7e1a8058bae1b3dc8565d606
(cherry picked from commit 4803ce2696)
2014-08-08 08:15:14 -07:00
Dan Albert
9d6aa51a0f am e99d8947: am cbc742a1: Merge "Inhibit implicit -Bsymolic in -shared."
* commit 'e99d8947c09731d71db7e95a280cf81f51f4049a':
  Inhibit implicit -Bsymolic in -shared.
2014-08-08 00:23:56 +00:00
Dan Albert
d423e5fbdb am 897cd3d4: am afae9fd8: Merge "Fix uses of -fPIC and -fPIE."
* commit '897cd3d494272b8a6a12f0fb6d02bfe7426a309c':
  Fix uses of -fPIC and -fPIE.
2014-08-08 00:23:55 +00:00
Dan Albert
4803ce2696 Fix uses of -fPIC and -fPIE.
We've been using -fPIC and -fPIE together in the global cflags all this
time. These options are incompatible. The only reason we haven't been
hit by this before is because of the forced -Bsymbolic in GCC. To fix
this, pass -fpic when compiling objects for shared libraries and -fpie
when compiling objects for executables. For static libraries, also use
-fpic. We have to do this because static libraries might be included in
either a shared library or an executable. Code compiled with -fpie
cannot be included in a shared library, but code compiled with -fpic
may be included in an executable.

We've also been using -fpic and -fPIC together. These are different
options, and only the latter will take effect.
http://stackoverflow.com/a/967010

The final thing this fixes is that we had -f(PIC|PIE) flags being passed
to link commands. These are compile time flags, and don't do anything at
link time.

Bug: 16823325
Change-Id: Ic76f47e63dc2c81b7e1a8058bae1b3dc8565d606
2014-08-07 10:20:58 -07:00
Dan Albert
b6bb71b85d Inhibit implicit -Bsymolic in -shared.
Bug: 16853291

Change-Id: Id70488b077256a70137c4417f21be2c2d1d4341c
2014-08-07 15:43:16 -07:00
Ying Wang
7f625aad03 Improve rules of split apks.
- Better messaging if the expected split apk isn't generated by the aapt
  command in the base apk rule; Remove the built base apk, so make will
  rerun aapt after the user changes the splitting parameters.
- Use cleaner static pattern rules instead of running $(foreach) with
  $(eval).

Bug: 16319961
Change-Id: If6ae302e1a39d2e0db8f784d4e1cf292ec855281
2014-07-23 16:38:06 -07:00
Ying Wang
1425e2d8c0 Support LOCAL_PACKAGE_SPLITS.
Support LOCAL_PACKAGE_SPLITS, which accepts a list of resource lables
and generates multiple apks. The build system sets up rules to sign and
zipalign the split apks.

Bug: 16319961
Change-Id: I344b3d1c7eb158c6d0df879093d666a89870aadd
2014-07-22 17:37:11 -07:00
Ying Wang
af9757e849 New installation path for apks and their JNIs.
Apk's path is changed to <parent_dir>/MyApp/MyApp.apk;
JNI path is changed to <parent_dir>/MyApp/lib/<arch_name>/libfoo.so.
Symlinks of JNIs are changed accordingly.

Bug: 16319961
Change-Id: Ib3b2309c95fa9aea27837fcc29e28d990b04747b
2014-07-18 16:26:24 -07:00
Yohann Roussel
e019dfd721 Support dx generating multiple dex files.
Dx is now capable of generating multiple dex file in one run.
This capability is not compatible with --output=*.dex so this CL
changes the --output argument to be a directory. This CL also
includes the packaging of the multiple dex files when dx generates
more than one dex file.

(cherry picked from commit 8ffe9c3e79)

Conflicts:
        core/java.mk

Change-Id: I1ddc91b416de5929d4d4b41824c6012b32f94deb
2014-07-16 12:38:22 +02:00
Ying Wang
58f8cf7273 am 904446ce: am 1a3d260f: am e69d4350: Merge "Support to add JNI of both archs in multilib build."
* commit '904446ce0b3f430ac88ae0c08b9c613721474cd5':
  Support to add JNI of both archs in multilib build.
2014-06-25 18:52:02 +00:00
Ying Wang
8e20ef6205 Support to add JNI of both archs in multilib build.
Use "LOCAL_MULTILIB := both" to install jni libraries of both archs in
multilib build.
The build system will package jni of both archs to the apk, or install
them to the right location on the system image and create symlinks,
extract .so files from prebuilt apk, etc if appropriate.

Bug: 15849902
Change-Id: I7e147b5a47db476584c38250de7b36c75ea40d81
2014-06-25 09:07:01 -07:00
Colin Cross
bf2f0c729b am a1ac4736: am b110da5f: am 9d8854e3: Merge "build: delete 64-bit blacklist"
* commit 'a1ac47367636c0473156679f8f30af626df7da85':
  build: delete 64-bit blacklist
2014-06-18 21:40:27 +00:00
Colin Cross
ae2986e51a build: delete 64-bit blacklist
The last projects in the blacklist have been fixed, delete the code.

Change-Id: I0fe7809bd18e32516374c9cb2a6f71df1d3c62ee
2014-06-17 21:35:44 -07:00
JP Abgrall
0ed7cec97a core: Fixup assert-max-image-size/assert-max-file-size usage
- Remove the incorrectly used (and unused) 3rd arg to assert-max-image-size
- Remove test for fstype in assert-max-file-size() as it was always
  set to a value leading to 0.

Change-Id: I0a1182fcc85c6c3801d45731e691b9bb38657606
Signed-off-by: JP Abgrall <jpa@google.com>
2014-06-16 14:20:40 -07:00
Ying Wang
01c4f4622b am dceddd91: am 79b46720: am 02f98a26: Merge "Fix loophole in module expansion."
* commit 'dceddd91d9a6516346e752b9f942747bea931cfa':
  Fix loophole in module expansion.
2014-06-11 20:49:20 +00:00
Ying Wang
541b1d0f7c am fe9ad097: am b1f65358: am 5ad17493: Merge "Support .asm being compiled by yasm targeted for x86."
* commit 'fe9ad0975ade10219a5fa9a77d034ba77735e393':
  Support .asm being compiled by yasm targeted for x86.
2014-06-11 17:44:54 +00:00
Ying Wang
e1b867dde7 Fix loophole in module expansion.
Previously we only expanded product_MODULES with LOCAL_REQUIRED_MODULES,
but not modules introduced by LOCAL_SHARED_LIBRARIES; Later we did a further
shared libary expansion in vendor_module_check.mk.
It couldn't track C in the following case:
A : B, by LOCAL_SHARED_LIBRARIES; B : C, by LOCAL_REQUIRED_MODULES.

With this change, we transformed the LOCAL_SHARED_LIBRARIES dependencies
into LOCAL_REQUIRED_MODULES dependencies before doing the required
module expansion and the loophole is closed.
All module names are now expanded to product_MODULES now and it makes
vendor_module_check.mk simpler.

Change-Id: I8835a478d2ce0ce10601a8449f446f07b01c2b7f
2014-06-10 14:30:30 -07:00
Ying Wang
7b913ce6fa Support .asm being compiled by yasm targeted for x86.
Change-Id: Icd6626a082facf920b0e49e2fbe8861e94400552
2014-06-06 11:00:36 -07:00
Ying Wang
8b73a86834 am 834ec0ea: am d3ddfdf8: am b3bed595: Merge "Add a dummy build recipe for generated RS cpp files."
* commit '834ec0ead591cf64a5f660af0210e95728e08c4f':
  Add a dummy build recipe for generated RS cpp files.
2014-05-28 23:45:29 +00:00
Ying Wang
d3ddfdf847 am b3bed595: Merge "Add a dummy build recipe for generated RS cpp files."
* commit 'b3bed5952b44e69dc9e1988beb4092303084ef61':
  Add a dummy build recipe for generated RS cpp files.
2014-05-28 23:38:46 +00:00
Ying Wang
81ab8339fe Add a dummy build recipe for generated RS cpp files.
Previously the RS cpp files are generated by the timestamp rule. Though
we have the generated RS cpp files depend on the timestamp file, we
don't have a build recipe. In such case gmake does some "optimization"
that it skip recompiling the generated cpp files, because it assumes the
generated cpp files are already up to date even if the rs files have
been updated.

Bug: 15313144
Change-Id: Ie69ecd2c788057d3619f9c7d2a125d44c4a534a1
2014-05-28 16:17:09 -07:00
Dan Albert
a5b0b1303d am 3805f619: Merge "Revert "Fix for duplicate names in whole static libs""
* commit '3805f619156163eab8ad92fd51b4a431be1287bd':
  Revert "Fix for duplicate names in whole static libs"
2014-05-27 19:44:19 +00:00
Dan Albert
3c12b5c02b Revert "Fix for duplicate names in whole static libs"
This reverts commit 0e5ce8be34.

Change-Id: I68b776cb915fd7be8299ddb2899907046dddadf3
2014-05-27 19:30:36 +00:00
Dan Albert
212772f632 am 31101623: Merge "Fix for duplicate names in whole static libs"
* commit '31101623b3e621436f6b46f49242ed4642d86164':
  Fix for duplicate names in whole static libs
2014-05-27 18:26:38 +00:00
Jeff Brown
4c4aa99ced Support more precise package exclusion from JAR files.
Allow LOCAL_JAR_PACKAGES to work on subpackages.  Previously it
only worked on top-level packages due to a bug in how the directories
were recursively deleted.

Add LOCAL_JAR_EXCLUDE_PACKAGES to allow specific subpackages to
be excluded.  This rule applies after LOCAL_JAR_PACKAGES has
selected which packages to include.  It may also be used independently.

Change-Id: Ibd0e495be1a20c84b59c9da132e92100ef3f8705
2014-05-23 18:41:19 -07:00