Commit graph

83 commits

Author SHA1 Message Date
Colin Cross
067d781530 Remove global linker search paths
Remove the global linker search path, as it can cause spurious build
failures.  If a library with the same name as a system library is in the
process of being written to the directory in the global search path, and
the linker may try to read the partially-written built one instead of the
system one.  We already use full paths to libraries for target builds,
do the same for host builds.  Also remove the normalize library
functions, they are no longer necessary.

Test: m -j checkbuild
Bug: 31393456
Change-Id: If9fc631e111f568c700fd73e103445c30d7e9d11
2016-09-09 11:01:15 -07:00
Dan Willemsen
e72fc63901 Merge "Add NATIVE_TESTS class, move host native tests" 2016-06-06 23:59:23 +00:00
Dan Willemsen
056609ccfe Remove unnecessary variables
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
2016-05-25 21:23:20 -07:00
Dan Willemsen
7fe992c0cc Add NATIVE_TESTS class, move host native tests
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.

So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].

Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.

Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.

Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
2016-05-24 12:43:16 -07:00
Dan Willemsen
174feb906f Remove (C|CPP|CONLY|LD)FLAGS checked by Soong
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
2016-05-18 18:10:04 -07:00
Dan Willemsen
8308f506ce Remove (TARGET|HOST)_NO_UNDEFINED_LDFLAGS
We never use it for host modules, and all the target configurations use
the same linker argument. This matches Soong.

Change-Id: Ibcba9a4ce340c7a12306d1fee620a04027c0e292
2016-05-18 12:50:53 -07:00
Dan Willemsen
4863dafcb1 Remove make variables exported from Soong
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
2016-05-16 20:39:58 -07:00
Dan Willemsen
6a54a9f10a Darwin: Use the same ar as Soong
Soong uses the copy of `ar` in the OSX SDK instead of the wrapper in
/usr/bin/ar. /usr/bin/ar appears to be a thin wrapper that looks up the
current SDK and passes execution to it. Soong does this so that it can
actually set up a dependency on the tool.

Change-Id: Ia4e4fbe3287539933fa98a1354c3ccee91f4d552
2016-03-29 16:21:32 -07:00
Dan Willemsen
441d646c6f Fix C++ on Darwin
We've been including the system libc++ headers even if we're building
against our version of libc++. Stop doing that, and only add the headers
to our path if we're using the system libraries.

If nothing is specified, on recent OSX versions, libc++ is the default
c++ library instead of libstdc++. We've been explicitly including the
libc++ headers on all versions, but that breaks old versions. Force us
over to libc++, since the system libstdc++ does not support C++11, and
libc++ is still supported on our oldest version (10.8).

Change-Id: I1fccee8da0f425e10ccc9d3247ed40664eb6ada0
2016-03-08 20:15:21 -08:00
Dan Willemsen
fcefd5f6d8 Remove support for Darwin 10.6 SDK
Our minimum version is 10.8

Change-Id: I2f1984c2227861a3c784f2a5070853c2d1b250d6
2016-03-08 13:22:36 -08:00
Shinichiro Hamaji
0e7587a9ea Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries
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
2015-11-04 15:23:59 +09:00
Elliott Hughes
7f80a9ed44 Remove the now-empty darwin AndroidConfig.h.
Change-Id: Icdbb06514c099653923aae936c31abfbaeaccf7a
2015-07-30 09:16:01 -07:00
Ying Wang
30127bfdad Add $ORIGIN/lib[64] to host binary's rpath.
Normally the binaries use the exsiting $ORIGIN/../lib[64] with binaries
in the bin subdirectory;
For historical reason the binaries in the SDK package don't have a bin
subdirectory. This workaround enables them to work in the existing SDK
directory structure.

Bug: 21301578
Change-Id: Ibebfbfb8b30e81e7bbaf13a21bb205f3f0282d24
(cherry-pick from commit 4fe7bfd373)
2015-06-01 11:28:02 -07:00
Ying Wang
aaf9a5b0cc Remove ancient ranlib workaround on Mac OS X.
Apparently we don't need it for Mac OS X 10.7 and above.

