[llvm] [libc][bazel] Add copts to libc_support_library (PR #73591)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 15:55:57 PST 2023


https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/73591

Most libc_support_library calls are for header-only libraries, but there
are a few that have .cpp files. This patch adds the same base copts to
these that libc_function already has.


>From a02ff0b3a7f0c4ee200cd8682fb2edde6fe833ab Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Mon, 27 Nov 2023 15:53:15 -0800
Subject: [PATCH] [libc][bazel] Add copts to libc_support_library

Most libc_support_library calls are for header-only libraries, but there
are a few that have .cpp files. This patch adds the same base copts to
these that libc_function already has.
---
 utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
index 0c63bdb96333726..011f944311c281d 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -47,8 +47,10 @@ def _libc_library(name, hidden, copts = [], deps = [], **kwargs):
 # A convenience function which should be used to list all libc support libraries.
 # Any library which does not define a public function should be listed with
 # libc_support_library.
-def libc_support_library(name, **kwargs):
-    _libc_library(name = name, hidden = False, **kwargs)
+def libc_support_library(name, copts = None, **kwargs):
+    copts = copts or []
+    copts = copts + ["-O3", "-fno-builtin", "-fno-lax-vector-conversions"]
+    _libc_library(name = name, copts = copts, hidden = False, **kwargs)
 
 def libc_function(
         name,



More information about the llvm-commits mailing list