Add Linux Clang floor test to Abseil CI and guard ABSL_UNSAFE_BUFFERS. Guard ABSL_UNSAFE_BUFFERS with ABSL_HAVE_ATTRIBUTE(unsafe_buffer_usage) so it does not emit an unknown pragma warning on Clang versions prior to Clang 16, and add a Clang/libc++ (floor) configuration to the Linux GitHub Actions CI matrix. PiperOrigin-RevId: 1001139439
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9957543..999ac14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml
@@ -72,6 +72,11 @@ # linux_clang-latest_libstdcxx_bazel.cfg - name: Clang/libstdc++ toolchain: libstdc++ + - name: Clang/libc++ (floor) + toolchain: clang + remote_config: remote-floor + container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:816eea87492a2ccdbe6e8b8b6d80c3c149547f6d0f7553286db05e223a688cfd + stds: '["c++17"]' # linux_gcc-latest_libstdcxx_bazel.cfg - name: GCC/libstdc++ toolchain: gcc @@ -87,7 +92,7 @@ - name: GCC/libstdc++ (floor) toolchain: gcc remote_config: remote-floor - container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:5a5d17e588e14d5f0d993ea828b7ba844c72b02980bcf731ccf5a4cddf8db599 + container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:816eea87492a2ccdbe6e8b8b6d80c3c149547f6d0f7553286db05e223a688cfd stds: '["c++17"]' # linux_arm_clang-latest_libcxx_bazel.cfg (c++17 and c++20 only) - name: ARM64 Clang/libc++ @@ -101,7 +106,7 @@ os: ${{ matrix.config.os || 'ubuntu-24.04' }} toolchain: ${{ matrix.config.toolchain }} remote_config: ${{ matrix.config.remote_config || 'remote' }} - container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:5a19067585ce5e5ee45640fd0287f05038d6b3f9574d6a5cdf08241e022d0f4a' }} + container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:68307cff12d635717ea9657a4bc1fb4010a133c992765719e1be8bff5c32791c' }} alternate_options: ${{ matrix.config.alternate_options || false }} stds: ${{ matrix.config.stds || '["c++17", "c++20", "c++23"]' }} compilation_modes: ${{ matrix.config.compilation_modes || '["opt", "fastbuild"]' }} @@ -115,7 +120,7 @@ # linux_gcc-latest_libstdcxx_cxx17_cmake.cfg - name: Linux GCC/libstdc++ os: ubuntu-24.04 - container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6 + container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:baf2ddeb69d46e02babed92ff753e1e83149d23493561aaa6d4375a9432bb8f5 # linux_gcc_alpine_cmake.cfg - name: Alpine Linux GCC (musl) os: ubuntu-24.04 @@ -125,7 +130,7 @@ # cmake-install.cfg - name: Linux Install os: ubuntu-24.04 - container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6 + container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:baf2ddeb69d46e02babed92ff753e1e83149d23493561aaa6d4375a9432bb8f5 build_types: '["Release"]' link_modes: '["static", "shared"]' install_test: true
diff --git a/absl/base/attributes.h b/absl/base/attributes.h index bc080bc..139f2de 100644 --- a/absl/base/attributes.h +++ b/absl/base/attributes.h
@@ -1149,7 +1149,7 @@ // // Note: When wrapping a multi-line statement, placing a semicolon after the // closing parenthesis may produce an extra semicolon warning. -#if defined(__clang__) +#if defined(__clang__) && ABSL_HAVE_ATTRIBUTE(unsafe_buffer_usage) #define ABSL_UNSAFE_BUFFERS(...) \ _Pragma("clang unsafe_buffer_usage begin") \ __VA_ARGS__ _Pragma("clang unsafe_buffer_usage end")
diff --git a/ci/BUILD.bazel b/ci/BUILD.bazel index c83d079..d73f4b3 100644 --- a/ci/BUILD.bazel +++ b/ci/BUILD.bazel
@@ -23,7 +23,7 @@ exec_properties = { "OSArch": "amd64", "cache-silo-key": "n2-highcpu-2-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:baf2ddeb69d46e02babed92ff753e1e83149d23493561aaa6d4375a9432bb8f5", "dockerRunAsRoot": "true", }, ) @@ -37,7 +37,7 @@ exec_properties = { "OSArch": "amd64", "cache-silo-key": "n2-highcpu-2-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:60898eb3b0dbcf85cd60e346f103fbf3169d966d391dcb2362b243d528b1183b", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:9140cccbd8485a6b4f5ec81fda5739d409c6c4677d034f1023681613b52737f3", "dockerRunAsRoot": "true", }, ) @@ -51,7 +51,7 @@ exec_properties = { "OSArch": "arm64", "cache-silo-key": "t2a-standard-4-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:baf2ddeb69d46e02babed92ff753e1e83149d23493561aaa6d4375a9432bb8f5", "dockerRunAsRoot": "true", }, )