Remove Toolchain.GccRoot, Toolchain.GccVersion, and Toolchain.GccTriple
that were only used by an unused function. This removes most of the
references to GCC, although there are still some left in the host
toolchains.
Test: No change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_raven-userdebug
Change-Id: I72b8af1f9aa83e6e15c9e00ed1e817b6cc3a031a
Remove many of the overridden methods from toolchainBase in favor
of having smaller composable types. toolchainNoCrt, toolchain32Bit
and toolchain64Bit now only provide a few methods and can be mixed
in to any toolchain type. toolchainLinux, toolchainBionic,
toolchainWindows and toolchainDarwin now embed toolchainBase to provide
the default flags methods for when they don't override them.
This avoids the need for disambiguation methods required when a
type embeds two types that implement the same method.
Test: cc_test.go
Change-Id: I641da2a47aba597c517f693efedb65cf41273c82
* Only prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/bin
exists for x86_windows_host.
* Remove config.ToolPath;
add required -B flags into ToolchainCflags and ToolchainLdflags.
Bug: 218883919
Test: make droid tidy-soong_subset
Change-Id: I9a18bf8cc0cf84e091c7463b3bda316eaab53aa3
We're now packaging llvm-windres (aosp/1870074) which can be used as a
substitute for GNU binutils' windres, but we've also removed the last
consumer of .rc files in aosp/1867048 (external/mdnsresponder/).
In the worst case, we can bring back support for .rc files but instead
process them with llvm-windres.
Bug: 203794880
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I30a873537e004b46a87191a932d076a89463c873
Rename the ninja variables that have an extraneous Clang in the name,
since there are no longer any non-Clang variables.
Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I081d5e1d423a66d55faece6cb1d265cd5e504d5f
Remove cflags that are not handled by clang from the global defaults,
and remove calls to ClangFilterUnknownCflags.
Squash lists of clang-specific default flags into the main default
flags lists.
Rename Toolchain.Clang*flags to Toolchain.*flags.
Rename Go variables with Clang in the name that have no non-Clang
equivalent.
Remove unused ninja variables.
Bug: 68947919
Test: no change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_crosshatch-userdebug
Change-Id: Id287945315d53e5eaef197adbbb4f1302f2e3680
Bug: http://b/116784799
Previously this was set only when stl was requested. We can now pass
this for all C++ compilations.
Test: go/android-llvm-windows-testing
Change-Id: I43e635ff50d0f1a5e000f13021506aeece368b4a
The default build-id is generated using timestamp. Pass -Brepro to
avoid using timestamp for deterministic build.
Bug: 153462962
Test: build fastboot.exe twice, got same shasum
Change-Id: I38fe993eec23c60bfcf1b76188774bfe06839fa4
This was unnecessary in the past, when -nodefaultlibs was used while
linking, but that changed with
aosp/I722bd6596a1f3f5819f2767c29c0fa1e8b3ec0e8.
Test: simpleperf_ndk64.exe no longer depends on libgcc_s_seh-1.dll.
Change-Id: I435d7302906eb3758e758b5aefca8763bfba6290
Building Skia for Windows requires linking some Windows libraries that
were not in the list of available ones. This adds the necessary
libraries.
Test: N/A
Change-Id: I803b7b05f47163316c6f03866145dc50656a6bef
This is needed to build libicui18n on Windows, as it depends on APIs
created in Windows 7 (ResolveLocaleName).
Test: sdk build
Change-Id: If64510a262f7f1d4d356b1a9960ceea114cfa78a
Bug: http://b/109759970
Bug: http://b/91353691
There are no multiple-defintion errors after switching to clang-r339409
and libc++.
Test: m native-host-cross
Change-Id: I5576b3894ed1d88c9b2e5f4d92e1d3bfadfb029b
- Stop including libstdc++ headers.
- '-pthread' and 'static-libgcc' are unused when we pass -nodefaultlibs.
We didn't pass -nodefaultlibs for libstdc++.
- Use SjLj exceptions for 32-bit. libgcc_eh implements SjLj exception
model for 32-bit.
- Disable visibility annotations for libcxx and libcxxabi since we are
only going to support these as static libraries.
- Use Win32 threads. MinGW pthreads throws an error when building
libcxx since it's pthread_mutex_initializer is not constant (needs a
cast).
- Link libgcc_eh, which needs pthread, which in turn depends on
kernel32. Wrap the libraries with --start-group and --end-group and
remove duplicates.
Test: Build and test Windows binaries under Wine.
Change-Id: I8be51b004585e11ef51b7d5012f2a51330d1260f
Bug: http://b/109759970
r335286 fixed this for 64-bit Windows. This remains broken for 32-bit
Windows.
Test: m native-host-cross
Change-Id: I4d11b83d51db055406c6723aad89efd1b86b9b7b
We need to keep support in Soong until toolchain_library no longer uses
GCC.
Test: out/build-aosp_arm64.ninja is the same before/after
Test: build_test on downstream branches
Change-Id: Ib78bcd6d5544afc3a3164f65fa72a3f08b2acf29
Bug: https://issuetracker.google.com/36952278
Bug: http://b/113171785
From
https://android-review.googlesource.com/c/platform/system/core/+/737292:
The --dynamicbase linker flag enables use of Address Space Layout
Randomization (ASLR) on Windows Vista and newer. It causes the code
segment / module to be loaded at unpredictable addresses to make
exploits harder to construct.
The --nxcompat linker flag enables use of Data Execution Protection
(DEP) on Windows XP SP2 and newer. It causes the process to be killed if
the process tries to execute code on memory pages not marked executable.
This makes exploits harder to construct because the stack is then not
executable, other data pages aren't, etc.
These bits are already set on AdbWinApi.dll and AdbWinUsbApi.dll.
--high-entropy-va provides improved ASLR.
Credit: Spencer Low for doing the initial work at
https://android-review.googlesource.com/c/platform/system/core/+/737292.
Test: Verify that DLLCharacteristics reported by 'objdump -x' is:
0x140 for 32-bit and 0x160 for 64-bit. Also verified trivial use
cases under Wine.
Change-Id: I1b898cd36c7c627916dae9ce7dfd1c27de1e3c59
Bug: http://b/69933068
- Remove GCC's intrinsic header path so Clang's headers get included.
- Add '-B' with GCC's binary directory so Clang detects the linker.
- Bug: http://b/109759970 - Pass '--allow-multiple-definition' linker
flag to deal with ld.bfd's inability to handle Clang-generated section
names is fixed.
- Bug: http://b/110800681 - lld cannot link Android's Windows modules
yet
Test: m native-host-cross and run adb_test.exe under wine.
Change-Id: I9be9cfc34a47cbeee04024438dea214305112eaa
Bug: http://b/69970955
With the MinGW prebuilts update (http://aosp/709402), executables get a
runtime dependency on libgcc_s_sjlj-1.dll with both gcc and Clang.
Passing -static-libgcc removes this dependency and is a better option
than having to package an extra dll with executables.
Test: Run gcc-built adb_test.exe under wine
Change-Id: I18e5fadb1b8ace510ae684e2d4cfa7fe7d007cff
* Add -fuse-ld=lld to hostGlobalLldflags.
* Set up *ClangLldflags variables for hosts.
They are the same as *ClangLdflags, but could be changed in the future.
Bug: 73768157
Test: make checkbuild
Change-Id: I3d61504ab7262d472bbf933df7c1a9bef62519e1
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
use clang's lld instead of ld or ld.gold.
* When lld is enabled:
* ld-only flags are not passed to 'lld'.
* location_packer is disabled.
* Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
* In Android.mk files use LOCAL_USE_CLANG_LLD := false.
* In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
all other hosts and targets do not call lld yet.
Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
This just copies most of what exists for clang on Linux, but doesn't
actually turn on clang support.
Bug: 69933068
Test: m nothing; compare ninja files
Change-Id: I2cf203026e7ced32004a91d7f3baf4a6415085eb
Move all the flags that are used everywhere (or should be used
everywhere) into cc/config/global.go:
-no-canonical-prefixes
-fno-exceptions
-Wno-multichar
-O2
-g
-fno-strict-aliasing
Also remove flags that are already in noOverrideGlobalCflags:
-Werror=pointer-to-int-cast
-Werror=int-to-pointer-cast
x86 and x86_64 were specifying -fstrict-aliasing, but that was
being overriden later by -fno-strict-aliasing, so remove it.
ARM devices still override -fno-strict-aliasing to -fstrict-aliasing
when using ARM (vs. Thumb) instruction set.
Bug: 68855788
Test: m checkbuild
Change-Id: Ia2b5891bdefb60f974ad92b4b84a8548c2dcc7dc
We've only got one user of this currently, but since it needs the
location of the toolchain, and different flags based on 32 vs 64-bit,
it's easier just to add support than to get this into a genrule.
Test: Convert external/mdnsresponder to Soong, build
Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
Add AppKit, Foundation and Security to darwin for libchrome.
Add -lm and -lversion to windows for llvm.
Test: m -j libLLVMObject
Change-Id: Ie5c922d3fbb41fba1de5f1ce9e530683bf411c5a
Move some cc ctx.Host() / ctx.Device() checks over to using
ctx.toolchain().Bionic(). There will be more changes, these are just the
obvious ones dealing with host_ldlibs / crt / system libraries.
Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: Ibba60483b4ab0e01f6996eb7d883120e4acc1830
The MinGW update now includes pthread.
Test: update BoringSSL to use pthreads on Windows and compile
Change-Id: Id85d9fd3e03a310e07e0093ca80cefaf10fe8930