Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 43 additions & 16 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ RUN git clone --recurse-submodules --depth 1 --branch v2.10.16 https://github.co
patch -d /azure/cpprestsdk/ -p1 < /ovms/third_party/cpprest/rest_sdk_v2.10.16.patch && \
patch -d /azure/azure-storage-cpp/ -p1 </ovms/third_party/azure/azure_sdk.patch

ARG SDL_OPS="-Wl,-z,relro,-z,now,-z,noexecstack -Wall -Wextra -Wimplicit-fallthrough -fPIE -pie -fstack-protector-strong -fexceptions -fasynchronous-unwind-tables -fcf-protection -fpic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -Wall -Wno-unknown-pragmas -Wno-error=sign-compare -fno-delete-null-pointer-checks -fwrapv -fstack-clash-protection -Wformat -Wformat-security -Werror=format-security -s -D_GLIBCXX_USE_CXX11_ABI=1 -Wuninitialized"
# Control-flow protection flag: -fcf-protection on x86_64, -mbranch-protection on ARM
ARG CF_PROTECTION=-fcf-protection
ARG SDL_OPS="-Wl,-z,relro,-z,now,-z,noexecstack -Wall -Wextra -Wimplicit-fallthrough -fPIE -pie -fstack-protector-strong -fexceptions -fasynchronous-unwind-tables ${CF_PROTECTION} -fpic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -Wall -Wno-unknown-pragmas -Wno-error=sign-compare -fno-delete-null-pointer-checks -fwrapv -fstack-clash-protection -Wformat -Wformat-security -Werror=format-security -s -D_GLIBCXX_USE_CXX11_ABI=1 -Wuninitialized"
WORKDIR /azure/cpprestsdk/Release/build.release
RUN cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_FLAGS="${SDL_OPS}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DBoost_USE_STATIC_LIBS=ON -DWERROR=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF && make --jobs=$JOBS install

Expand Down Expand Up @@ -145,19 +147,33 @@ ARG CMAKE_BUILD_TYPE=Release
ENV HDDL_INSTALL_DIR=/opt/intel/openvino/deployment_tools/inference_engine/external/hddl
ENV TF_SYSTEM_LIBS="curl"

# Target CPU architecture. Defaults to amd64 to preserve x86_64 behavior; the
# Makefile passes arm64 (and OV_LIBDIR=aarch64) for experimental ARM builds.
ARG TARGETARCH=amd64
# OpenVINO runtime library subdir: intel64 on x86_64, aarch64 on ARM.
ARG OV_LIBDIR=intel64

# Set up Bazel
ENV BAZEL_VERSION 6.1.1
WORKDIR /bazel
RUN curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
chmod +x bazel-*.sh && \
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
# x86_64 uses the self-extracting installer; arm64 ships only a standalone binary.
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-arm64 && \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
chmod +x /usr/local/bin/bazel ; \
else \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
chmod +x bazel-*.sh && \
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh ; \
fi

ENV TEST_LOG="/root/.cache/bazel/_bazel_root/bc57d4817a53cab8c785464da57d1983/execroot/ovms/bazel-out/test.log"

