Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 1 | // Copyright 2018 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package config |
| 16 | |
| 17 | import ( |
| 18 | "android/soong/android" |
| 19 | ) |
| 20 | |
| 21 | var fuchsiaArm64SysRoot string = "prebuilts/fuchsia_sdk/arch/arm64/sysroot" |
| 22 | var fuchsiaArm64PrebuiltLibsRoot string = "fuchsia/prebuilt_libs/" |
| 23 | |
| 24 | type toolchainFuchsiaArm64 struct { |
| 25 | toolchain64Bit |
| 26 | toolchainFuchsia |
| 27 | } |
| 28 | |
| 29 | func (t *toolchainFuchsiaArm64) Name() string { |
| 30 | return "arm64" |
| 31 | } |
| 32 | |
| 33 | func (t *toolchainFuchsiaArm64) GccRoot() string { |
| 34 | return "${config.Arm64GccRoot}" |
| 35 | } |
| 36 | |
| 37 | func (t *toolchainFuchsiaArm64) GccTriple() string { |
| 38 | return "aarch64-linux-android" |
| 39 | } |
| 40 | |
| 41 | func (t *toolchainFuchsiaArm64) GccVersion() string { |
| 42 | return arm64GccVersion |
| 43 | } |
| 44 | |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 45 | func (t *toolchainFuchsiaArm64) IncludeFlags() string { |
| 46 | return "" |
| 47 | } |
| 48 | |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 49 | func (t *toolchainFuchsiaArm64) ClangTriple() string { |
| 50 | return "arm64-fuchsia-android" |
| 51 | } |
| 52 | |
Colin Cross | 33bac24 | 2021-07-14 17:03:16 -0700 | [diff] [blame^] | 53 | func (t *toolchainFuchsiaArm64) Cppflags() string { |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 54 | return "-Wno-error=deprecated-declarations" |
| 55 | } |
| 56 | |
Colin Cross | 33bac24 | 2021-07-14 17:03:16 -0700 | [diff] [blame^] | 57 | func (t *toolchainFuchsiaArm64) Ldflags() string { |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 58 | return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -L" + fuchsiaArm64PrebuiltLibsRoot + "/aarch64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/arm64/dist/" |
| 59 | } |
| 60 | |
Colin Cross | 33bac24 | 2021-07-14 17:03:16 -0700 | [diff] [blame^] | 61 | func (t *toolchainFuchsiaArm64) Lldflags() string { |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 62 | return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -L" + fuchsiaArm64PrebuiltLibsRoot + "/aarch64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/arm64/dist/" |
| 63 | } |
| 64 | |
Colin Cross | 33bac24 | 2021-07-14 17:03:16 -0700 | [diff] [blame^] | 65 | func (t *toolchainFuchsiaArm64) Cflags() string { |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 66 | return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -I" + fuchsiaArm64SysRoot + "/include" |
| 67 | } |
| 68 | |
Colin Cross | 33bac24 | 2021-07-14 17:03:16 -0700 | [diff] [blame^] | 69 | func (t *toolchainFuchsiaArm64) ToolchainCflags() string { |
Doug Horn | c32c6b0 | 2019-01-17 14:44:05 -0800 | [diff] [blame] | 70 | return "-march=armv8-a" |
| 71 | } |
| 72 | |
| 73 | var toolchainArm64FuchsiaSingleton Toolchain = &toolchainFuchsiaArm64{} |
| 74 | |
| 75 | func arm64FuchsiaToolchainFactory(arch android.Arch) Toolchain { |
| 76 | return toolchainArm64FuchsiaSingleton |
| 77 | } |
| 78 | |
| 79 | func init() { |
| 80 | registerToolchainFactory(android.Fuchsia, android.Arm64, arm64FuchsiaToolchainFactory) |
| 81 | } |