Change-Id: I5ee81700c16e8c66b2d5f2b373fd2d523b5ec018
2015-04-09 10:06:33 -07:00
Al Sutton
1199f7388c Fix building on modern versions of Xcode and OS X.
Add the build options to support the most recent versions of XCode and
add 10.9 to the list of OS X SDKs which the AOSP code can be built with.

Based on patch from https://groups.google.com/d/msg/android-building/kePgJmYBUdM/0C_d1OZflvcJ

Change-Id: I97ffe45d3c54a095952a4ac6accb938623b8fa1e
Signed-off-by: Al Sutton <al@funkyandroid.com>
2014-11-10 14:42:30 +00:00
Stephen Hines
781094fa43 Remove unnecessary 10.8-specific build rules
We no longer need gcc for host builds, since those all run through clang. This
header include, however, triggers errors about SSE intrinsics by replacing
the more relevant include dirs that we should be using.

Change-Id: I26a949f0109de8e6e2d1f09cb8127be927549cc4
2014-10-17 17:36:42 -07:00
Ying Wang
5e2ebcbe26 Use hermetic host toolchains.
Change-Id: I6bb72b5728d1075be9645f8473dcf3db759fa66a
2014-07-28 15:14:51 -07:00
Ying Wang
ef773d22ca Fix the missing 2nd arch prefix.
Bug: 13751317
Change-Id: Ie5a323a0a89245576dbc91271d3178574942627d
2014-05-16 16:22:32 -07:00
Ying Wang
6feb6d5607 Support host multilib build
This change basically ported our target multilib to the host side.
It supports 2 host build modes: x86 and x86_64 multilib build.
For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64
multilib build. Later we'll default to x86_64 build and have a flag
to force 32-bit only build, which may be needed by SDK build.

In host module definition, like in target ones, you can use the
following
LOCAL variables to set up multilib configuration:
LOCAL_MULTILIB: can be "both", "first", "32" or "64".
It also supports the same set of arch or 32-vs-64 specific LOCAL
variables.
By default, it builds only for the first arch.

To keep path compatibility, in x86_64 build files are still output to
out/host/linux-x86; Both 32-bit and 64-bit executables are in
out/host/linux-86/bin;
In x86_64 build 32-bit shared libraries are installed to
out/host/linux-x86/lib32
and 64-bit shared libraries are installed to out/host/linux-x86/lib;
32-bit object files are output to out/host/linux-x86/obj32 and 64-bit
object files
are output to out/host/linux-x86/obj.

Bug: 13751317
Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
2014-05-14 16:55:04 -07:00
Tim Murray
d318ba66f9 Update build system for better Clang behavior on Mac.
Change-Id: I1813954681b670807d7e3faaf6d5f5a769cc5f2e
2014-04-22 09:26:22 -07:00
Tim Murray
02cefc93a8 Make Clang host builds hermetic on Linux.
This lays the groundwork for making builds hermetic on Darwin as well.
That will be fixed in a future patch.

bug 13435344

Change-Id: Iae82d0b9efad0598d682ff5fd4daa737aa607866
2014-03-24 19:38:47 -07:00
Ian Rogers
aa54033b46 Define __STDC_CONSTANT_MACROS globally to work around host build differences.
Change-Id: I945128b3087b28f62467c7123b759e3514027574
2014-03-10 16:49:41 -07:00
Ian Rogers
c61a9425cd Revert "Define __STDC_LIMIT_MACROS globally to work around host build differences."
This reverts commit 668427c941.

Change-Id: I3694aad84e7499e4c6839db0bd06acf5166e4802
2014-03-10 23:27:01 +00:00
Ian Rogers
668427c941 Define __STDC_LIMIT_MACROS globally to work around host build differences.
Change-Id: I571fc5a4b35c830ca8de4dc3117aef258dffa1bd
2014-03-10 15:30:39 -07:00
C. Sean Young
b47c863ec7 Strip all symbols on x86
Strip all of the non-dynamic symbols on x86 targets,
instead of just the debug symbols.

