Commit graph

22 commits

Author SHA1 Message Date
Jerome Gaillard
7f7f34f81a Add Skia deps to the list of available Windows libraries
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
2019-01-21 11:34:46 +00:00
Jerome Gaillard
82bb8b1359 Upgrade Windows default build version from Vista to 7
This is needed to build libicui18n on Windows, as it depends on APIs
created in Windows 7 (ResolveLocaleName).

Test: sdk build
Change-Id: If64510a262f7f1d4d356b1a9960ceea114cfa78a
2018-12-06 12:39:12 +00:00
Jerome Gaillard
80fec097b1 Add flags for Windows assembly builds
This is necessary to build libjpeg for Windows.

Test: lunch sdk, make libjpeg
Change-Id: I6ace0e524d1d710b5ce78320e7a06777511d1634
2018-11-29 15:47:31 +00:00
Pirama Arumuga Nainar
8fd5a96959 Remove --allow-multiple-definitions for 32-bit Windows
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
2018-10-10 20:10:15 +00:00
Pirama Arumuga Nainar
a403cc7254 Change STL for Windows to libc++.
- 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
2018-10-10 20:09:37 +00:00
Dan Willemsen
bd4abf5dfc Remove GCC-specific toolchain methods
Test: m
Change-Id: I06442347ade2d60bc42131b3126ecc17840c9e31
2018-10-09 19:44:54 -07:00
Pirama Arumuga Nainar
b83de950e7 Remove --allow-multiple-definion linker flag for 64-bit Windows
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
2018-10-03 11:40:23 -07:00
Dan Willemsen
f640dbcd1f Remove GCC support from Make
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
2018-09-06 22:37:54 +00:00
Pirama Arumuga Nainar
191f646295 Use Windows security mitigation features: ASLR, DEP
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
2018-08-30 12:54:33 -07:00
Pirama Arumuga Nainar
8a852e7694 Use clang for windows host modules
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
2018-06-25 18:36:50 -07:00
Pirama Arumuga Nainar
abf1b31a20 Use -static-libgcc for Windows
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
2018-06-25 18:31:01 -07:00
Chih-Hung Hsieh
3101a969aa Define clang lld flags for hosts.
* 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
2018-04-17 16:01:08 -07:00
Chih-Hung Hsieh
02b4da53a7 Add USE_CLANG_LLD and use_clang_lld.
* 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
2018-04-12 14:37:35 -07:00
Dan Willemsen
01f388c343 Add base variables for windows clang
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
2017-11-30 15:42:53 -08:00
Colin Cross
7278afc5a8 Consolidate global cflags
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
2017-11-03 11:34:45 -07:00
Dan Willemsen
b18cf7a5a0 Add windows libraries used by mdnsresponder
Test: Check for presence in prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8
Change-Id: Iaa0b56ca8ff94ebcd925238f211d9bd5d52a4a0c
2017-09-09 13:06:25 -07:00
Dan Willemsen
4f1c3d4116 Add support for Windows Message Compiler
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
2017-09-09 13:06:25 -07:00
Dan Willemsen
7752bca25d Enable large-address-aware for 32-bit windows
Bug: 36046324
Test: m -j winsdk-tools
Change-Id: I232d7dac9a6708542e70392801259141bec297c6
2017-03-14 13:37:26 -07:00
Colin Cross
124fd9afbd Add more whitelisted host libraries
Add AppKit, Foundation and Security to darwin for libchrome.

Add -lm and -lversion to windows for llvm.

Test: m -j libLLVMObject
Change-Id: Ie5c922d3fbb41fba1de5f1ce9e530683bf411c5a
2016-11-22 15:41:04 -08:00
Dan Willemsen
2e47b34435 Add Toolchain.Bionic()
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
2016-11-17 01:50:43 -08:00
Kenny Root
b912349c03 Add pthread to Windows allowed ldlibs
The MinGW update now includes pthread.

Test: update BoringSSL to use pthreads on Windows and compile
Change-Id: Id85d9fd3e03a310e07e0093ca80cefaf10fe8930
2016-09-20 14:49:33 -07:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00
Renamed from cc/x86_windows_host.go (Browse further)