################### BUILD OPENVINO FROM SOURCE - buildarg ov_use_binary=0 ############################
ARG SDL_OPS="-Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie -fstack-protector-strong -fexceptions -fasynchronous-unwind-tables -fcf-protection -fpic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -Wno-unknown-pragmas -Wno-error=sign-compare -fno-delete-null-pointer-checks -fwrapv -fstack-clash-protection -Wformat -Wformat-security -s -D_GLIBCXX_USE_CXX11_ABI=1 -Wuninitialized"
ARG CF_PROTECTION=-fcf-protection
ARG SDL_OPS="-Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie -fstack-protector-strong -fexceptions -fasynchronous-unwind-tables ${CF_PROTECTION} -fpic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -Wno-unknown-pragmas -Wno-error=sign-compare -fno-delete-null-pointer-checks -fwrapv -fstack-clash-protection -Wformat -Wformat-security -s -D_GLIBCXX_USE_CXX11_ABI=1 -Wuninitialized"
# hadolint ignore=DL3003
RUN if [ "$ov_use_binary" == "0" ] ; then true ; else exit 0 ; fi ; git clone https://github.com/$ov_source_org/openvino.git /openvino && cd /openvino && git checkout $ov_source_branch && git submodule update --init --recursive
WORKDIR /openvino/build
Expand All @@ -175,7 +191,7 @@ RUN if [ "$ov_use_binary" == "0" ] ; then true ; else exit 0 ; fi ; \
ln -s /usr/local/runtime /opt/intel/openvino && \
ln -s /openvino/scripts/setupvars/setupvars.sh /opt/intel/openvino/setupvars.sh && \
ln -s /opt/intel/openvino /opt/intel/openvino_2026
RUN if [ "$ov_use_binary" == "0" ]; then true ; else exit 0 ; fi ; if ! [[ $debug_bazel_flags == *"py_off"* ]]; then true ; else exit 0 ; fi ; mkdir -p /opt/intel/openvino && cp -r /openvino/bin/intel64/${CMAKE_BUILD_TYPE}/python /opt/intel/openvino/
RUN if [ "$ov_use_binary" == "0" ]; then true ; else exit 0 ; fi ; if ! [[ $debug_bazel_flags == *"py_off"* ]]; then true ; else exit 0 ; fi ; mkdir -p /opt/intel/openvino && cp -r /openvino/bin/${OV_LIBDIR}/${CMAKE_BUILD_TYPE}/python /opt/intel/openvino/
RUN if [ "$ov_use_binary" == "0" ]; then true ; else exit 0 ; fi ; if ! [[ $debug_bazel_flags == *"py_off"* ]]; then true ; else exit 0 ; fi ; cp -r /openvino/tools/ovc/* /opt/intel/openvino/python

################## END OF OPENVINO SOURCE BUILD ######################
Expand All @@ -200,7 +216,7 @@ RUN if [ -f /opt/intel/openvino/samples/cpp/build_samples.sh ]; then /opt/intel

# OpenVINO Tokenizers extension
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
ENV OPENVINO_TOKENIZERS_PATH_GENAI=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
ENV OPENVINO_TOKENIZERS_PATH_GENAI=/opt/intel/openvino/runtime/lib/${OV_LIBDIR}/libopenvino_tokenizers.so

WORKDIR /openvino_tokenizers/
ARG ov_tokenizers_branch=master
Expand All @@ -219,7 +235,7 @@ RUN if ! [[ $debug_bazel_flags == *"_py_off"* ]]; then \
fi
# hadolint ignore=DL3003
RUN if [ "$ov_use_binary" == "0" ]; then true ; else exit 0 ; fi ; \
cd /openvino_tokenizers && cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS=" ${SDL_OPS} " -S ./ -B ./build/ && cmake --build ./build/ --parallel $JOBS && cp /openvino_tokenizers/build/src/lib*.so /opt/intel/openvino/runtime/lib/intel64/ && \
cd /openvino_tokenizers && cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS=" ${SDL_OPS} " -S ./ -B ./build/ && cmake --build ./build/ --parallel $JOBS && cp /openvino_tokenizers/build/src/lib*.so /opt/intel/openvino/runtime/lib/${OV_LIBDIR}/ && \
if ! [[ $debug_bazel_flags == *"_py_off"* ]]; then \
cp build/python/* /opt/intel/openvino/python/openvino_tokenizers/ ; \
fi
Expand All @@ -230,7 +246,7 @@ WORKDIR /openvino_genai/
RUN if [ "$ov_use_binary" == "0" ]; then \
git clone https://github.com/$ov_genai_org/openvino.genai /openvino_genai && cd /openvino_genai && git checkout $ov_genai_branch && git submodule update --init --recursive && \
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS=" ${SDL_OPS} " -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DENABLE_SYSTEM_ICU="True" -DBUILD_TOKENIZERS=OFF -DENABLE_SAMPLES=OFF -DENABLE_TOOLS=OFF -DENABLE_TESTS=OFF -DENABLE_XGRAMMAR=ON -S ./ -B ./build/ && \
cmake --build ./build/ --parallel $JOBS && cp /openvino_genai/build/openvino_genai/lib*.so* /opt/intel/openvino/runtime/lib/intel64/ && \
cmake --build ./build/ --parallel $JOBS && cp /openvino_genai/build/openvino_genai/lib*.so* /opt/intel/openvino/runtime/lib/${OV_LIBDIR}/ && \
cp -r /openvino_genai/src/cpp/include/* /opt/intel/openvino/runtime/include/ && \
cp /openvino_genai/build/src/cpp/openvino/genai/version.hpp /opt/intel/openvino/runtime/include/openvino/genai/ && \
if ! [[ $debug_bazel_flags == *"py_off"* ]]; then \
Expand All @@ -239,16 +255,26 @@ RUN if [ "$ov_use_binary" == "0" ]; then \
fi

# Add Nvidia dev tool if needed
# intel-opencl-icd (the Intel GPU OpenCL runtime) is published for x86_64 only;
# on aarch64 there is no Intel GPU, so install just the generic OpenCL headers.
RUN apt-get update ; \
apt-get install -y --no-install-recommends opencl-clhpp-headers opencl-c-headers intel-opencl-icd && \
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
apt-get install -y --no-install-recommends opencl-clhpp-headers opencl-c-headers ; \
else \
apt-get install -y --no-install-recommends opencl-clhpp-headers opencl-c-headers intel-opencl-icd ; \
fi && \
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* ;
# hadolint ignore=DL3003

WORKDIR /ovms
# GPU testing in build img
COPY ./install_ubuntu_gpu_drivers.sh /tmp/install_gpu_drivers.sh
ARG INSTALL_DRIVER_VERSION="23.22.26516"
RUN /tmp/install_gpu_drivers.sh && \
# The Intel GPU compute-runtime packages are x86_64-only (*_amd64.deb); there is
# no Intel GPU on aarch64, so skip the GPU driver install for the CPU-only ARM build.
RUN if [ "$TARGETARCH" != "arm64" ] && [ "$TARGETARCH" != "aarch64" ]; then \
/tmp/install_gpu_drivers.sh ; \
fi && \
groupadd --gid 5000 ovms && \
useradd --home-dir /home/ovms --create-home --uid 5000 --gid 5000 --groups 39,44 --shell /bin/bash --skel /dev/null ovms
# GPU testing in build img
Expand All @@ -261,7 +287,7 @@ COPY src/BUILD /ovms/src/BUILD
COPY src/python/binding/BUILD /ovms/src/python/binding/BUILD
COPY src/python/binding/tests/requirements.txt /ovms/src/python/binding/tests/requirements.txt

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/intel/openvino/runtime/lib/intel64/:/opt/opencv/lib/:/opt/intel/openvino/runtime/3rdparty/tbb/lib
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/intel/openvino/runtime/lib/${OV_LIBDIR}/:/opt/opencv/lib/:/opt/intel/openvino/runtime/3rdparty/tbb/lib

# FROM BASE BUILD
COPY --from=base_build /opt/opencv /opt/opencv/
Expand Down Expand Up @@ -372,8 +398,9 @@ RUN if [ "$FUZZER_BUILD" == "0" ]; then bazel build ${CAPI_FLAGS} --jobs $JOBS /
COPY MakefileCapi /ovms/
RUN if [ "$FUZZER_BUILD" == "0" ]; then CAPI_FLAGS=${CAPI_FLAGS} make -f MakefileCapi cpp && \
CAPI_FLAGS=${CAPI_FLAGS} make -f MakefileCapi c; fi ;
RUN mkdir -p /ovms_release/lib/ ; find /ovms/bazel-out/k8-*/bin -iname 'libovms_shared.so' -exec cp -v {} /ovms_release/lib/ \; \
&& find /ovms/bazel-out/k8-*/bin -iname 'libgit2.so' -exec cp -v {} /ovms_release/lib/ \;
# bazel-out config dir is k8-* on x86_64 and aarch64-* on ARM; glob both.
RUN mkdir -p /ovms_release/lib/ ; find /ovms/bazel-out/*/bin -iname 'libovms_shared.so' -exec cp -v {} /ovms_release/lib/ \; \
&& find /ovms/bazel-out/*/bin -iname 'libgit2.so' -exec cp -v {} /ovms_release/lib/ \;

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #

Expand Down
44 changes: 37 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ JOBS ?= $(CORES_TOTAL)
# Currently supported BASE_OS values are: ubuntu24 ubuntu22 redhat
BASE_OS ?= ubuntu24

# Target CPU architecture for the docker build. Default amd64 (x86_64) preserves
# existing behavior exactly. Set TARGETARCH=arm64 for experimental aarch64 builds.
# When left at the amd64 default, PLATFORM_OPTION is empty so the docker build
# command line is unchanged from before.
TARGETARCH ?= amd64
ifeq ($(TARGETARCH),amd64)
PLATFORM_OPTION =
# OpenVINO runtime library subdir is intel64 on x86_64
OV_LIBDIR ?= intel64
# Intel CET control-flow protection is x86-only
CF_PROTECTION ?= -fcf-protection
else
PLATFORM_OPTION = --platform linux/$(TARGETARCH)
# aarch64 OpenVINO packages place runtime libs under lib/aarch64
OV_LIBDIR ?= aarch64
# ARM equivalent of -fcf-protection
CF_PROTECTION ?= -mbranch-protection=standard
endif

# do not change this; change versions per OS a few lines below (BASE_OS_TAG_*)!
BASE_OS_TAG ?= latest

Expand All @@ -72,6 +91,10 @@ endif
endif
FUZZER_BUILD ?= 0
DOCKER_BUILDKIT ?= 1
# Optional extra flags for the build-stage `docker buildx build` (e.g. registry/gha
# layer cache: --cache-from/--cache-to). Empty by default so normal builds are
# unaffected; the ARM CI sets this together with BUILDX=buildx.
DOCKER_CACHE_OPTION ?=
KONFLUX ?= 0
# NOTE: when changing any value below, you'll need to adjust WORKSPACE file by hand:
# - uncomment source build section, comment binary section
Expand Down Expand Up @@ -245,6 +268,9 @@ BUILD_ARGS = --build-arg http_proxy=$(HTTP_PROXY)\
--build-arg CAPI_FLAGS=$(CAPI_FLAGS)\
--build-arg VERBOSE_LOGS=$(VERBOSE_LOGS)\
--build-arg KONFLUX=$(KONFLUX)\
--build-arg TARGETARCH=$(TARGETARCH)\
--build-arg OV_LIBDIR=$(OV_LIBDIR)\
--build-arg CF_PROTECTION=$(CF_PROTECTION)\
--build-arg ESPEAK=$(ESPEAK)