Change-Id: Id799a6a8c8b0e8bf70977328e42e5efa23762f25
2014-02-19 12:53:43 -08:00
Ian Rogers
61e5059ef7 Fix the host inttypes.h problem globally.
Bug: 12708004
Change-Id: I2c75647bac304b82e150c540b9e6c5568997596d
2014-01-29 16:29:11 -08:00
Torne (Richard Coles)
71f8b245ce Don't try to group static libraries on mac.
Mac's linker doesn't support --start-group and --end-group; it scans
libraries repeatedly even without these options, so it's not necessary.

Change-Id: If22527e75470f7fa9452dc33efe4d40a60d0919a
2013-03-11 14:59:42 +00:00
Ying Wang
eb98e08893 am 865d851a: Merge "Remove the obsolete comments and change the misleading var name."
* commit '865d851a8012e13c35d573d98770b7187d32b7f7':
  Remove the obsolete comments and change the misleading var name.
2012-11-12 14:45:59 -08:00
Ying Wang
85e8cda340 Remove the obsolete comments and change the misleading var name.
Change-Id: Ib19099cbce0133f5c7df44fa0fd80215809a1ad8
2012-11-12 14:31:20 -08:00
Andrew Hsieh
abfb25226a resolved conflicts for merge of 8b3ce5a3 to stage-aosp-master
Change-Id: I588a055812ddc8f4531c9d02994beb366f9aab3e
2012-11-12 12:50:03 -08:00
Andrew Hsieh
e2e28f6d02 Use prebuilt gcc for MacOSX
1. Use prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1
   See https://android-review.googlesource.com/#/c/46223/
2. Rewrite logic dealing with mac_sdk_version to support all
   MacOSX SDK 10.6, 10.7 and 10.8.  Note that since
   ad2342375963c2468849c1f83a97158383db6511 emulator no longer
   depends on 10.6 to build.  Since the lowest SDK among intersection
   of the "available" and the "supported" SDKs is picked, add a
   new variable MAC_SDK_VERSION for developer really want to overwrite
   it.  MAC_SDK_VERSION still has to be one of the supported, though.
3. Improve mac_sdk_path detection to deal with case where Xcode
   *dmg is mounted only, not installed at /Applications.
4. Now we can retire BUILD_MAC_SDK_EXPERIMENTAL

Change-Id: I83e463556a857d527710f766de0e19e1b576151f
2012-11-12 10:44:52 -08:00
Ian Rogers
76a6dc3a19 Fix common typo in comments, warning and error messages.
s/can not/cannot/g

Change-Id: I1bac31157732666deb46f6f20389ff539977ffb9
2012-10-01 16:36:23 -07:00
Ying Wang
5bdf305bbe Move AndroidConfig.h from system/core to the build project.
So unbundled branches don't need to include the system/core project.

Change-Id: Ic4ef62ee6df069b9b2dd123aed95a3e7fcdfc146
2012-09-20 10:33:20 -07:00
Jean-Baptiste Queru
cd9668edd4 am e3479ea5: am 15012c11: Merge "Build on Mac OS X : add experimental SDK versions"
* commit 'e3479ea5033e2ede36f6f771dd3a6ea315505efd':
  Build on Mac OS X : add experimental SDK versions
2012-08-22 09:57:30 -07:00
Jean-Baptiste Queru
15012c115d Merge "Build on Mac OS X : add experimental SDK versions" 2012-08-22 09:44:48 -07:00
SangWook Han
691e0243ca Build on Mac OS X : add experimental SDK versions
Change-Id: Ifc67d1745e72fc048cd6e8c8ef0521ab92468086
2012-08-22 02:59:58 +09:00
Andrew Hsieh
31ef1037bf Added BUILD_HOST_static to build statically linked executable/shared-lib
Statically linked executable/shared-lib (eg. SDK tools) are useful
in sandboxed environment.

