Make tflite_copts() pluggable.
Also remove the `-fno-sanitize=shift-base` flag as it is unsupported by GCC. PiperOrigin-RevId: 351812525 Change-Id: I623b110f76aea994d6e22d708f5bafd8dd6fb835
This commit is contained in:
parent
172bbf2f2c
commit
2362126775
@ -7,6 +7,7 @@ load(
|
|||||||
"tf_cc_shared_object",
|
"tf_cc_shared_object",
|
||||||
"tf_cc_test",
|
"tf_cc_test",
|
||||||
)
|
)
|
||||||
|
load("//tensorflow/lite:special_rules.bzl", "tflite_copts_extra")
|
||||||
load("//tensorflow/lite/java:aar_with_jni.bzl", "aar_with_jni")
|
load("//tensorflow/lite/java:aar_with_jni.bzl", "aar_with_jni")
|
||||||
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
|
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
|
||||||
|
|
||||||
@ -42,14 +43,9 @@ def tflite_copts():
|
|||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-fno-exceptions", # Exceptions are unused in TFLite.
|
"-fno-exceptions", # Exceptions are unused in TFLite.
|
||||||
],
|
],
|
||||||
}) + select({
|
|
||||||
clean_dep("//tensorflow:linux_x86_64"): [
|
|
||||||
"-fno-sanitize=shift-base", # Possible invalid left shift in neon2sse.
|
|
||||||
],
|
|
||||||
"//conditions:default": [],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return copts
|
return copts + tflite_copts_extra()
|
||||||
|
|
||||||
def tflite_copts_warnings():
|
def tflite_copts_warnings():
|
||||||
"""Defines common warning flags used primarily by internal TFLite libraries."""
|
"""Defines common warning flags used primarily by internal TFLite libraries."""
|
||||||
|
@ -96,3 +96,7 @@ def flex_portable_tensorflow_deps():
|
|||||||
"@icu//:common",
|
"@icu//:common",
|
||||||
"//third_party/icu/data:conversion_data",
|
"//third_party/icu/data:conversion_data",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def tflite_copts_extra():
|
||||||
|
"""Defines extra compile time flags for tflite_copts(). Currently empty."""
|
||||||
|
return []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user