Compare commits
38 Commits
v2.3.0-rc2
...
rei/fork-r
Author | SHA1 | Date | |
---|---|---|---|
27a1657c4f | |||
|
4bdd395511 | ||
|
9173bdff3d | ||
|
182e869fb8 | ||
|
dc74c09b8d | ||
|
90f5b25508 | ||
|
9b67f161e5 | ||
|
811608d4e4 | ||
|
ca5d9fdf5c | ||
|
23ad988fcd | ||
|
6dc2a1becf | ||
|
4336a5b49f | ||
|
6fad14b203 | ||
|
ee598066c4 | ||
|
fd3b3ca6f5 | ||
|
b36436b087 | ||
|
c4b2951888 | ||
|
82515cee8f | ||
|
ab9c694484 | ||
|
1f610fc5ae | ||
|
44e3817ad0 | ||
|
dbbdcde0fd | ||
|
ca2b7ba75c | ||
|
67ab71d747 | ||
|
d60d7d3c7e | ||
|
2ef4243a20 | ||
|
f9233753f3 | ||
|
2b03d7b7a0 | ||
|
549064075e | ||
|
13c4eadd25 | ||
|
de4c4425b7 | ||
|
98a59288c8 | ||
|
257447e193 | ||
|
61b2024a19 | ||
|
d3dc6a2071 | ||
|
9310f2a180 | ||
|
3b27581629 | ||
|
b4c95671f2 |
26
.bazelrc
26
.bazelrc
@ -94,6 +94,9 @@ build:libc++ --linkopt -fuse-ld=lld
|
||||
# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
|
||||
build:android --crosstool_top=//external:android/crosstool
|
||||
build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
|
||||
build:android --copt=-D_GLIBCXX_USE_C99
|
||||
build:android --cxxopt=-std=c++14
|
||||
build:android --action_env ANDROID_NDK_API_LEVEL=21
|
||||
build:android_arm --config=android
|
||||
build:android_arm --cpu=armeabi-v7a
|
||||
build:android_arm --fat_apk_cpu=armeabi-v7a
|
||||
@ -202,6 +205,29 @@ build:sycl_asan --copt -fno-omit-frame-pointer --copt -fsanitize-coverage=3 --co
|
||||
build:sycl_nodouble --config=sycl
|
||||
build:sycl_trisycl --define=using_trisycl=true
|
||||
|
||||
build --copt=-DTFLITE_WITH_RUY_GEMV
|
||||
|
||||
build:rpi3 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
|
||||
build:rpi3 --crosstool_top=//third_party/toolchains/embedded/linaro-gcc72-armeabi:toolchain
|
||||
build:rpi3 --cpu=armv7a --define=target_system=rpi3
|
||||
build:rpi3 --copt=-march=armv7-a --copt=-mtune=cortex-a53 --copt=-mfloat-abi=hard --copt=-mfpu=neon-fp-armv8 --copt=-DRASPBERRY_PI --copt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-std=gnu99 --copt=-mno-unaligned-access
|
||||
build:rpi3 --define=tensorflow_mkldnn_contraction_kernel=0
|
||||
build:rpi3_opt -c opt --config=rpi3 --copt=-funsafe-math-optimizations --copt=-ftree-vectorize --copt=-pipe
|
||||
|
||||
build:rpi3-armv8 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
|
||||
build:rpi3-armv8 --crosstool_top=//third_party/toolchains/embedded/linaro-gcc72-aarch64:toolchain
|
||||
build:rpi3-armv8 --cpu=aarch64 --define=target_system=rpi3-armv8
|
||||
build:rpi3-armv8 --copt=-march=armv8-a --copt=-mtune=cortex-a53 --copt=-DRASPBERRY_PI --copt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-std=gnu99
|
||||
build:rpi3-armv8 --define=tensorflow_mkldnn_contraction_kernel=0
|
||||
build:rpi3-armv8_opt -c opt --config=rpi3-armv8 --copt=-funsafe-math-optimizations --copt=-ftree-vectorize --copt=-pipe
|
||||
|
||||
build:rpi4ub-armv8 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
|
||||
build:rpi4ub-armv8 --crosstool_top=//third_party/toolchains/embedded/linaro-gcc72-aarch64:toolchain
|
||||
build:rpi4ub-armv8 --cpu=aarch64 --define=target_system=rpi4ub-armv8
|
||||
build:rpi4ub-armv8 --copt=-march=armv8-a --copt=-mtune=cortex-a72 --copt=-DRASPBERRY_PI --copt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-std=gnu99
|
||||
build:rpi4ub-armv8 --define=tensorflow_mkldnn_contraction_kernel=0
|
||||
build:rpi4ub-armv8_opt -c opt --config=rpi4ub-armv8 --copt=-funsafe-math-optimizations --copt=-ftree-vectorize --copt=-pipe
|
||||
|
||||
# Options extracted from configure script
|
||||
build:ngraph --define=with_ngraph_support=true
|
||||
build:numa --define=with_numa_support=true
|
||||
|
15
.github/pull_request_template.md
vendored
Normal file
15
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Pull request guidelines
|
||||
|
||||
Welcome to the 🐸tensorflow project! We are excited to see your interest, and appreciate your support!
|
||||
|
||||
This repository is governed by the Contributor Covenant Code of Conduct. For more details, see the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file.
|
||||
|
||||
In order to make a good pull request, please see our [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
||||
|
||||
Before accepting your pull request, you will be asked to sign a [Contributor License Agreement](https://cla-assistant.io/coqui-ai/tensorflow).
|
||||
|
||||
This [Contributor License Agreement](https://cla-assistant.io/coqui-ai/tensorflow):
|
||||
|
||||
- Protects you, Coqui, and the users of the code.
|
||||
- Does not change your rights to use your contributions for any purpose.
|
||||
- Does not change the license of the 🐸tensorflow project. It just makes the terms of your contribution clearer and lets us know you are OK to contribute.
|
195
RELEASE.md
195
RELEASE.md
@ -1,19 +1,206 @@
|
||||
# Release 2.3.0
|
||||
|
||||
## Breaking Changes
|
||||
## Major Features and Improvements
|
||||
* `tf.data` adds two new mechanisms to solve input pipeline bottlenecks and save resources:
|
||||
* [snapshot](https://www.tensorflow.org/api_docs/python/tf/data/experimental/snapshot)
|
||||
* [tf.data service](https://www.tensorflow.org/api_docs/python/tf/data/experimental/service).
|
||||
|
||||
In addition checkout the detailed [guide](https://www.tensorflow.org/guide/data_performance_analysis) for analyzing input pipeline performance with TF Profiler.
|
||||
|
||||
* [`tf.distribute.TPUStrategy`](https://www.tensorflow.org/api_docs/python/tf/distribute/TPUStrategy) is now a stable API and no longer considered experimental for TensorFlow. (earlier `tf.distribute.experimental.TPUStrategy`).
|
||||
|
||||
* [TF Profiler](https://www.tensorflow.org/guide/profiler) introduces two new tools: a memory profiler to visualize your model’s memory usage over time and a [python tracer](https://www.tensorflow.org/guide/profiler#events) which allows you to trace python function calls in your model. Usability improvements include better diagnostic messages and [profile options](https://tensorflow.org/guide/profiler#collect_performance_data) to customize the host and device trace verbosity level.
|
||||
|
||||
* Introduces experimental support for Keras Preprocessing Layers API ([`tf.keras.layers.experimental.preprocessing.*`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/experimental/preprocessing?version=nightly)) to handle data preprocessing operations, with support for composite tensor inputs. Please see below for additional details on these layers.
|
||||
|
||||
* TFLite now properly supports dynamic shapes during conversion and inference. We’ve also added opt-in support on Android and iOS for [XNNPACK](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/delegates/xnnpack), a highly optimized set of CPU kernels, as well as opt-in support for [executing quantized models on the GPU](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/performance/gpu_advanced.md#running-quantized-models-experimental).
|
||||
|
||||
* Libtensorflow packages are available in GCS starting this release. We have also started to [release a nightly version of these packages](https://github.com/tensorflow/tensorflow#official-builds).
|
||||
|
||||
* The experimental Python API [`tf.debugging.experimental.enable_dump_debug_info()`](https://www.tensorflow.org/api_docs/python/tf/debugging/experimental/enable_dump_debug_info) now allows you to instrument a TensorFlow program and dump debugging information to a directory on the file system. The directory can be read and visualized by a new interactive dashboard in TensorBoard 2.3 called [Debugger V2](https://www.tensorflow.org/tensorboard/debugger_v2), which reveals the details of the TensorFlow program including graph structures, history of op executions at the Python (eager) and intra-graph levels, the runtime dtype, shape, and numerical composistion of tensors, as well as their code locations.
|
||||
|
||||
## Breaking Changes
|
||||
* Increases the **minimum bazel version** required to build TF to **3.1.0**.
|
||||
* `tf.data`
|
||||
* Makes the following (breaking) changes to the `tf.data`.
|
||||
* C++ API: - `IteratorBase::RestoreInternal`, `IteratorBase::SaveInternal`, and `DatasetBase::CheckExternalState` become pure-virtual and subclasses are now expected to provide an implementation.
|
||||
* The deprecated `DatasetBase::IsStateful` method is removed in favor of `DatasetBase::CheckExternalState`.
|
||||
* Deprecated overrides of `DatasetBase::MakeIterator` and `MakeIteratorFromInputElement` are removed.
|
||||
* The signature of `tensorflow::data::IteratorBase::SaveInternal` and `tensorflow::data::IteratorBase::SaveInput` has been extended with `SerializationContext` argument to enable overriding the default policy for the handling external state during iterator checkpointing. This is not a backwards compatible change and all subclasses of `IteratorBase` *need to be updated* accordingly.
|
||||
* `tf.keras`
|
||||
* Add a new `BackupAndRestore` callback for handling distributed training failures & restarts. Please take a look at this [tutorial](https://www.tensorflow.org/tutorials/distribute/multi_worker_with_keras) for details on how to use the callback.
|
||||
* `tf.image.extract_glimpse` has been updated to correctly process the case
|
||||
where `centered=False` and `normalized=False`. This is a breaking change as
|
||||
the output is different from (incorrect) previous versions. Note this
|
||||
breaking change only impacts `tf.image.extract_glimpse` and
|
||||
`tf.compat.v2.image.extract_glimpse` API endpoints. The behavior of
|
||||
`tf.compat.v1.image.extract_glimpse` does not change. The behavior of
|
||||
exsiting C++ kernel `ExtractGlimpse` does not change as well, so saved
|
||||
models will not be impacted.
|
||||
exsiting C++ kernel `ExtractGlimpse` does not change either, so saved
|
||||
models using `tf.raw_ops.ExtractGlimpse` will not be impacted.
|
||||
|
||||
## Known Caveats
|
||||
* `tf.lite`
|
||||
* Keras-based LSTM models must be converted with an explicit batch size in the input layer.
|
||||
|
||||
## Bug Fixes and Other Changes
|
||||
|
||||
* Mutable tables now restore checkpointed values when loaded from SavedModel.
|
||||
### TF Core:
|
||||
* Set `tf2_behavior` to 1 to enable V2 for early loading cases.
|
||||
* Add `execute_fn_for_device function` to dynamically choose the implementation based on underlying device placement.
|
||||
* Eager:
|
||||
* Add `reduce_logsumexp` benchmark with experiment compile.
|
||||
* Give `EagerTensor`s a meaningful `__array__` implementation.
|
||||
* Add another version of defun matmul for performance analysis.
|
||||
* `tf.function`/AutoGraph:
|
||||
* `AutoGraph` now includes into TensorFlow loops any variables that are closed over by local functions. Previously, such variables were sometimes incorrectly ignored.
|
||||
* functions returned by the `get_concrete_function` method of `tf.function` objects can now be called with arguments consistent with the original arguments or type specs passed to `get_concrete_function`. This calling convention is now the preferred way to use concrete functions with nested values and composite tensors. Please check the [guide](https://www.tensorflow.org/guide/concrete_function) for more details on `concrete_ function`.
|
||||
* Update `tf.function`'s `experimental_relax_shapes` to handle composite tensors appropriately.
|
||||
* Optimize `tf.function` invocation, by removing redundant list converter.
|
||||
* `tf.function` will retrace when called with a different variable instead of simply using the `dtype` & `shape`.
|
||||
* [Improve support](https://github.com/tensorflow/tensorflow/issues/33862) for dynamically-sized TensorArray inside `tf.function`.
|
||||
* `tf.math`:
|
||||
* Narrow down `argmin`/`argmax` contract to always return the smallest index for ties.
|
||||
* `tf.math.reduce_variance` and `tf.math.reduce_std` return correct computation for complex types and no longer support integer types.
|
||||
* Add Bessel functions of order 0,1 to `tf.math.special`.
|
||||
* `tf.divide` now always returns a tensor to be consistent with documentation and other APIs.
|
||||
* `tf.image`:
|
||||
* Replaced [`tf.image.non_max_suppression_padded`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/image/non_max_suppression_padded?hl=en) with a new implementation that supports batched inputs, which is considerably faster on TPUs and GPUs. Boxes with area=0 will be ignored. Existing usage with single inputs should still work as before.
|
||||
* `tf.linalg`
|
||||
* Add `tf.linalg.banded_triangular_solve`.
|
||||
* `tf.random`:
|
||||
* Add `tf.random.stateless_parameterized_truncated_normal`.
|
||||
* `tf.ragged`:
|
||||
* Add `tf.ragged.cross` and `tf.ragged.cross_hashed` operations.
|
||||
* `tf.RaggedTensor`:
|
||||
* `RaggedTensor.to_tensor()` now preserves static shape.
|
||||
* Add `tf.strings.format()` and `tf.print()` to support RaggedTensors.
|
||||
* `tf.saved_model`:
|
||||
* `@tf.function` from SavedModel no longer ignores args after a `RaggedTensor` when selecting the concrete function to run.
|
||||
* Fix save model issue for ops with a list of functions.
|
||||
* Add `tf.saved_model.LoadOptions` with [`experimental_io_device`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/saved_model/LoadOptions?hl=en) as arg with default value `None` to choose the I/O device for loading models and weights.
|
||||
* Update `tf.saved_model.SaveOptions` with [`experimental_io_device`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/saved_model/SaveOptions?hl=en) as arg with default value `None` to choose the I/O device for saving models and weights.
|
||||
* Mutable tables now restore checkpointed values when loaded from SavedModel.
|
||||
* GPU
|
||||
* TF 2.3 includes PTX kernels only for [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0 to reduce the TF pip binary size. Earlier releases included PTX for a variety of older compute capabilities.
|
||||
* Others
|
||||
* Retain parent namescope for ops added inside `tf.while_loop`/`tf.cond`/`tf.switch_case`.
|
||||
* Update `tf.vectorized_map` to support vectorizing `tf.while_loop` and TensorList operations.
|
||||
* `tf.custom_gradient` can now be applied to functions that accept nested structures of `tensors` as inputs (instead of just a list of tensors). Note that Python structures such as tuples and lists now won't be treated as tensors, so if you still want them to be treated that way, you need to wrap them with `tf.convert_to_tensor`.
|
||||
* No lowering on gradient case op when input is `DeviceIndex` op.
|
||||
* Extend the ragged version of `tf.gather` to support `batch_dims` and `axis` args.
|
||||
* Update `tf.map_fn` to support RaggedTensors and SparseTensors.
|
||||
* Deprecate `tf.group`. It is not useful in eager mode.
|
||||
* Add CPU and GPU implementation of modified variation of [`FTRL`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/raw_ops/ApplyFtrl)/[`FTRLV2`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/raw_ops/ApplyFtrlV2) that can triggerred by `multiply_linear_by_lr` allowing a learning rate of zero.
|
||||
|
||||
### `tf.data`:
|
||||
* `tf.data.experimental.dense_to_ragged_batch` works correctly with tuples.
|
||||
* `tf.data.experimental.dense_to_ragged_batch` to output variable ragged rank.
|
||||
* `tf.data.experimental.cardinality` is now a method on `tf.data.Dataset`.
|
||||
* `tf.data.Dataset` now supports `len(Dataset)` when the cardinality is finite.
|
||||
|
||||
### `tf.distribute`:
|
||||
* Expose experimental [`tf.distribute.DistributedDataset`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/distribute/DistributedDataset?hl=en) and [`tf.distribute.DistributedIterator`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/distribute/DistributedIterator) to distribute input data when using `tf.distribute` to scale training on multiple devices.
|
||||
* Added a [`get_next_as_optional`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/distribute/DistributedIterator?hl=en#get_next_as_optional) method for [`tf.distribute.DistributedIterator`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/distribute/DistributedIterator?hl=en) class to return a `tf.experimental.Optional` instance that contains the next value for all replicas or none instead of raising an out of range error. Also see *new* [guide on input distribution](https://www.tensorflow.org/tutorials/distribute/input).
|
||||
* Allow var.assign on MirroredVariables with aggregation=NONE in replica context. Previously this would raise an error. We now allow this because many users and library writers find using `.assign` in replica context to be more convenient, instead of having to use `Strategy.extended.update` which was the previous way of updating variables in this situation.
|
||||
* `tf.distribute.experimental.MultiWorkerMirroredStrategy` adds support for partial batches. Workers running out of data now continue to participate in the training with empty inputs, instead of raising an error. Learn more about [partial batches here](https://www.tensorflow.org/tutorials/distribute/input#partial_batches).
|
||||
* Improve the performance of reading metrics eagerly under `tf.distribute.experimental.MultiWorkerMirroredStrategy`.
|
||||
* Fix the issue that `strategy.reduce()` inside `tf.function` may raise exceptions when the values to reduce are from loops or if-clauses.
|
||||
* Fix the issue that `tf.distribute.MirroredStrategy` cannot be used together with `tf.distribute.experimental.MultiWorkerMirroredStrategy`.
|
||||
* Add a `tf.distribute.cluster_resolver.TPUClusterResolver.connect` API to simplify TPU initialization.
|
||||
|
||||
### `tf.keras`:
|
||||
* Introduces experimental preprocessing layers API (`tf.keras.layers.experimental.preprocessing`) to handle data preprocessing operations such as categorical feature encoding, text vectorization, data normalization, and data discretization (binning). The newly added layers provide a replacement for the legacy feature column API, and support composite tensor inputs.
|
||||
* Added **categorical data** processing layers:
|
||||
* `IntegerLookup` & `StringLookup`: build an index of categorical feature values
|
||||
* `CategoryEncoding`: turn integer-encoded categories into one-hot, multi-hot, or tf-idf encoded representations
|
||||
* `CategoryCrossing`: create new categorical features representing co-occurrences of previous categorical feature values
|
||||
* `Hashing`: the hashing trick, for large-vocabulary categorical features
|
||||
* `Discretization`: turn continuous numerical features into categorical features by binning their values
|
||||
* Improved **image preprocessing** layers: `CenterCrop`, `Rescaling`
|
||||
* Improved **image augmentation** layers: `RandomCrop`, `RandomFlip`, `RandomTranslation`, `RandomRotation`, `RandomHeight`, `RandomWidth`, `RandomZoom`, `RandomContrast`
|
||||
* Improved **`TextVectorization`** layer, which handles string tokenization, n-gram generation, and token encoding
|
||||
* The `TextVectorization` layer now accounts for the mask_token as part of the vocabulary size when output_mode='int'. This means that, if you have a max_tokens value of 5000, your output will have 5000 unique values (not 5001 as before).
|
||||
* Change the return value of `TextVectorization.get_vocabulary()` from `byte` to `string`. Users who previously were calling 'decode' on the output of this method should no longer need to do so.
|
||||
* Introduce new Keras dataset generation utilities :
|
||||
* **[`image_dataset_from_directory`](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image_dataset_from_directory)** is a utility based on `tf.data.Dataset`, meant to replace the legacy `ImageDataGenerator`. It takes you from a structured directory of images to a labeled dataset, in one function call. Note that it doesn't perform image data augmentation (which is meant to be done using preprocessing layers).
|
||||
* **[`text_dataset_from_directory`](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/text_dataset_from_directory)** takes you from a structured directory of text files to a labeled dataset, in one function call.
|
||||
* **[`timeseries_dataset_from_array`](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/timeseries_dataset_from_array)** is a `tf.data.Dataset`-based replacement of the legacy `TimeseriesGenerator`. It takes you from an array of timeseries data to a dataset of shifting windows with their targets.
|
||||
* Added [`experimental_steps_per_execution`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/Model?hl=en#compile)
|
||||
arg to `model.compile` to indicate the number of batches to run per `tf.function` call. This can speed up Keras Models on TPUs up to 3x.
|
||||
* Extends `tf.keras.layers.Lambda` layers to support multi-argument lambdas, and keyword arguments when calling the layer.
|
||||
* Functional models now get constructed if *any* tensor in a layer call's arguments/keyword arguments comes from a keras input. Previously the functional api would only work if all of the elements in the first argument to the layer came from a keras input.
|
||||
* Clean up `BatchNormalization` layer's `trainable` property to act like standard python state when it's used inside `tf.functions` (frozen at tracing time), instead of acting like a pseudo-variable whose updates *kind of sometimes* get reflected in already-traced `tf.function` traces.
|
||||
* Add the `Conv1DTranspose` layer.
|
||||
* Refine the semantics of `SensitivitySpecificityBase` derived metrics. See the updated API docstrings for [`tf.keras.metrics.SensitivityAtSpecificity`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/metrics/SensitivityAtSpecificity) and [`tf.keras.metrics.SpecificityAtSensitivty`](https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/metrics/SpecificityAtSensitivity).
|
||||
|
||||
### `tf.lite`:
|
||||
* Converter
|
||||
* Restored `inference_input_type` and `inference_output_type` flags in TF 2.x TFLiteConverter (backward compatible with TF 1.x) to support integer (tf.int8, tf.uint8) input and output types in post training full integer quantized models.
|
||||
* Added support for converting and resizing models with dynamic (placeholder) dimensions. Previously, there was only limited support for dynamic batch size, and even that did not guarantee that the model could be properly resized at runtime.
|
||||
* Enabled experimental support for a new quantization mode with 16-bit activations and 8-bit weights. See `lite.OpsSet.EXPERIMENTAL_TFLITE_BUILTINS_ACTIVATIONS_INT16_WEIGHTS_INT8`.
|
||||
* CPU
|
||||
* Fix an issue w/ dynamic weights and `Conv2D` on x86.
|
||||
* Add a runtime Android flag for enabling `XNNPACK` for optimized CPU performance.
|
||||
* Add a runtime iOS flag for enabling `XNNPACK` for optimized CPU performance.
|
||||
* Add a compiler flag to enable building a TFLite library that applies `XNNPACK` delegate automatically when the model has a `fp32` operation.
|
||||
* GPU
|
||||
* Allow GPU acceleration starting with internal graph nodes
|
||||
* Experimental support for quantized models with the Android GPU delegate
|
||||
* Add GPU delegate whitelist.
|
||||
* Rename GPU whitelist -> compatibility (list).
|
||||
* Improve GPU compatibility list entries from crash reports.
|
||||
* NNAPI
|
||||
* Set default value for `StatefulNnApiDelegate::Options::max_number_delegated_partitions` to 3.
|
||||
* Add capability to disable `NNAPI` CPU and check `NNAPI` Errno.
|
||||
* Fix crashes when using `NNAPI` with target accelerator specified with model containing Conv2d or FullyConnected or LSTM nodes with quantized weights.
|
||||
* Fix `ANEURALNETWORKS_BAD_DATA` execution failures with `sum`/`max`/`min`/`reduce` operations with `scalar` inputs.
|
||||
* Hexagon
|
||||
* TFLite Hexagon Delegate out of experimental.
|
||||
* Experimental `int8` support for most hexagon ops.
|
||||
* Experimental per-channel quant support for `conv` in Hexagon delegate.
|
||||
* Support dynamic batch size in C++ API.
|
||||
* CoreML
|
||||
* Opensource CoreML delegate
|
||||
* Misc
|
||||
* Enable building Android TFLite targets on Windows
|
||||
* Add support for `BatchMatMul`.
|
||||
* Add support for `half_pixel_centers` with `ResizeNearestNeighbor`.
|
||||
* Add 3D support for `BatchToSpaceND`.
|
||||
* Add 5D support for `BroadcastSub`, `Maximum`, `Minimum`, `Transpose` and `BroadcastDiv`.
|
||||
* Rename `kTfLiteActRelu1` to `kTfLiteActReluN1To1`.
|
||||
* Enable flex delegate on tensorflow.lite.Interpreter Python package.
|
||||
* Add `Buckettize`, `SparseCross` and `BoostedTreesBucketize` to the flex whitelist.
|
||||
* Add support for selective registration of flex ops.
|
||||
* Add missing kernels for flex delegate whitelisted ops.
|
||||
* Fix issue when using direct `ByteBuffer` inputs with graphs that have dynamic shapes.
|
||||
* Fix error checking supported operations in a model containing `HardSwish`.
|
||||
|
||||
### Packaging Support
|
||||
* Added `tf.sysconfig.get_build_info()`. Returns a dict that describes the build environment of the currently installed TensorFlow package, e.g. the NVIDIA CUDA and NVIDIA CuDNN versions used when TensorFlow was built.
|
||||
|
||||
### Profiler
|
||||
* Fix a subtle use-after-free issue in `XStatVisitor::RefValue()`.
|
||||
|
||||
### TPU Enhancements
|
||||
* Adds 3D mesh support in TPU configurations ops.
|
||||
* Added TPU code for `FTRL` with `multiply_linear_by_lr`.
|
||||
* Silently adds a new file system registry at `gstpu`.
|
||||
* Support `restartType` in cloud tpu client.
|
||||
* Depend on a specific version of google-api-python-client.
|
||||
* Fixes apiclient import.
|
||||
|
||||
### Tracing and Debugging
|
||||
* Add a `TFE_Py_Execute` traceme.
|
||||
|
||||
### XLA Support
|
||||
* Implement stable `argmin` and `argmax`
|
||||
|
||||
## Thanks to our Contributors
|
||||
|
||||
This release contains contributions from many people at Google, as well as:
|
||||
|
||||
902449@58880@bigcat_chen@ASIC, Abdul Baseer Khan, Abhineet Choudhary, Abolfazl Shahbazi, Adam Hillier, ag.ramesh, Agoniii, Ajay P, Alex Hoffman, Alexander Bayandin, Alexander Grund, Alexandre Abadie, Alexey Rogachevskiy, amoitra, Andrew Stevens, Angus-Luo, Anshuman Tripathy, Anush Elangovan, Artem Mavrin, Ashutosh Hathidara, autoih, Ayushman Kumar, ayushmankumar7, Bairen Yi, Bas Aarts, Bastian Eichenberger, Ben Barsdell, bhack, Bharat Raghunathan, Biagio Montaruli, Bigcat-Himax, blueyi, Bryan Cutler, Byambaa, Carlos Hernandez-Vaquero, Chen Lei, Chris Knorowski, Christian Clauss, chuanqiw, CuiYifeng, Daniel Situnayake, Daria Zhuravleva, Dayananda-V, Deven Desai, Devi Sandeep Endluri, Dmitry Zakharov, Dominic Jack, Duncan Riach, Edgar Liberis, Ehsan Toosi, ekuznetsov139, Elena Zhelezina, Eugene Kuznetsov, Eugene Mikhantiev, Evgenii Zheltonozhskii, Fabio Di Domenico, Fausto Morales, Fei Sun, feihugis, Felix E. Klee, flyingcat, Frederic Bastien, Fredrik Knutsson, frreiss, fsx950223, ganler, Gaurav Singh, Georgios Pinitas, Gian Marco Iodice, Giorgio Arena, Giuseppe Rossini, Gregory Keith, Guozhong Zhuang, gurushantj, Hahn Anselm, Harald Husum, Harjyot Bagga, Hristo Vrigazov, Ilya Persky, Ir1d, Itamar Turner-Trauring, jacco, Jake Tae, Janosh Riebesell, Jason Zaman, jayanth, Jeff Daily, Jens Elofsson, Jinzhe Zeng, JLZ, Jonas Skog, Jonathan Dekhtiar, Josh Meyer, Joshua Chia, Judd, justkw, Kaixi Hou, Kam D Kasravi, Kamil Rakoczy, Karol Gugala, Kayou, Kazuaki Ishizaki, Keith Smiley, Khaled Besrour, Kilaru Yasaswi Sri Chandra Gandhi, Kim, Young Soo, Kristian Hartikainen, Kwabena W. Agyeman, Leslie-Fang, Leslie-Fang-Intel, Li, Guizi, Lukas Geiger, Lutz Roeder, M\U00E5Ns Nilsson, Mahmoud Abuzaina, Manish, Marcel Koester, Marcin Sielski, marload, Martin Jul, Matt Conley, mdfaijul, Meng, Peng, Meteorix, Michael Käufl, Michael137, Milan Straka, Mitchell Vitez, Ml-0, Mokke Meguru, Mshr-H, nammbash, Nathan Luehr, naumkin, Neeraj Bhadani, ngc92, Nick Morgan, nihui, Niranjan Hasabnis, Niranjan Yadla, Nishidha Panpaliya, Oceania2018, oclyke, Ouyang Jin, OverLordGoldDragon, Owen Lyke, Patrick Hemmer, Paul Andrey, Peng Sun, periannath, Phil Pearl, Prashant Dandriyal, Prashant Kumar, Rahul Huilgol, Rajan Singh, Rajeshwar Reddy T, rangjiaheng, Rishit Dagli, Rohan Reddy, rpalakkal, rposts, Ruan Kunliang, Rushabh Vasani, Ryohei Ikegami, Semun Lee, Seo-Inyoung, Sergey Mironov, Sharada Shiddibhavi, ShengYang1, Shraiysh Vaishay, Shunya Ueta, shwetaoj, Siyavash Najafzade, Srinivasan Narayanamoorthy, Stephan Uphoff, storypku, sunchenggen, sunway513, Sven-Hendrik Haase, Swapnil Parekh, Tamas Bela Feher, Teng Lu, tigertang, tomas, Tomohiro Ubukata, tongxuan.ltx, Tony Tonev, Tzu-Wei Huang, Téo Bouvard, Uday Bondhugula, Vaibhav Jade, Vijay Tadikamalla, Vikram Dattu, Vincent Abriou, Vishnuvardhan Janapati, Vo Van Nghia, VoVAllen, Will Battel, William D. Irons, wyzhao, Xiaoming (Jason) Cui, Xiaoquan Kong, Xinan Jiang, xutianming, Yair Ehrenwald, Yasir Modak, Yasuhiro Matsumoto, Yixing Fu, Yong Tang, Yuan Tang, zhaozheng09, Zilin Zhu, zilinzhu, 张志豪
|
||||
|
||||
|
||||
# Release 2.1.1
|
||||
|
||||
|
12
WORKSPACE
12
WORKSPACE
@ -18,6 +18,18 @@ load("//tensorflow:workspace.bzl", "tf_repositories")
|
||||
# Please add all new TensorFlow dependencies in workspace.bzl.
|
||||
tf_repositories()
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
|
||||
git_repository(
|
||||
name = "com_github_nelhage_rules_boost",
|
||||
commit = "1e3a69bf2d5cd10c34b74f066054cd335d033d71",
|
||||
remote = "https://github.com/nelhage/rules_boost",
|
||||
shallow_since = "1591047380 -0700",
|
||||
)
|
||||
|
||||
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
|
||||
boost_deps()
|
||||
|
||||
register_toolchains("@local_config_python//:py_toolchain")
|
||||
|
||||
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
|
||||
|
1
native_client
Symbolic link
1
native_client
Symbolic link
@ -0,0 +1 @@
|
||||
../native_client
|
@ -5864,15 +5864,15 @@ cc_library(
|
||||
":string_format_op",
|
||||
":string_join_op",
|
||||
":string_length_op",
|
||||
":string_lower_op",
|
||||
# ":string_lower_op",
|
||||
":string_ngrams_op",
|
||||
":string_split_op",
|
||||
":string_strip_op",
|
||||
":string_to_hash_bucket_op",
|
||||
":string_upper_op",
|
||||
# ":string_upper_op",
|
||||
":substr_op",
|
||||
":unicode_ops",
|
||||
":unicode_script_op",
|
||||
# ":unicode_ops",
|
||||
# ":unicode_script_op",
|
||||
":unsorted_segment_join_op",
|
||||
],
|
||||
)
|
||||
@ -5885,7 +5885,7 @@ cc_library(
|
||||
"//tensorflow/core:framework",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"@icu//:common",
|
||||
# "@icu//:common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -6041,7 +6041,7 @@ tf_kernel_library(
|
||||
prefix = "string_lower_op",
|
||||
deps = STRING_DEPS + [
|
||||
"@com_google_absl//absl/strings",
|
||||
"@icu//:common",
|
||||
# "@icu//:common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -6050,7 +6050,7 @@ tf_kernel_library(
|
||||
prefix = "string_upper_op",
|
||||
deps = STRING_DEPS + [
|
||||
"@com_google_absl//absl/strings",
|
||||
"@icu//:common",
|
||||
# "@icu//:common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -6096,7 +6096,7 @@ tf_kernel_library(
|
||||
"//tensorflow/core:lib_internal",
|
||||
"//third_party/eigen3",
|
||||
"//third_party/icu/data:conversion_data",
|
||||
"@icu//:common",
|
||||
# "@icu//:common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -7125,10 +7125,10 @@ filegroup(
|
||||
"mutex_ops.*",
|
||||
"batch_kernels.*",
|
||||
"regex_replace_op.cc",
|
||||
"string_lower_op.cc", # Requires ICU for unicode.
|
||||
"string_upper_op.cc", # Requires ICU for unicode.
|
||||
# "string_lower_op.cc", # Requires ICU for unicode.
|
||||
# "string_upper_op.cc", # Requires ICU for unicode.
|
||||
"unicode_ops.cc",
|
||||
"unicode_script_op.cc",
|
||||
# "unicode_script_op.cc",
|
||||
# Ops that are inherently incompatible with Android (e.g. tied to x86 platform).
|
||||
"mkl_*",
|
||||
"xsmm_*",
|
||||
@ -8620,7 +8620,7 @@ tf_kernel_library(
|
||||
srcs = ["unicode_script_op.cc"],
|
||||
deps = [
|
||||
"//tensorflow/core:framework",
|
||||
"@icu//:common",
|
||||
# "@icu//:common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -8652,6 +8652,39 @@ cc_library(
|
||||
],
|
||||
)
|
||||
|
||||
tf_kernel_library(
|
||||
name = "deepspeech_cwise_ops",
|
||||
srcs = [
|
||||
"cwise_op_add_1.cc",
|
||||
"cwise_op_add_2.cc",
|
||||
"cwise_op_less.cc",
|
||||
"cwise_op_minimum.cc",
|
||||
"cwise_op_mul_1.cc",
|
||||
"cwise_op_rsqrt.cc",
|
||||
"cwise_op_squared_difference.cc",
|
||||
"cwise_op_sub.cc",
|
||||
"cwise_op_sigmoid.cc",
|
||||
"cwise_op_tanh.cc",
|
||||
],
|
||||
gpu_srcs = [
|
||||
"cwise_op_gpu_add.cu.cc",
|
||||
"cwise_op_gpu_less.cu.cc",
|
||||
"cwise_op_gpu_minimum.cu.cc",
|
||||
"cwise_op_gpu_mul.cu.cc",
|
||||
"cwise_op_gpu_rsqrt.cu.cc",
|
||||
"cwise_op_gpu_squared_difference.cu.cc",
|
||||
"cwise_op_gpu_sub.cu.cc",
|
||||
"cwise_op_gpu_sigmoid.cu.cc",
|
||||
"cwise_op_gpu_tanh.cu.cc",
|
||||
],
|
||||
deps = [
|
||||
":cwise_lib",
|
||||
"//tensorflow/core:framework",
|
||||
"//tensorflow/core:lib",
|
||||
"//third_party/eigen3",
|
||||
],
|
||||
)
|
||||
|
||||
# Header-only version of cwise_lib for clients that want to use the cwise_ops
|
||||
# functionality in their own custom ops.
|
||||
cc_header_only_library(
|
||||
|
@ -116,6 +116,7 @@ REGISTER_KERNEL(GPU, int16);
|
||||
REGISTER_KERNEL(GPU, qint16);
|
||||
REGISTER_KERNEL(GPU, quint16);
|
||||
REGISTER_KERNEL(GPU, uint32);
|
||||
REGISTER_KERNEL(GPU, int32);
|
||||
REGISTER_KERNEL(GPU, qint32);
|
||||
REGISTER_KERNEL(GPU, int64);
|
||||
REGISTER_KERNEL(GPU, uint64);
|
||||
|
@ -26,7 +26,7 @@ limitations under the License.
|
||||
|
||||
// TF_VERSION_SUFFIX is non-empty for pre-releases (e.g. "-alpha", "-alpha.1",
|
||||
// "-beta", "-rc", "-rc.1")
|
||||
#define TF_VERSION_SUFFIX "-rc2"
|
||||
#define TF_VERSION_SUFFIX ""
|
||||
|
||||
#define TF_STR_HELPER(x) #x
|
||||
#define TF_STR(x) TF_STR_HELPER(x)
|
||||
|
@ -57,7 +57,6 @@ cc_library(
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//tensorflow:fuchsia": [],
|
||||
"//tensorflow:windows": [],
|
||||
"//conditions:default": [
|
||||
"//tensorflow/lite/delegates/xnnpack:xnnpack_delegate",
|
||||
],
|
||||
|
@ -132,8 +132,7 @@ class Embedding(Layer):
|
||||
# right now. Checking for the presence of GPUs to avoid complicating the
|
||||
# TPU codepaths which can handle sparse optimizers. But if we are within
|
||||
# a tf.function, we go back the graph mode logic and rely on the placer.
|
||||
if (context.executing_eagerly() and context.context().num_gpus() and
|
||||
not ops.inside_function()):
|
||||
if context.executing_eagerly() and context.context().num_gpus():
|
||||
with ops.device('cpu:0'):
|
||||
self.embeddings = self.add_weight(
|
||||
shape=(self.input_dim, self.output_dim),
|
||||
|
@ -49,7 +49,7 @@ from setuptools.dist import Distribution
|
||||
# result for pip.
|
||||
# Also update tensorflow/tensorflow.bzl and
|
||||
# tensorflow/core/public/version.h
|
||||
_VERSION = '2.3.0-rc2'
|
||||
_VERSION = '2.3.0'
|
||||
|
||||
REQUIRED_PACKAGES = [
|
||||
'absl-py >= 0.7.0',
|
||||
@ -63,8 +63,8 @@ REQUIRED_PACKAGES = [
|
||||
'numpy >= 1.16.0, < 1.19.0',
|
||||
'opt_einsum >= 2.3.2',
|
||||
'protobuf >= 3.9.2',
|
||||
'tensorboard >= 2.2.0, < 2.3.0',
|
||||
'tensorflow_estimator >= 2.3.0rc0, < 2.4.0',
|
||||
'tensorboard >= 2.3.0, < 3',
|
||||
'tensorflow_estimator >= 2.3.0, < 2.4.0',
|
||||
'termcolor >= 1.1.0',
|
||||
'wrapt >= 1.11.1',
|
||||
'wheel >= 0.26',
|
||||
|
@ -292,6 +292,26 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
|
||||
],
|
||||
)
|
||||
|
||||
tf_http_archive(
|
||||
name = "LinaroArmGcc72",
|
||||
build_file = clean_dep("//third_party/toolchains/embedded/linaro-gcc72-armeabi:linaro-gcc72-armeabi.BUILD"),
|
||||
strip_prefix = "gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/",
|
||||
urls = [
|
||||
"https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz",
|
||||
],
|
||||
sha256 = "cee0087b1f1205b73996651b99acd3a926d136e71047048f1758ffcec69b1ca2",
|
||||
)
|
||||
|
||||
tf_http_archive(
|
||||
name = "LinaroAarch64Gcc72",
|
||||
build_file = clean_dep("//third_party/toolchains/embedded/linaro-gcc72-aarch64:linaro-gcc72-aarch64.BUILD"),
|
||||
strip_prefix = "gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/",
|
||||
urls = [
|
||||
"https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz",
|
||||
],
|
||||
sha256 = "20181f828e1075f1a493947ff91e82dd578ce9f8638fbdfc39e24b62857d8f8d",
|
||||
)
|
||||
|
||||
tf_http_archive(
|
||||
name = "libxsmm_archive",
|
||||
build_file = clean_dep("//third_party:libxsmm.BUILD"),
|
||||
|
2
third_party/aws/workspace.bzl
vendored
2
third_party/aws/workspace.bzl
vendored
@ -9,7 +9,7 @@ def repo():
|
||||
third_party_http_archive(
|
||||
name = "aws",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/aws/aws-sdk-cpp/archive/1.7.336.tar.gz",
|
||||
"https://mirror.tensorflow.orgg/github.com/aws/aws-sdk-cpp/archive/1.7.336.tar.gz",
|
||||
"https://github.com/aws/aws-sdk-cpp/archive/1.7.336.tar.gz",
|
||||
],
|
||||
sha256 = "758174f9788fed6cc1e266bcecb20bf738bd5ef1c3d646131c9ed15c2d6c5720",
|
||||
|
@ -1,3 +1,14 @@
|
||||
--- ./absl/time/internal/cctz/include/cctz/civil_time_detail.h 2020-08-06 01:33:56.005757145 +0200
|
||||
+++ ./absl/time/internal/cctz/include/cctz/civil_time_detail.h 2020-08-06 01:33:35.460579387 +0200
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "absl/base/config.h"
|
||||
|
||||
// Disable constexpr support unless we are in C++14 mode.
|
||||
-#if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
|
||||
+#if (!defined(NO_CONSTEXPR_FOR_YOU) && __cpp_constexpr >= 201304) || (defined(_MSC_VER) && _MSC_VER >= 1910)
|
||||
#define CONSTEXPR_D constexpr // data
|
||||
#define CONSTEXPR_F constexpr // function
|
||||
#define CONSTEXPR_M constexpr // member
|
||||
--- ./absl/time/internal/cctz/BUILD.bazel 2019-09-23 13:20:52.000000000 -0700
|
||||
+++ ./absl/time/internal/cctz/BUILD.bazel.fixed 2019-09-23 13:20:48.000000000 -0700
|
||||
@@ -74,15 +74,6 @@
|
||||
@ -301,4 +312,3 @@
|
||||
+ .internal_compressed_tuple::template Storage<CompressedTuple, I>::get();
|
||||
}
|
||||
};
|
||||
|
||||
|
5
third_party/icu/BUILD.bazel
vendored
5
third_party/icu/BUILD.bazel
vendored
@ -1,5 +1,8 @@
|
||||
# We make everything here private to make any dependencies on ICU become a build
|
||||
# failure and easier/faster to track down, as it's not needed for DeepSpeech and
|
||||
# causes linking problems on Windows.
|
||||
package(
|
||||
default_visibility = ["//visibility:public"],
|
||||
default_visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
1
third_party/py/BUILD.tpl
vendored
1
third_party/py/BUILD.tpl
vendored
@ -67,5 +67,4 @@ config_setting(
|
||||
)
|
||||
|
||||
%{PYTHON_INCLUDE_GENRULE}
|
||||
%{NUMPY_INCLUDE_GENRULE}
|
||||
%{PYTHON_IMPORT_LIB_GENRULE}
|
||||
|
16
third_party/py/python_configure.bzl
vendored
16
third_party/py/python_configure.bzl
vendored
@ -210,7 +210,7 @@ def _create_local_python_repository(repository_ctx):
|
||||
python_lib = _get_python_lib(repository_ctx, python_bin)
|
||||
_check_python_lib(repository_ctx, python_lib)
|
||||
python_include = _get_python_include(repository_ctx, python_bin)
|
||||
numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
|
||||
# numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
|
||||
python_include_rule = _symlink_genrule_for_dir(
|
||||
repository_ctx,
|
||||
python_include,
|
||||
@ -233,12 +233,12 @@ def _create_local_python_repository(repository_ctx):
|
||||
[python_import_lib_src],
|
||||
[python_import_lib_name],
|
||||
)
|
||||
numpy_include_rule = _symlink_genrule_for_dir(
|
||||
repository_ctx,
|
||||
numpy_include,
|
||||
"numpy_include/numpy",
|
||||
"numpy_include",
|
||||
)
|
||||
#numpy_include_rule = _symlink_genrule_for_dir(
|
||||
# repository_ctx,
|
||||
# numpy_include,
|
||||
# "numpy_include/numpy",
|
||||
# "numpy_include",
|
||||
#)
|
||||
|
||||
platform_constraint = ""
|
||||
if repository_ctx.attr.platform_constraint:
|
||||
@ -247,7 +247,7 @@ def _create_local_python_repository(repository_ctx):
|
||||
"%{PYTHON_BIN_PATH}": python_bin,
|
||||
"%{PYTHON_INCLUDE_GENRULE}": python_include_rule,
|
||||
"%{PYTHON_IMPORT_LIB_GENRULE}": python_import_lib_genrule,
|
||||
"%{NUMPY_INCLUDE_GENRULE}": numpy_include_rule,
|
||||
#"%{NUMPY_INCLUDE_GENRULE}": numpy_include_rule,
|
||||
"%{PLATFORM_CONSTRAINT}": platform_constraint,
|
||||
})
|
||||
|
||||
|
2
third_party/repo.bzl
vendored
2
third_party/repo.bzl
vendored
@ -16,6 +16,8 @@
|
||||
|
||||
_SINGLE_URL_WHITELIST = depset([
|
||||
"arm_compiler",
|
||||
"LinaroArmGcc72",
|
||||
"LinaroAarch64Gcc72",
|
||||
])
|
||||
|
||||
def _is_windows(ctx):
|
||||
|
67
third_party/toolchains/embedded/linaro-gcc72-aarch64/BUILD
vendored
Normal file
67
third_party/toolchains/embedded/linaro-gcc72-aarch64/BUILD
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
# This is the entry point for --crosstool_top.
|
||||
#
|
||||
# The cc_toolchain rule used is found by:
|
||||
#
|
||||
# 1. Finding the appropriate toolchain in the CROSSTOOL file based on the --cpu
|
||||
# and --compiler command line flags (if they exist, otherwise using the
|
||||
# "default_target_cpu" / "default_toolchain" fields in the CROSSTOOL file)
|
||||
# 2. Concatenating the "target_cpu" and "compiler" fields of the toolchain in
|
||||
# use and using that as a key in the map in the "toolchains" attribute
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(":linaro_toolchain_config.bzl", "linaro_toolchain_config")
|
||||
|
||||
cc_toolchain_suite(
|
||||
name = "toolchain",
|
||||
toolchains = {
|
||||
"aarch64": ":cc-compiler-aarch64",
|
||||
},
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "empty",
|
||||
srcs = [],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_all_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:tool-wrappers",
|
||||
"@LinaroAarch64Gcc72//:compiler_pieces",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_linker_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:ld",
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:ar",
|
||||
"@LinaroAarch64Gcc72//:compiler_pieces",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_compiler_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:gcc",
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:as",
|
||||
],
|
||||
)
|
||||
|
||||
linaro_toolchain_config(name = "linaro_aarch64")
|
||||
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-aarch64",
|
||||
all_files = ":gcc_linux_all_files",
|
||||
compiler_files = ":gcc_linux_compiler_files",
|
||||
toolchain_identifier = "gcc72_linaro_aarch64",
|
||||
toolchain_config = ":linaro_aarch64",
|
||||
dwp_files = ":empty",
|
||||
dynamic_runtime_lib = ":empty",
|
||||
linker_files = ":gcc_linux_linker_files",
|
||||
objcopy_files = "//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:objcopy",
|
||||
static_runtime_lib = ":empty",
|
||||
strip_files = "//third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc:strip",
|
||||
supports_param_files = 1,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
79
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/BUILD
vendored
Normal file
79
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/BUILD
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
package(default_visibility = ['//third_party/toolchains/embedded/linaro-gcc72-aarch64:__pkg__'])
|
||||
|
||||
filegroup(
|
||||
name = 'gcc',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:gcc',
|
||||
'aarch64-linux-gnu-gcc',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ar',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:ar',
|
||||
'aarch64-linux-gnu-ar',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ld',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:ld',
|
||||
'aarch64-linux-gnu-ld',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'nm',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:nm',
|
||||
'aarch64-linux-gnu-nm',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objcopy',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:objcopy',
|
||||
'aarch64-linux-gnu-objcopy',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objdump',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:objdump',
|
||||
'aarch64-linux-gnu-objdump',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'strip',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:strip',
|
||||
'aarch64-linux-gnu-strip',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'as',
|
||||
srcs = [
|
||||
'@LinaroAarch64Gcc72//:as',
|
||||
'aarch64-linux-gnu-as',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'tool-wrappers',
|
||||
srcs = [
|
||||
':gcc',
|
||||
':ar',
|
||||
':ld',
|
||||
':nm',
|
||||
':objcopy',
|
||||
':objdump',
|
||||
':strip',
|
||||
':as',
|
||||
],
|
||||
)
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-ar
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-ar
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-ar \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-ar \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-as
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-as
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-as \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-as \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-cpp
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-cpp
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-cpp \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-cpp \
|
||||
"$@"
|
6
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-gcc
vendored
Executable file
6
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-gcc
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
PATH="external/LinaroAarch64Gcc72/libexec/gcc/aarch64-linux-gnu/7.2.1/:$PATH" \
|
||||
exec \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-gcc \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-gcov
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-gcov
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-gcov \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-gcov \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-ld
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-ld
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-ld \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-ld \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-nm
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-nm
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-nm \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-nm \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-objcopy
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-objcopy
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-objcopy \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-objcopy \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-objdump
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-objdump
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-objdump \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-objdump \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-strip
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-aarch64/gcc/aarch64-linux-gnu-strip
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a aarch64-linux-gnu-strip \
|
||||
external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-strip \
|
||||
"$@"
|
81
third_party/toolchains/embedded/linaro-gcc72-aarch64/linaro-gcc72-aarch64.BUILD
vendored
Normal file
81
third_party/toolchains/embedded/linaro-gcc72-aarch64/linaro-gcc72-aarch64.BUILD
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
package(default_visibility = ['//visibility:public'])
|
||||
|
||||
filegroup(
|
||||
name = 'gcc',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-gcc',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ar',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-ar',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ld',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-ld',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'nm',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-nm',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objcopy',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-objcopy',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objdump',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-objdump',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'strip',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-strip',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'as',
|
||||
srcs = [
|
||||
'bin/aarch64-linux-gnu-as',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_pieces',
|
||||
srcs = glob([
|
||||
'aarch64-linux-gnu/**',
|
||||
'libexec/**',
|
||||
'lib/gcc/aarch64-linux-gnu/**',
|
||||
'include/**',
|
||||
]),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_components',
|
||||
srcs = [
|
||||
':gcc',
|
||||
':ar',
|
||||
':ld',
|
||||
':nm',
|
||||
':objcopy',
|
||||
':objdump',
|
||||
':strip',
|
||||
':as',
|
||||
],
|
||||
)
|
484
third_party/toolchains/embedded/linaro-gcc72-aarch64/linaro_toolchain_config.bzl
vendored
Normal file
484
third_party/toolchains/embedded/linaro-gcc72-aarch64/linaro_toolchain_config.bzl
vendored
Normal file
@ -0,0 +1,484 @@
|
||||
# Copyright 2019 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""A Starlark cc_toolchain configuration rule"""
|
||||
|
||||
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
|
||||
"action_config",
|
||||
"artifact_name_pattern",
|
||||
"env_entry",
|
||||
"env_set",
|
||||
"feature",
|
||||
"feature_set",
|
||||
"flag_group",
|
||||
"flag_set",
|
||||
"make_variable",
|
||||
"tool",
|
||||
"tool_path",
|
||||
"variable_with_value",
|
||||
"with_feature_set",
|
||||
)
|
||||
|
||||
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
|
||||
|
||||
all_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.clif_match,
|
||||
ACTION_NAMES.lto_backend,
|
||||
]
|
||||
|
||||
all_cpp_compile_actions = [
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.clif_match,
|
||||
]
|
||||
|
||||
preprocessor_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.clif_match,
|
||||
]
|
||||
|
||||
codegen_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
]
|
||||
|
||||
all_link_actions = [
|
||||
ACTION_NAMES.cpp_link_executable,
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
]
|
||||
|
||||
def _impl(ctx):
|
||||
|
||||
abi_version = "aarch64"
|
||||
abi_libc_version = "glibc_2.24"
|
||||
builtin_sysroot = None
|
||||
compiler = "gcc"
|
||||
host_system_name = "aarch64"
|
||||
needs_pic = True
|
||||
supports_gold_linker = False
|
||||
supports_incremental_linker = False
|
||||
supports_fission = False
|
||||
supports_interface_shared_objects = False
|
||||
supports_normalizing_ar = False
|
||||
supports_start_end_lib = False
|
||||
supports_thin_archives = False
|
||||
target_libc = "glibc_2.24"
|
||||
target_cpu = "armv8"
|
||||
target_system_name = "armv8"
|
||||
toolchain_identifier = "gcc72_linaro_aarch64"
|
||||
cc_target_os = None
|
||||
|
||||
action_configs = []
|
||||
|
||||
supports_pic_feature = feature(name = "supports_pic", enabled = True)
|
||||
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
|
||||
|
||||
user_compile_flags_feature = feature(
|
||||
name = "user_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["%{user_compile_flags}"],
|
||||
iterate_over = "user_compile_flags",
|
||||
expand_if_available = "user_compile_flags",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
user_link_flags_feature = feature(
|
||||
name = "user_link_flags",
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["%{user_link_flags}"],
|
||||
iterate_over = "user_link_flags",
|
||||
expand_if_available = "user_link_flags",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
shared_flag_feature = feature(
|
||||
name = "shared_flag",
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
ACTION_NAMES.lto_index_for_dynamic_library,
|
||||
ACTION_NAMES.lto_index_for_nodeps_dynamic_library,
|
||||
],
|
||||
flag_groups = [flag_group(flags = ["-shared"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
sysroot_feature = feature(
|
||||
name = "sysroot",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
ACTION_NAMES.cpp_link_executable,
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["--sysroot=%{sysroot}"],
|
||||
expand_if_available = "sysroot",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
objcopy_embed_flags_feature = feature(
|
||||
name = "objcopy_embed_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = ["objcopy_embed_data"],
|
||||
flag_groups = [flag_group(flags = ["-I", "binary"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
unfiltered_compile_flags_feature = feature(
|
||||
name = "unfiltered_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
# Make C++ compilation deterministic. Use linkstamping instead of these
|
||||
# compiler symbols.
|
||||
"-Wno-builtin-macro-redefined",
|
||||
"-D__DATE__=\"redacted\"",
|
||||
"-D__TIMESTAMP__=\"redacted\"",
|
||||
"-D__TIME__=\"redacted\"",
|
||||
# This makes GCC and Clang do what we want when called through symlinks.
|
||||
"-no-canonical-prefixes",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
default_compile_flags_feature = feature(
|
||||
name = "default_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-U_FORTIFY_SOURCE",
|
||||
"-D_FORTIFY_SOURCE=1",
|
||||
"-fstack-protector",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [flag_group(flags = ["-g"])],
|
||||
with_features = [with_feature_set(features = ["dbg"])],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g0",
|
||||
"-O2",
|
||||
"-DNDEBUG",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
],
|
||||
),
|
||||
],
|
||||
with_features = [with_feature_set(features = ["opt"])],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-std=c++11",
|
||||
"--sysroot=external/LinaroAarch64Gcc72/aarch64-linux-gnu/libc",
|
||||
"-pthread",
|
||||
"-nostdinc",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/aarch64-linux-gnu/include/c++/7.2.1/aarch64-linux-gnu",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/aarch64-linux-gnu/include/c++/7.2.1",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/lib/gcc/aarch64-linux-gnu/7.2.1/include",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/aarch64-linux-gnu/libc/usr/include",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/lib/gcc/aarch64-linux-gnu/7.2.1/include-fixed",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/aarch64-linux-gnu/libc/usr/include",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/aarch64-linux-gnu/libc/usr/include/aarch64-linux-gnu",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/lib/gcc/aarch64-linux-gnu/7.2.1/include",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/include/c++/7.2.1/aarch64-linux-gnu",
|
||||
"-isystem",
|
||||
"external/LinaroAarch64Gcc72/include/c++/7.2.1",
|
||||
# Security hardening on by default.
|
||||
"-fstack-protector",
|
||||
"-fPIE",
|
||||
# All warnings are enabled. Maybe enable -Werror as well?
|
||||
"-Wall",
|
||||
# Enable a few more warnings that aren't part of -Wall.
|
||||
"-Wunused-but-set-parameter",
|
||||
# But disable some that are problematic.
|
||||
"-Wno-free-nonheap-object", # has false positives
|
||||
# Keep stack frames for debugging, even in opt mode.
|
||||
"-fno-omit-frame-pointer",
|
||||
# Enable coloring even if there's no attached terminal. Bazel removes the
|
||||
# escape sequences if --nocolor is specified.
|
||||
"-fdiagnostics-color=always",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
default_link_flags_feature = feature(
|
||||
name = "default_link_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
# "-target",
|
||||
# "aarch64-linux-gnu",
|
||||
"--sysroot=external/LinaroAarch64Gcc72/aarch64-linux-gnu/libc",
|
||||
"-pass-exit-codes",
|
||||
"-pie",
|
||||
"-lstdc++",
|
||||
"-lm",
|
||||
"-lpthread",
|
||||
"-Wl,--dynamic-linker=/lib/ld-linux-aarch64.so.1",
|
||||
"-Wl,-no-as-needed",
|
||||
"-Wl,-z,relro,-z,now",
|
||||
"-no-canonical-prefixes",
|
||||
# Stamp the binary with a unique identifier.
|
||||
"-Wl,--build-id=md5",
|
||||
"-Wl,--hash-style=gnu",
|
||||
"-Lexternal/LinaroAarch64Gcc72/aarch64-linux-gnu/lib",
|
||||
"-Lexternal/LinaroAarch64Gcc72/aarch64-linux-gnu/libc/lib",
|
||||
"-Lexternal/LinaroAarch64Gcc72/aarch64-linux-gnu/libc/usr/lib",
|
||||
"-Bexternal/LinaroAarch64Gcc72/aarch64-linux-gnu/bin",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
|
||||
with_features = [with_feature_set(features = ["opt"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
opt_feature = feature(name = "opt")
|
||||
|
||||
dbg_feature = feature(name = "dbg")
|
||||
|
||||
features = [
|
||||
default_compile_flags_feature,
|
||||
default_link_flags_feature,
|
||||
supports_dynamic_linker_feature,
|
||||
supports_pic_feature,
|
||||
objcopy_embed_flags_feature,
|
||||
opt_feature,
|
||||
dbg_feature,
|
||||
user_compile_flags_feature,
|
||||
user_link_flags_feature,
|
||||
shared_flag_feature,
|
||||
sysroot_feature,
|
||||
unfiltered_compile_flags_feature,
|
||||
]
|
||||
|
||||
cxx_builtin_include_directories = [
|
||||
"%package(@LinaroAarch64Gcc72//include)%",
|
||||
"%package(@LinaroAarch64Gcc72//aarch64-linux-gnu/libc/usr/include)%",
|
||||
"%package(@LinaroAarch64Gcc72//aarch64-linux-gnu/libc/lib/gcc/aarch64-linux-gnu/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroAarch64Gcc72//include)%/c++/7.2.1",
|
||||
"%package(@LinaroAarch64Gcc72//aarch64-linux-gnu/libc/lib/gcc/aarch64-linux-gnu/7.2.1/include)%",
|
||||
"%package(@LinaroAarch64Gcc72//aarch64-linux-gnu/libc/lib/gcc/aarch64-linux-gnu/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroAarch64Gcc72//lib/gcc/aarch64-linux-gnu/7.2.1/include)%",
|
||||
"%package(@LinaroAarch64Gcc72//lib/gcc/aarch64-linux-gnu/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroAarch64Gcc72//aarch64-linux-gnu/include)%/c++/7.2.1",
|
||||
]
|
||||
|
||||
artifact_name_patterns = []
|
||||
make_variables = []
|
||||
|
||||
tool_paths = [
|
||||
tool_path(name = "ar", path = "gcc/aarch64-linux-gnu-ar"),
|
||||
tool_path(name = "compat-ld", path = "gcc/aarch64-linux-gnu-ld"),
|
||||
tool_path(name = "cpp", path = "gcc/aarch64-linux-gnu-cpp"),
|
||||
tool_path(name = "dwp", path = "gcc/aarch64-linux-gnu-dwp"),
|
||||
tool_path(name = "gcc", path = "gcc/aarch64-linux-gnu-gcc"),
|
||||
tool_path(name = "gcov", path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9"),
|
||||
# C(++), compiles invoke the compiler (as that is the one knowing where
|
||||
# to find libraries),, but we provide LD so other rules can invoke the linker.
|
||||
tool_path(name = "ld", path = "gcc/aarch64-linux-gnu-ld"),
|
||||
tool_path(name = "nm", path = "gcc/aarch64-linux-gnu-nm"),
|
||||
tool_path(name = "objcopy", path = "gcc/aarch64-linux-gnu-objcopy"),
|
||||
tool_path(name = "objdump", path = "gcc/aarch64-linux-gnu-objdump"),
|
||||
tool_path(name = "strip", path = "gcc/aarch64-linux-gnu-strip"),
|
||||
]
|
||||
|
||||
return cc_common.create_cc_toolchain_config_info(
|
||||
ctx = ctx,
|
||||
features = features,
|
||||
action_configs = action_configs,
|
||||
artifact_name_patterns = artifact_name_patterns,
|
||||
cxx_builtin_include_directories = cxx_builtin_include_directories,
|
||||
toolchain_identifier = toolchain_identifier,
|
||||
host_system_name = host_system_name,
|
||||
target_system_name = target_system_name,
|
||||
target_cpu = target_cpu,
|
||||
target_libc = target_libc,
|
||||
compiler = compiler,
|
||||
abi_version = abi_version,
|
||||
abi_libc_version = abi_libc_version,
|
||||
tool_paths = tool_paths,
|
||||
make_variables = make_variables,
|
||||
builtin_sysroot = builtin_sysroot,
|
||||
cc_target_os = cc_target_os,
|
||||
)
|
||||
|
||||
linaro_toolchain_config = rule(
|
||||
implementation = _impl,
|
||||
attrs = {},
|
||||
provides = [CcToolchainConfigInfo],
|
||||
)
|
67
third_party/toolchains/embedded/linaro-gcc72-armeabi/BUILD
vendored
Normal file
67
third_party/toolchains/embedded/linaro-gcc72-armeabi/BUILD
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
# This is the entry point for --crosstool_top.
|
||||
#
|
||||
# The cc_toolchain rule used is found by:
|
||||
#
|
||||
# 1. Finding the appropriate toolchain in the CROSSTOOL file based on the --cpu
|
||||
# and --compiler command line flags (if they exist, otherwise using the
|
||||
# "default_target_cpu" / "default_toolchain" fields in the CROSSTOOL file)
|
||||
# 2. Concatenating the "target_cpu" and "compiler" fields of the toolchain in
|
||||
# use and using that as a key in the map in the "toolchains" attribute
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(":linaro_toolchain_config.bzl", "linaro_toolchain_config")
|
||||
|
||||
cc_toolchain_suite(
|
||||
name = "toolchain",
|
||||
toolchains = {
|
||||
"armv7a": ":cc-compiler-armv7a",
|
||||
},
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "empty",
|
||||
srcs = [],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_all_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:tool-wrappers",
|
||||
"@LinaroArmGcc72//:compiler_pieces",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_linker_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:ld",
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:ar",
|
||||
"@LinaroArmGcc72//:compiler_pieces",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "gcc_linux_compiler_files",
|
||||
srcs = [
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:gcc",
|
||||
"//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:as",
|
||||
],
|
||||
)
|
||||
|
||||
linaro_toolchain_config(name = "linaro_armeabi-v7a")
|
||||
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-armv7a",
|
||||
all_files = ":gcc_linux_all_files",
|
||||
compiler_files = ":gcc_linux_compiler_files",
|
||||
toolchain_identifier = "gcc72_linaro_armhf",
|
||||
toolchain_config = ":linaro_armeabi-v7a",
|
||||
dwp_files = ":empty",
|
||||
dynamic_runtime_lib = ":empty",
|
||||
linker_files = ":gcc_linux_linker_files",
|
||||
objcopy_files = "//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:objcopy",
|
||||
static_runtime_lib = ":empty",
|
||||
strip_files = "//third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc:strip",
|
||||
supports_param_files = 0,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
79
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/BUILD
vendored
Normal file
79
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/BUILD
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
package(default_visibility = ['//third_party/toolchains/embedded/linaro-gcc72-armeabi:__pkg__'])
|
||||
|
||||
filegroup(
|
||||
name = 'gcc',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:gcc',
|
||||
'arm-linux-gnueabihf-gcc',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ar',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:ar',
|
||||
'arm-linux-gnueabihf-ar',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ld',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:ld',
|
||||
'arm-linux-gnueabihf-ld',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'nm',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:nm',
|
||||
'arm-linux-gnueabihf-nm',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objcopy',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:objcopy',
|
||||
'arm-linux-gnueabihf-objcopy',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objdump',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:objdump',
|
||||
'arm-linux-gnueabihf-objdump',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'strip',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:strip',
|
||||
'arm-linux-gnueabihf-strip',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'as',
|
||||
srcs = [
|
||||
'@LinaroArmGcc72//:as',
|
||||
'arm-linux-gnueabihf-as',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'tool-wrappers',
|
||||
srcs = [
|
||||
':gcc',
|
||||
':ar',
|
||||
':ld',
|
||||
':nm',
|
||||
':objcopy',
|
||||
':objdump',
|
||||
':strip',
|
||||
':as',
|
||||
],
|
||||
)
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-ar
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-ar
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-ar \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-ar \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-as
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-as
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-as \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-as \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-cpp
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-cpp
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-cpp \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-cpp \
|
||||
"$@"
|
6
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-gcc
vendored
Executable file
6
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-gcc
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
PATH="external/LinaroArmGcc72/libexec/gcc/arm-linux-gnueabihf/7.2.1/:$PATH" \
|
||||
exec \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-gcc \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-gcov
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-gcov
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-gcov \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-gcov \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-ld
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-ld
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-ld \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-ld \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-nm
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-nm
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-nm \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-nm \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-objcopy
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-objcopy
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-objcopy \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-objcopy \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-objdump
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-objdump
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-objdump \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-objdump \
|
||||
"$@"
|
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-strip
vendored
Executable file
5
third_party/toolchains/embedded/linaro-gcc72-armeabi/gcc/arm-linux-gnueabihf-strip
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
exec -a arm-linux-gnueabihf-strip \
|
||||
external/LinaroArmGcc72/bin/arm-linux-gnueabihf-strip \
|
||||
"$@"
|
81
third_party/toolchains/embedded/linaro-gcc72-armeabi/linaro-gcc72-armeabi.BUILD
vendored
Normal file
81
third_party/toolchains/embedded/linaro-gcc72-armeabi/linaro-gcc72-armeabi.BUILD
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
package(default_visibility = ['//visibility:public'])
|
||||
|
||||
filegroup(
|
||||
name = 'gcc',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-gcc',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ar',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-ar',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'ld',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-ld',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'nm',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-nm',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objcopy',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-objcopy',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'objdump',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-objdump',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'strip',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-strip',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'as',
|
||||
srcs = [
|
||||
'bin/arm-linux-gnueabihf-as',
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_pieces',
|
||||
srcs = glob([
|
||||
'arm-linux-gnueabihf/**',
|
||||
'libexec/**',
|
||||
'lib/gcc/arm-linux-gnueabihf/**',
|
||||
'include/**',
|
||||
]),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = 'compiler_components',
|
||||
srcs = [
|
||||
':gcc',
|
||||
':ar',
|
||||
':ld',
|
||||
':nm',
|
||||
':objcopy',
|
||||
':objdump',
|
||||
':strip',
|
||||
':as',
|
||||
],
|
||||
)
|
484
third_party/toolchains/embedded/linaro-gcc72-armeabi/linaro_toolchain_config.bzl
vendored
Normal file
484
third_party/toolchains/embedded/linaro-gcc72-armeabi/linaro_toolchain_config.bzl
vendored
Normal file
@ -0,0 +1,484 @@
|
||||
# Copyright 2019 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""A Starlark cc_toolchain configuration rule"""
|
||||
|
||||
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
|
||||
"action_config",
|
||||
"artifact_name_pattern",
|
||||
"env_entry",
|
||||
"env_set",
|
||||
"feature",
|
||||
"feature_set",
|
||||
"flag_group",
|
||||
"flag_set",
|
||||
"make_variable",
|
||||
"tool",
|
||||
"tool_path",
|
||||
"variable_with_value",
|
||||
"with_feature_set",
|
||||
)
|
||||
|
||||
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
|
||||
|
||||
all_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.clif_match,
|
||||
ACTION_NAMES.lto_backend,
|
||||
]
|
||||
|
||||
all_cpp_compile_actions = [
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.clif_match,
|
||||
]
|
||||
|
||||
preprocessor_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.clif_match,
|
||||
]
|
||||
|
||||
codegen_compile_actions = [
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
]
|
||||
|
||||
all_link_actions = [
|
||||
ACTION_NAMES.cpp_link_executable,
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
]
|
||||
|
||||
def _impl(ctx):
|
||||
|
||||
abi_version = "armeabi"
|
||||
abi_libc_version = "glibc_2.24"
|
||||
builtin_sysroot = None
|
||||
compiler = "gcc"
|
||||
host_system_name = "armeabi"
|
||||
needs_pic = True
|
||||
supports_gold_linker = False
|
||||
supports_incremental_linker = False
|
||||
supports_fission = False
|
||||
supports_interface_shared_objects = False
|
||||
supports_normalizing_ar = False
|
||||
supports_start_end_lib = False
|
||||
supports_thin_archives = False
|
||||
target_libc = "glibc_2.24"
|
||||
target_cpu = "armv7"
|
||||
target_system_name = "armeabi-v7a"
|
||||
toolchain_identifier = "gcc72_linaro_armhf"
|
||||
cc_target_os = None
|
||||
|
||||
action_configs = []
|
||||
|
||||
supports_pic_feature = feature(name = "supports_pic", enabled = True)
|
||||
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
|
||||
|
||||
user_compile_flags_feature = feature(
|
||||
name = "user_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["%{user_compile_flags}"],
|
||||
iterate_over = "user_compile_flags",
|
||||
expand_if_available = "user_compile_flags",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
user_link_flags_feature = feature(
|
||||
name = "user_link_flags",
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["%{user_link_flags}"],
|
||||
iterate_over = "user_link_flags",
|
||||
expand_if_available = "user_link_flags",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
shared_flag_feature = feature(
|
||||
name = "shared_flag",
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
ACTION_NAMES.lto_index_for_dynamic_library,
|
||||
ACTION_NAMES.lto_index_for_nodeps_dynamic_library,
|
||||
],
|
||||
flag_groups = [flag_group(flags = ["-shared"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
sysroot_feature = feature(
|
||||
name = "sysroot",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
ACTION_NAMES.cpp_link_executable,
|
||||
ACTION_NAMES.cpp_link_dynamic_library,
|
||||
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["--sysroot=%{sysroot}"],
|
||||
expand_if_available = "sysroot",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
objcopy_embed_flags_feature = feature(
|
||||
name = "objcopy_embed_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = ["objcopy_embed_data"],
|
||||
flag_groups = [flag_group(flags = ["-I", "binary"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
unfiltered_compile_flags_feature = feature(
|
||||
name = "unfiltered_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
# Make C++ compilation deterministic. Use linkstamping instead of these
|
||||
# compiler symbols.
|
||||
"-Wno-builtin-macro-redefined",
|
||||
"-D__DATE__=\"redacted\"",
|
||||
"-D__TIMESTAMP__=\"redacted\"",
|
||||
"-D__TIME__=\"redacted\"",
|
||||
# This makes GCC and Clang do what we want when called through symlinks.
|
||||
"-no-canonical-prefixes",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
default_compile_flags_feature = feature(
|
||||
name = "default_compile_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-U_FORTIFY_SOURCE",
|
||||
"-D_FORTIFY_SOURCE=1",
|
||||
"-fstack-protector",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [flag_group(flags = ["-g"])],
|
||||
with_features = [with_feature_set(features = ["dbg"])],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.assemble,
|
||||
ACTION_NAMES.preprocess_assemble,
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.c_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g0",
|
||||
"-O2",
|
||||
"-DNDEBUG",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
],
|
||||
),
|
||||
],
|
||||
with_features = [with_feature_set(features = ["opt"])],
|
||||
),
|
||||
flag_set(
|
||||
actions = [
|
||||
ACTION_NAMES.linkstamp_compile,
|
||||
ACTION_NAMES.cpp_compile,
|
||||
ACTION_NAMES.cpp_header_parsing,
|
||||
ACTION_NAMES.cpp_module_compile,
|
||||
ACTION_NAMES.cpp_module_codegen,
|
||||
ACTION_NAMES.lto_backend,
|
||||
ACTION_NAMES.clif_match,
|
||||
],
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-std=c++11",
|
||||
"--sysroot=external/LinaroArmGcc72/arm-linux-gnueabihf/libc",
|
||||
"-pthread",
|
||||
"-nostdinc",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/arm-linux-gnueabihf/include/c++/7.2.1",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/lib/gcc/arm-linux-gnueabihf/7.2.1/include",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/arm-linux-gnueabihf/libc/usr/include",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/arm-linux-gnueabihf/libc/usr/include",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/lib/gcc/arm-linux-gnueabihf/7.2.1/include",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/include/c++/7.2.1/arm-linux-gnueabihf",
|
||||
"-isystem",
|
||||
"external/LinaroArmGcc72/include/c++/7.2.1",
|
||||
# Security hardening on by default.
|
||||
"-fstack-protector",
|
||||
"-fPIE",
|
||||
# All warnings are enabled. Maybe enable -Werror as well?
|
||||
"-Wall",
|
||||
# Enable a few more warnings that aren't part of -Wall.
|
||||
"-Wunused-but-set-parameter",
|
||||
# But disable some that are problematic.
|
||||
"-Wno-free-nonheap-object", # has false positives
|
||||
# Keep stack frames for debugging, even in opt mode.
|
||||
"-fno-omit-frame-pointer",
|
||||
# Enable coloring even if there's no attached terminal. Bazel removes the
|
||||
# escape sequences if --nocolor is specified.
|
||||
"-fdiagnostics-color=always",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
default_link_flags_feature = feature(
|
||||
name = "default_link_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
# "-target",
|
||||
# "arm-linux-gnueabihf",
|
||||
"--sysroot=external/LinaroArmGcc72/arm-linux-gnueabihf/libc",
|
||||
"-pass-exit-codes",
|
||||
"-pie",
|
||||
"-lstdc++",
|
||||
"-lm",
|
||||
"-lpthread",
|
||||
"-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3",
|
||||
"-Wl,-no-as-needed",
|
||||
"-Wl,-z,relro,-z,now",
|
||||
"-no-canonical-prefixes",
|
||||
# Stamp the binary with a unique identifier.
|
||||
"-Wl,--build-id=md5",
|
||||
"-Wl,--hash-style=gnu",
|
||||
"-Lexternal/LinaroArmGcc72/arm-linux-gnueabihf/lib",
|
||||
"-Lexternal/LinaroArmGcc72/arm-linux-gnueabihf/libc/lib",
|
||||
"-Lexternal/LinaroArmGcc72/arm-linux-gnueabihf/libc/usr/lib",
|
||||
"-Bexternal/LinaroArmGcc72/arm-linux-gnueabihf/bin",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
|
||||
with_features = [with_feature_set(features = ["opt"])],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
opt_feature = feature(name = "opt")
|
||||
|
||||
dbg_feature = feature(name = "dbg")
|
||||
|
||||
features = [
|
||||
default_compile_flags_feature,
|
||||
default_link_flags_feature,
|
||||
supports_dynamic_linker_feature,
|
||||
supports_pic_feature,
|
||||
objcopy_embed_flags_feature,
|
||||
opt_feature,
|
||||
dbg_feature,
|
||||
user_compile_flags_feature,
|
||||
user_link_flags_feature,
|
||||
shared_flag_feature,
|
||||
sysroot_feature,
|
||||
unfiltered_compile_flags_feature,
|
||||
]
|
||||
|
||||
cxx_builtin_include_directories = [
|
||||
"%package(@LinaroArmGcc72//include)%",
|
||||
"%package(@LinaroArmGcc72//arm-linux-gnueabihf/libc/usr/include)%",
|
||||
"%package(@LinaroArmGcc72//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroArmGcc72//include)%/c++/7.2.1",
|
||||
"%package(@LinaroArmGcc72//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/7.2.1/include)%",
|
||||
"%package(@LinaroArmGcc72//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroArmGcc72//lib/gcc/arm-linux-gnueabihf/7.2.1/include)%",
|
||||
"%package(@LinaroArmGcc72//lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed)%",
|
||||
"%package(@LinaroArmGcc72//arm-linux-gnueabihf/include)%/c++/7.2.1",
|
||||
]
|
||||
|
||||
artifact_name_patterns = []
|
||||
make_variables = []
|
||||
|
||||
tool_paths = [
|
||||
tool_path(name = "ar", path = "gcc/arm-linux-gnueabihf-ar"),
|
||||
tool_path(name = "compat-ld", path = "gcc/arm-linux-gnueabihf-ld"),
|
||||
tool_path(name = "cpp", path = "gcc/arm-linux-gnueabihf-cpp"),
|
||||
tool_path(name = "dwp", path = "gcc/arm-linux-gnueabihf-dwp"),
|
||||
tool_path(name = "gcc", path = "gcc/arm-linux-gnueabihf-gcc"),
|
||||
tool_path(name = "gcov", path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9"),
|
||||
# C(++), compiles invoke the compiler (as that is the one knowing where
|
||||
# to find libraries),, but we provide LD so other rules can invoke the linker.
|
||||
tool_path(name = "ld", path = "gcc/arm-linux-gnueabihf-ld"),
|
||||
tool_path(name = "nm", path = "gcc/arm-linux-gnueabihf-nm"),
|
||||
tool_path(name = "objcopy", path = "gcc/arm-linux-gnueabihf-objcopy"),
|
||||
tool_path(name = "objdump", path = "gcc/arm-linux-gnueabihf-objdump"),
|
||||
tool_path(name = "strip", path = "gcc/arm-linux-gnueabihf-strip"),
|
||||
]
|
||||
|
||||
return cc_common.create_cc_toolchain_config_info(
|
||||
ctx = ctx,
|
||||
features = features,
|
||||
action_configs = action_configs,
|
||||
artifact_name_patterns = artifact_name_patterns,
|
||||
cxx_builtin_include_directories = cxx_builtin_include_directories,
|
||||
toolchain_identifier = toolchain_identifier,
|
||||
host_system_name = host_system_name,
|
||||
target_system_name = target_system_name,
|
||||
target_cpu = target_cpu,
|
||||
target_libc = target_libc,
|
||||
compiler = compiler,
|
||||
abi_version = abi_version,
|
||||
abi_libc_version = abi_libc_version,
|
||||
tool_paths = tool_paths,
|
||||
make_variables = make_variables,
|
||||
builtin_sysroot = builtin_sysroot,
|
||||
cc_target_os = cc_target_os,
|
||||
)
|
||||
|
||||
linaro_toolchain_config = rule(
|
||||
implementation = _impl,
|
||||
attrs = {},
|
||||
provides = [CcToolchainConfigInfo],
|
||||
)
|
Loading…
Reference in New Issue
Block a user