CI/CQ: Test clang shared library builds on Linux

To catch compile issues that may occur in e.g. Chromium's
component build.

Bug: 549361069
Change-Id: I137310219922a6db07b401d3167d78fe6a6a6964
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/101487
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg
index 8b1bb94..f141492 100644
--- a/infra/config/generated/commit-queue.cfg
+++ b/infra/config/generated/commit-queue.cfg
@@ -158,6 +158,14 @@
         includable_only: true
       }
       builders {
+        name: "boringssl/try/linux_clang_shared_compile"
+        includable_only: true
+      }
+      builders {
+        name: "boringssl/try/linux_clang_shared_rel_compile"
+        includable_only: true
+      }
+      builders {
         name: "boringssl/try/linux_clang_ubsan"
       }
       builders {
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg
index 5cf1b62..facf183 100644
--- a/infra/config/generated/cr-buildbucket.cfg
+++ b/infra/config/generated/cr-buildbucket.cfg
@@ -3188,6 +3188,48 @@
       service_account: "boringssl-try-builder@chops-service-accounts.iam.gserviceaccount.com"
     }
     builders {
+      name: "linux_clang_shared_compile"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Ubuntu-24.04"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "boringssl"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/main"
+        properties_j: "check_prefixed_symbols:true"
+        properties_j: "clang:true"
+        properties_j: "cmake_args:{\"BUILD_SHARED_LIBS\":\"1\"}"
+        properties_j: "prefixed_symbols:true"
+        properties_j: "run_ssl_tests:false"
+        properties_j: "run_unit_tests:false"
+        properties_j: "upload_to_cas:[\"*_bench\",\"*_test\",\"bssl\",\"generate_*\",\"jitter_deltas\",\"ssl/test/bssl_shim\",\"test_*\",\"**/lib*.so*\"]"
+      }
+      execution_timeout_secs: 1800
+      service_account: "boringssl-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+    builders {
+      name: "linux_clang_shared_rel_compile"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Ubuntu-24.04"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "boringssl"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/main"
+        properties_j: "check_prefixed_symbols:true"
+        properties_j: "clang:true"
+        properties_j: "cmake_args:{\"BUILD_SHARED_LIBS\":\"1\",\"CMAKE_BUILD_TYPE\":\"Release\"}"
+        properties_j: "prefixed_symbols:true"
+        properties_j: "run_ssl_tests:false"
+        properties_j: "run_unit_tests:false"
+        properties_j: "upload_to_cas:[\"*_bench\",\"*_test\",\"bssl\",\"generate_*\",\"jitter_deltas\",\"ssl/test/bssl_shim\",\"test_*\",\"**/lib*.so*\"]"
+      }
+      execution_timeout_secs: 1800
+      service_account: "boringssl-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+    builders {
       name: "linux_clang_ubsan"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
diff --git a/infra/config/generated/project.cfg b/infra/config/generated/project.cfg
index a7f0869..dbaefec 100644
--- a/infra/config/generated/project.cfg
+++ b/infra/config/generated/project.cfg
@@ -7,7 +7,7 @@
 name: "boringssl"
 access: "group:all"
 lucicfg {
-  version: "1.46.3"
+  version: "1.46.6"
   package_dir: ".."
   config_dir: "generated"
   entry_point: "main.star"
diff --git a/infra/config/main.star b/infra/config/main.star
index 80f84e9..b943e60 100755
--- a/infra/config/main.star
+++ b/infra/config/main.star
@@ -1243,6 +1243,39 @@
         "upload_to_cas": FINISHED_OUTPUT_FILES_LINUX_STATIC,
     }),
 )
+# TODO(crbug.com/549361069): Promote to both_builders.
+cq_builder(
+    "linux_clang_shared_compile",
+    LINUX_HOST,
+    # TODO(crbug.com/549361069): Enable on CQ.
+    cq_enabled = False,
+    properties = compile_only({
+        "cmake_args": {
+            "BUILD_SHARED_LIBS": "1",
+        },
+        "clang": True,
+        "prefixed_symbols": True,
+        "check_prefixed_symbols": True,
+        "upload_to_cas": FINISHED_OUTPUT_FILES_LINUX_SHARED,
+    }),
+)
+# TODO(crbug.com/549361069): Promote to both_builders.
+cq_builder(
+    "linux_clang_shared_rel_compile",
+    LINUX_HOST,
+    # TODO(crbug.com/549361069): Enable on CQ.
+    cq_enabled = False,
+    properties = compile_only({
+        "cmake_args": {
+            "BUILD_SHARED_LIBS": "1",
+            "CMAKE_BUILD_TYPE": "Release",
+        },
+        "clang": True,
+        "prefixed_symbols": True,
+        "check_prefixed_symbols": True,
+        "upload_to_cas": FINISHED_OUTPUT_FILES_LINUX_SHARED,
+    }),
+)
 
 both_builders(
     "linux_nothreads",