1*eed53cd4SHONG Yifan# Copyright 2018 The Bazel Authors. All rights reserved. 2*eed53cd4SHONG Yifan# 3*eed53cd4SHONG Yifan# Licensed under the Apache License, Version 2.0 (the "License"); 4*eed53cd4SHONG Yifan# you may not use this file except in compliance with the License. 5*eed53cd4SHONG Yifan# You may obtain a copy of the License at 6*eed53cd4SHONG Yifan# 7*eed53cd4SHONG Yifan# http://www.apache.org/licenses/LICENSE-2.0 8*eed53cd4SHONG Yifan# 9*eed53cd4SHONG Yifan# Unless required by applicable law or agreed to in writing, software 10*eed53cd4SHONG Yifan# distributed under the License is distributed on an "AS IS" BASIS, 11*eed53cd4SHONG Yifan# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*eed53cd4SHONG Yifan# See the License for the specific language governing permissions and 13*eed53cd4SHONG Yifan# limitations under the License. 14*eed53cd4SHONG Yifan 15*eed53cd4SHONG Yifan# This becomes the BUILD file for @local_config_cc// under FreeBSD. 16*eed53cd4SHONG Yifan 17*eed53cd4SHONG Yifanpackage(default_visibility = ["//visibility:public"]) 18*eed53cd4SHONG Yifan 19*eed53cd4SHONG Yifanload("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") 20*eed53cd4SHONG Yifanload(":cc_toolchain_config.bzl", "cc_toolchain_config") 21*eed53cd4SHONG Yifan 22*eed53cd4SHONG Yifancc_library( 23*eed53cd4SHONG Yifan name = "malloc", 24*eed53cd4SHONG Yifan) 25*eed53cd4SHONG Yifan 26*eed53cd4SHONG Yifanfilegroup( 27*eed53cd4SHONG Yifan name = "empty", 28*eed53cd4SHONG Yifan srcs = [], 29*eed53cd4SHONG Yifan) 30*eed53cd4SHONG Yifan 31*eed53cd4SHONG Yifan# Hardcoded toolchain, legacy behaviour. 32*eed53cd4SHONG Yifancc_toolchain_suite( 33*eed53cd4SHONG Yifan name = "toolchain", 34*eed53cd4SHONG Yifan toolchains = { 35*eed53cd4SHONG Yifan "armeabi-v7a": ":cc-compiler-armeabi-v7a", 36*eed53cd4SHONG Yifan "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", 37*eed53cd4SHONG Yifan "freebsd": ":cc-compiler-freebsd", 38*eed53cd4SHONG Yifan "freebsd|compiler": ":cc-compiler-freebsd", 39*eed53cd4SHONG Yifan }, 40*eed53cd4SHONG Yifan) 41*eed53cd4SHONG Yifan 42*eed53cd4SHONG Yifancc_toolchain( 43*eed53cd4SHONG Yifan name = "cc-compiler-freebsd", 44*eed53cd4SHONG Yifan all_files = ":empty", 45*eed53cd4SHONG Yifan ar_files = ":empty", 46*eed53cd4SHONG Yifan as_files = ":empty", 47*eed53cd4SHONG Yifan compiler_files = ":empty", 48*eed53cd4SHONG Yifan dwp_files = ":empty", 49*eed53cd4SHONG Yifan linker_files = ":empty", 50*eed53cd4SHONG Yifan objcopy_files = ":empty", 51*eed53cd4SHONG Yifan strip_files = ":empty", 52*eed53cd4SHONG Yifan supports_param_files = 0, 53*eed53cd4SHONG Yifan toolchain_config = ":local_freebsd", 54*eed53cd4SHONG Yifan toolchain_identifier = "local_freebsd", 55*eed53cd4SHONG Yifan) 56*eed53cd4SHONG Yifan 57*eed53cd4SHONG Yifancc_toolchain_config( 58*eed53cd4SHONG Yifan name = "local_freebsd", 59*eed53cd4SHONG Yifan cpu = "freebsd", 60*eed53cd4SHONG Yifan) 61*eed53cd4SHONG Yifan 62*eed53cd4SHONG Yifantoolchain( 63*eed53cd4SHONG Yifan name = "cc-toolchain-freebsd", 64*eed53cd4SHONG Yifan exec_compatible_with = [ 65*eed53cd4SHONG Yifan "@platforms//cpu:x86_64", 66*eed53cd4SHONG Yifan "@platforms//os:freebsd", 67*eed53cd4SHONG Yifan ], 68*eed53cd4SHONG Yifan target_compatible_with = [ 69*eed53cd4SHONG Yifan "@platforms//cpu:x86_64", 70*eed53cd4SHONG Yifan "@platforms//os:freebsd", 71*eed53cd4SHONG Yifan ], 72*eed53cd4SHONG Yifan toolchain = ":cc-compiler-freebsd", 73*eed53cd4SHONG Yifan toolchain_type = "@rules_cc//cc:toolchain_type", 74*eed53cd4SHONG Yifan) 75*eed53cd4SHONG Yifan 76*eed53cd4SHONG Yifancc_toolchain( 77*eed53cd4SHONG Yifan name = "cc-compiler-armeabi-v7a", 78*eed53cd4SHONG Yifan all_files = ":empty", 79*eed53cd4SHONG Yifan ar_files = ":empty", 80*eed53cd4SHONG Yifan as_files = ":empty", 81*eed53cd4SHONG Yifan compiler_files = ":empty", 82*eed53cd4SHONG Yifan dwp_files = ":empty", 83*eed53cd4SHONG Yifan linker_files = ":empty", 84*eed53cd4SHONG Yifan objcopy_files = ":empty", 85*eed53cd4SHONG Yifan strip_files = ":empty", 86*eed53cd4SHONG Yifan supports_param_files = 0, 87*eed53cd4SHONG Yifan toolchain_config = ":stub_armeabi-v7a", 88*eed53cd4SHONG Yifan toolchain_identifier = "stub_armeabi-v7a", 89*eed53cd4SHONG Yifan) 90*eed53cd4SHONG Yifan 91*eed53cd4SHONG Yifancc_toolchain_config( 92*eed53cd4SHONG Yifan name = "stub_armeabi-v7a", 93*eed53cd4SHONG Yifan cpu = "armeabi-v7a", 94*eed53cd4SHONG Yifan) 95*eed53cd4SHONG Yifan 96*eed53cd4SHONG Yifantoolchain( 97*eed53cd4SHONG Yifan name = "cc-toolchain-armeabi-v7a", 98*eed53cd4SHONG Yifan exec_compatible_with = [ 99*eed53cd4SHONG Yifan "@platforms//cpu:arm", 100*eed53cd4SHONG Yifan ], 101*eed53cd4SHONG Yifan target_compatible_with = [ 102*eed53cd4SHONG Yifan "@platforms//cpu:arm", 103*eed53cd4SHONG Yifan "@platforms//os:android", 104*eed53cd4SHONG Yifan ], 105*eed53cd4SHONG Yifan toolchain = ":cc-compiler-armeabi-v7a", 106*eed53cd4SHONG Yifan toolchain_type = "@rules_cc//cc:toolchain_type", 107*eed53cd4SHONG Yifan) 108*eed53cd4SHONG Yifan 109*eed53cd4SHONG Yifanfilegroup( 110*eed53cd4SHONG Yifan name = "link_dynamic_library", 111*eed53cd4SHONG Yifan srcs = ["link_dynamic_library.sh"], 112*eed53cd4SHONG Yifan) 113