Expand Down Expand Up @@ -374,13 +400,13 @@ else
@touch .workspace/metadata.json
endif
@cat .workspace/metadata.json
docker $(BUILDX) build $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
docker $(BUILDX) build $(PLATFORM_OPTION) $(NO_CACHE_OPTION) $(DOCKER_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
-t $(OVMS_CPP_DOCKER_IMAGE)-build:$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX) \
--target=build

targz_package:
docker $(BUILDX) build -f Dockerfile.$(DIST_OS) . \
docker $(BUILDX) build $(PLATFORM_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
--build-arg BUILD_IMAGE=$(BUILD_IMAGE) \
-t $(OVMS_CPP_DOCKER_IMAGE)-pkg:$(OVMS_CPP_IMAGE_TAG) \
Expand All @@ -389,7 +415,7 @@ targz_package:
ID=$$(docker create $(OVMS_CPP_DOCKER_IMAGE)-pkg:$(OVMS_CPP_IMAGE_TAG)) && \
docker cp $$ID:/ovms_pkg/$(OS)/ovms.tar dist/$(OS)/ && \
docker rm $$ID
docker $(BUILDX) build -f Dockerfile.$(DIST_OS) . \
docker $(BUILDX) build $(PLATFORM_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
--build-arg BUILD_IMAGE=$(BUILD_IMAGE) \
-t $(OVMS_CPP_DOCKER_IMAGE)-capi:$(OVMS_CPP_IMAGE_TAG) \
Expand All @@ -409,17 +435,21 @@ ifeq ($(BASE_OS),redhat)
else
$(eval NPU:=1)
endif
docker $(BUILDX) build $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
docker $(BUILDX) build $(PLATFORM_OPTION) $(NO_CACHE_OPTION) $(DOCKER_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
-t $(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX) \
--target=release && \
docker $(BUILDX) build $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
--target=release
# The GPU image variant pulls in the x86_64-only Intel GPU/NPU runtime drivers,
# so it is only built on amd64; aarch64 ships the CPU-only release image.
ifeq ($(TARGETARCH),amd64)
docker $(BUILDX) build $(PLATFORM_OPTION) $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
--build-arg GPU=1 \
--build-arg NPU=$(NPU) \
-t $(OVMS_CPP_DOCKER_IMAGE)-gpu:$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX) \
--target=release && \
docker tag $(OVMS_CPP_DOCKER_IMAGE)-gpu:$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX) $(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)-gpu$(IMAGE_TAG_SUFFIX)
endif
ifeq ($(BUILD_NGINX), 1)
cd extras/nginx-mtls-auth && \
http_proxy=$(HTTP_PROXY) https_proxy=$(HTTPS_PROXY) no_proxy=$(NO_PROXY) ./build.sh "$(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX)" "$(OVMS_CPP_DOCKER_IMAGE)-nginx-mtls:$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX)" "$(DIST_OS)" && \
Expand Down Expand Up @@ -451,7 +481,7 @@ ifeq ($(BASE_OS),redhat)
endif

release_image:
docker $(BUILDX) build $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
docker $(BUILDX) build $(PLATFORM_OPTION) $(NO_CACHE_OPTION) -f Dockerfile.$(DIST_OS) . \
$(BUILD_ARGS) \
--build-arg BUILD_IMAGE=$(BUILD_IMAGE) \
--build-arg GPU=$(GPU) \
Expand Down
10 changes: 9 additions & 1 deletion common_settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ LINUX_COMMON_STATIC_LIBS_COPTS = [
"-Wno-deprecated-declarations",
"-Werror",
"-Wimplicit-fallthrough",
"-fcf-protection=full",
"-Wformat",
"-Wformat-security",
"-Werror=format-security",
Expand Down Expand Up @@ -198,6 +197,15 @@ WINDOWS_COMMON_STATIC_LIBS_COPTS = [
COMMON_STATIC_LIBS_COPTS = select({
"//conditions:default": LINUX_COMMON_STATIC_LIBS_COPTS,
"//src:windows" : WINDOWS_COMMON_STATIC_LIBS_COPTS,
}) + select({
# Control-flow protection: Intel CET (-fcf-protection) is x86-only;
# aarch64 uses branch-target identification / PAC via -mbranch-protection.
# Windows supplies /guard:cf in its own list, so it gets no flag here.
# Kept as a separate top-level select (not nested in the list above) because
# Starlark forbids a select whose values are themselves selects.
"//src:windows": [],
"@platforms//cpu:aarch64": ["-mbranch-protection=standard"],
"//conditions:default": ["-fcf-protection=full"],
})

COMMON_STATIC_TEST_COPTS = select({
Expand Down
Loading