Commit graph

33 commits

Author SHA1 Message Date
Ryo Hashimoto
f68c18f710 Add arch variants for Intel Atom CPUs
Bug: 259201836
Test: Build aosp_x86_64-eng with modified build/make/target/board/generic_x86_64/BoardConfig.mk
Change-Id: Ic7410d6874c17af0e4492bf7704066ae9af1a531
2022-11-16 17:26:53 +09:00
Colin Cross
4fa894d366 Removed unused GCC references
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
2022-09-30 19:32:48 -07:00
Sam Delmerico
7f88956c16 refactor Bazel variable export
Most of the variable export code for cc modules can be re-used for
exporting variables for java modules. Refactor this code into a more
composable structure for reuse.

Test: build/bazel/bp2build.sh
Test: manual comparison of
  out/soong/soong_injection/cc_toolchain/constants.bzl
  with previous output
Change-Id: Ie5a6fee08cc888b7dc69c3e324e5c3f8aa269a8f
2022-04-06 14:48:32 +00:00
Liz Kammer
e8303bd0ae Export variant/features via soong_injection
Test: build/bazel/ci/bp2build.sh
Change-Id: If70043dc9d020d5f4a243ba4b192b99c9c7e8563
2022-02-28 14:17:15 -05:00
Liz Kammer
2c2afe26ea Fix typos in arch_list and do variant validation
Test: m nothing
Change-Id: Icfbc9f886a1e16abe02bf6c61671b8187a699942
2022-02-15 17:26:35 -05:00
Liz Kammer
f610a74f4c Add error message for unsupported x86 arch variant
Previously this would result in a Ninja variable lookup, instead, let's
error sooner in Soong.

Test: CI
Change-Id: Ib3e15dce84364e6f7a83b82cb5f0e8694ffc9d2a
2022-02-10 16:58:08 -05:00
Liz Kammer
82ad8ccca2 Support exporting device arch toolchain info
Test: bp2build.sh
Bug: 187084665
Change-Id: I49e75f603accab519784dbaf25d85db0010587a3
2021-08-02 14:54:10 -04:00
Colin Cross
0523ba2675 Rename ninja variables with Clang in the name
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
2021-07-14 20:55:23 -07:00
Colin Cross
33bac24bb9 Remove clang indirection without affecting build.ninja
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
2021-07-14 20:54:22 -07:00
Colin Cross
e3fee34a3d Create toolchainBionic for the various bionic-based toolchains to inherit from
Host bionic and each of the device bionic architectures will share some
new toolchain functionality in common, create a toolchainBionic and embed
it into the toolchains.  Use it to implement Bionic() once and change
the default implementation from true to false.

Test: go test ./cc/...
Test: m checkbuild
Change-Id: Ia34b80d9691edc4ab1cbdbd005d1ffc950d0881c
2021-06-22 16:54:39 -07:00
Martin Stjernholm
41ab2519b4 Remove implicit Bionic and kernel system includes.
They are now explicit in the Bionic blueprints, and brought in through
dependencies on libc (which in turn is usually implicit through the
default system_shared_libs value). Modules that may break are cc_object
which don't depend on system_shared_libs, and those that explicitly set
system_shared_libs:[] but still assumes libc headers. In either case
the fix should be to add header_libs:["libc_headers"].

Test: Build and boot
Test: m checkbuild (on aosp_taimen and aosp_x86_64)
Bug: 153590472
Change-Id: I3217d8f36e49a987f5377866c8647f9dcccc37ce
2020-05-06 19:45:03 +01:00
Elliott Hughes
b22dcfe05c Stop defining unused USE_SSSE3.
This copy & paste has even made it into the fuchsia configuration...

Test: builds
Change-Id: If22615fdf04448c058db014d93155e6264fb3eb2
2019-07-12 22:40:45 -07:00
jaishank
7e84969f96 Disabled avx avx2 avx512 compiler flags by default.
Library components can enable the flags based on
performance impact

Test: run-test gtest
Change-Id: I41c4464cffd2b0e830d4ab1c5a25b378e2a25129
Signed-off-by: jaishank <jaishankar.rajendran@intel.com>
2019-06-27 10:36:23 +05:30
Benjamin Gordon
87e7f2f685 Add stoney ridge x86 variant
Bug: 124445930
Test: compile and deploy to grunt
Change-Id: Ie63217c7c68f5688bf070cbabf9ea5a1b82d3acc
2019-03-15 11:04:48 -06:00
Shalini Salomi Bodapati
4a0459dd03 Add AVX/AVX2 supported archs in build system
This patch adds new arch features avx2 and avx512 and
their supported archictectures for x86 and x86_64

Bug: 123376719
Test: m checkbuild

Change-Id: I3c079741815b39d7dbb4072e12ef7c9c2c15f5fe
Signed-off-by: Shalini Salomi Bodapati <shalini.salomi.bodapati@intel.com>
2019-03-13 03:48:45 +00:00
Jaewoong Jung
e46114c11b Move arch variants registering code to arch.go.
This enables using arch-dependent property values in modules defined in
android/.