In BUILD_HOST_static zipalign needs -lpthread indirectly:
zipalign->libutils.a->liblog.a->logd_write.c->pthread

Change-Id: I615f574e918c83ed1ab82db2453b69d0420cb59c
2012-08-21 14:40:16 +08:00
Ying Wang
da4bf42514 Don't include system/core/include/arch/<arch>/Android.mk for apps-only build.
Bug: 6994483
Change-Id: I76c4d96264cf94a79d59fdeb52bb37c07a9458dd
2012-08-16 16:45:01 -07:00
Ying Wang
dfb5818027 am d512fda4: am e42ed0ba: Merge "Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk"
* commit 'd512fda4ae7cc56cc9b83fcb6e7a9e0d0f02c259':
  Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
2012-06-29 20:22:20 -07:00
Ying Wang
d512fda4ae am e42ed0ba: Merge "Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk"
* commit 'e42ed0ba1571f20866609710ba7c73fd138c0405':
  Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
2012-06-29 20:19:50 -07:00
Ying Wang
478ba5e3f0 Move the llvm-gcc warning from HOST_darwin-x86.mk to main.mk
Bug: 6754632
So the warning won't show up when you run lunch.
Now the warning only shows when you do a clean build.

Change-Id: I7876da783f059d390f0072df37d3ab0291589eb7
2012-06-28 16:02:19 -07:00
Ying Wang
e556005331 resolved conflicts for merge of 5c0ee702 to master
Change-Id: I6bdcc87482c45988d410a4c4d0abc43a1416277e
2012-06-08 09:37:54 -07:00
Ying Wang
5c0ee702d6 am 79d39a30: am 874563f9: Merge "Fix generic build on Max OS X 10.7 Lion"
* commit '79d39a303e036dc70eccf2e2e7489fa0bbfd3a4b':
  Fix generic build on Max OS X 10.7 Lion
2012-06-08 09:27:08 -07:00
SangWook Han
02eb37c267 Fix generic build on Max OS X 10.7 Lion
Recover variable build_mac_version which is removed on
    commit 644dc16 and added on commit 9ce06f1.

    Without this, ranlib libSDL.a is executed on Lion which
    causes build fail of emulator-arm.

Change-Id: I06144a288921f8f968ef457999398c1b9152d4aa
2012-06-08 14:55:05 +09:00
Ying Wang
10f775379d Tweak cflags for building with SDK 10.6.
Change-Id: I4db9949577591ef6756812769f04cfaddd876faf
2012-06-07 17:10:53 -07:00
Ying Wang
fcc2a604af am f1e424a6: am 3da13457: am 4b030617: Merge "XCode 4.3+ compatibility check-in"
* commit 'f1e424a63658eb15ba61ca2eb8f0df38733188fe':
  XCode 4.3+ compatibility check-in
2012-06-07 12:03:46 -07:00
Ying Wang
f1e424a636 am 3da13457: am 4b030617: Merge "XCode 4.3+ compatibility check-in"
* commit '3da13457cfa46cf7d46b57c00f387c7c310b2dba':
  XCode 4.3+ compatibility check-in
2012-06-07 12:02:06 -07:00
Al Sutton
51f9bb02da XCode 4.3+ compatibility check-in
XCode 4.3 and later use a different location for SDKs. This check in
ensures the build checks for the new location as well as the old one.

Change-Id: I97884e5009f229f8b42e57a8feeb702b3a40a241
Signed-off-by: Al Sutton <al@funkyandroid.com>
2012-06-07 19:10:13 +01:00
Ying Wang
130ae6adcb resolved conflicts for merge of 9f4d00b9 to master
Change-Id: I1818896ae714aa54ad980bfbf7648652369497e5
2012-06-05 15:44:21 -07:00
Ying Wang
9f4d00b94b am e534e2eb: am 47450542: Merge "Use Mac OS X SDK 10.6."
* commit 'e534e2eb2b5e79facf24c31eb2f60b8a0ee1f5b7':
  Use Mac OS X SDK 10.6.
2012-06-05 15:25:39 -07:00