chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+70
View File
@@ -0,0 +1,70 @@
# Description:
# libpng is the official PNG reference library.
licenses(["notice"]) # BSD/MIT-like license
exports_files(["LICENSE"])
cc_library(
name = "png",
srcs = [
"png.c",
"pngdebug.h",
"pngerror.c",
"pngget.c",
"pnginfo.h",
"pnglibconf.h",
"pngmem.c",
"pngpread.c",
"pngpriv.h",
"pngread.c",
"pngrio.c",
"pngrtran.c",
"pngrutil.c",
"pngset.c",
"pngstruct.h",
"pngtrans.c",
"pngwio.c",
"pngwrite.c",
"pngwtran.c",
"pngwutil.c",
] + select({
":windows": [
"intel/filter_sse2_intrinsics.c",
"intel/intel_init.c",
],
"@xla//xla/tsl:linux_ppc64le": [
"powerpc/filter_vsx_intrinsics.c",
"powerpc/powerpc_init.c",
],
"//conditions:default": [
],
}),
hdrs = [
"png.h",
"pngconf.h",
],
copts = select({
":windows": ["-DPNG_INTEL_SSE_OPT=1"],
"//conditions:default": [],
}),
includes = ["."],
linkopts = select({
":windows": [],
"//conditions:default": ["-lm"],
}),
visibility = ["//visibility:public"],
deps = ["@zlib"],
)
genrule(
name = "snappy_stubs_public_h",
srcs = ["scripts/pnglibconf.h.prebuilt"],
outs = ["pnglibconf.h"],
cmd = "sed -e 's/PNG_ZLIB_VERNUM 0/PNG_ZLIB_VERNUM 0x1310/' $< >$@",
)
config_setting(
name = "windows",
constraint_values = ["@platforms//os:windows"],
)
+16
View File
@@ -0,0 +1,16 @@
diff -r -u ./scripts/pnglibconf.h.prebuilt ./scripts/pnglibconf.h.prebuilt
--- ./scripts/pnglibconf.h.prebuilt
+++ ./scripts/pnglibconf.h.prebuilt
@@ -19,6 +19,12 @@
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
+
+/* Workaround not having a great build file by forcing
+ * png filter optimization to be disabled on arm */
+#define PNG_ARM_NEON_OPT 0
+
+
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
+14
View File
@@ -0,0 +1,14 @@
"""Loads the png library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "png",
build_file = "//third_party/png:png.BUILD",
patch_file = ["//third_party/png:png_fix_rpi.patch"],
sha256 = "fecc95b46cf05e8e3fc8a414750e0ba5aad00d89e9fdf175e94ff041caf1a03a",
strip_prefix = "libpng-1.6.43",
system_build_file = "//third_party/systemlibs:png.BUILD",
urls = tf_mirror_urls("https://github.com/glennrp/libpng/archive/v1.6.43.tar.gz"),
)