Bug: 122332178
Test: Soong tests + TreeHugger
Change-Id: I89869e395fabf0e69f505b77eab8a4221384124e
2019-01-16 18:29:03 -08:00
Dan Willemsen
01a3c25ed7 Configure the default arch variant features per-OS
The minimum set of supported features are different between Android and
Linux with X86_64. So while the list of variants and features are still
technically correct, and may be shared more in the future, the default
needs to be configured differently.

Bug: 120208462
Test: add `host_supported: true` to libopus; m libopus
Change-Id: Ib79707d17b852f77341026085230c026b6386b78
2019-01-15 00:53:28 +00:00
Dan Willemsen
bd4abf5dfc Remove GCC-specific toolchain methods
Test: m
Change-Id: I06442347ade2d60bc42131b3126ecc17840c9e31
2018-10-09 19:44:54 -07:00
Yi Kong
924adc4d17 Add BuiltinsRuntimeLibrary
... and rename SanitizerRuntimeLibrary to LibclangRuntimeLibrary since
some of them are not sanitizers.

Bug: 29275768
Test: m
Change-Id: Id638adea42d22b02438fce26120aa155bea14d42
2018-08-31 14:53:54 -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
Rahul Chaudhry
ccf4f83887 Revert "Disable relocation_packer and migrate to SHT_RELR sections."
This reverts commit fa00dfda13.

Reason for revert: New Build Breakages in git_pi-dev-plus-aosp-without-vendor/aosp_walleye-userdebug and git_pi-dev-plus-aosp/aosp_crosshatch-userdebug

Change-Id: Iec9e695cccc3f206df67f0c01cfd4c2c3023dcec
2018-03-23 19:02:56 +00:00
Rahul Chaudhry
fa00dfda13 Disable relocation_packer and migrate to SHT_RELR sections.
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Comparison with relocation_packer for aosp_marlin-userdebug:
$ du -B1 -s */out/target/product/marlin/system
 996958208      base/out/target/product/marlin/system
1008340992      no_pack/out/target/product/marlin/system
 997801984      sht_relr/out/target/product/marlin/system

base contains a build with current settings.
no_pack contains a build with relocation_packer disabled.
sht_relr contains a build with SHT_RELR sections enabled.

relocation_packer was saving 11,382,784 bytes (no_pack - base).
SHT_RELR sections are saving 10,539,008 bytes (no_pack - sht_relr).

Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: I448dc95baa4976b68ce2659b80498539426775f9
2018-03-22 15:17:34 -07:00
Colin Cross
b37620f870 Remove gcc-specific optimizations
These flags were added for gcc, but are always stripped out when
compiling for clang.  Since gcc is barely used, removed them.

Bug: 68855788
Bug: 68947919
Test: m checkbuild
Change-Id: Iae2bda9808dd9499848ce145ccdf71c4c490b80e
2017-11-14 17:43:33 +00:00
Colin Cross
ea3141d06d Move some flags to affect all devices
Move -fdata-sections and -fno-short-enums to global device flags.
-fdata-sections was not previously set on x86[_64], -fno-short-enums
was not previously set on mips[64].

Bug: 68855788
Test: m checkbuild
Change-Id: I68e64888d5414fc022366eb2b6c5cd92c28a5542
2017-11-14 17:43:24 +00:00
Colin Cross
324a457440 Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version

Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 22:28:03 -07:00
Colin Cross
0e37bc78d4 Remove -Wl,--gc-sections from target flags
-Wl,--gc-sections is already added by library.go and binary.go for
anything that uses bionic.

Bug: 68855788
Test: m checkbuild
Change-Id: I229199045ef8595d69c07fcf1aa6bbdc0b753fe3
2017-11-03 11:34:45 -07:00
Colin Cross
133dbe7bb0 Consolidate cflags that are set on all devices
Move cflags that are set on all devices to deviceGlobalCflags:
-fno-canonical-system-headers
-ffunction-sections
-funwind-tables
-fstack-protector-strong
-Wa,--noexecstack
-D_FORTIFY_SOURCE=2
-Wstrict-aliasing=2
-Werror=format-security

Bug: 68855788
Test: m checkbuild
Change-Id: Iefec689fdd2749013d0cc003b3abec674a85fb74
2017-11-03 11:34:45 -07: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
Elliott Hughes
de28deb460 Unified sysroot: arch-X/include directories are gone.
Bug: N/A
Test: builds
Change-Id: I98fc6a1a3c0be1c90b1deb35b54f36ab16a202ac
2017-10-12 09:07:53 -07:00
Colin Cross
91e9004086 Support .asm files for assembly
Test: mmma -j external/libjpeg-turbo
Change-Id: Id192dae5d74ecbf500fc668931c37f9b91d25ca4
2016-12-02 21:12:30 -08:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Evgenii Stepanov
af36db1178 Add ubsan_standalone library name to the toolchain.
and export the library name to make. Refactor the code a bit to avoid repeating the library name
multiple times.

Bug: 22033465
Test: Ran external/clang/build.py for aosp-llvm

Change-Id: I25eb3858eb92e1dd493b09524d559802551b2547
2016-08-15 17:05:04 -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_64_device.go (Browse further)