[libc-commits] [libc] [llvm] [libc] Allow each function can have extra attributes by defining LLVM_LIBC_FUNCTION_ATTR_func macro. (PR #116160)
Alexey Samsonov via libc-commits
libc-commits at lists.llvm.org
Wed Nov 20 09:25:14 PST 2024
================
@@ -108,16 +108,23 @@ def libc_function(
name = libc_internal_target(name),
srcs = srcs,
copts = copts,
+ local_defines = local_defines,
**kwargs
)
# This second target is the llvm libc C function with either a default or hidden visibility.
# All other functions are hidden.
- func_attrs = ["__attribute__((visibility(\"default\")))"]
- if weak:
- func_attrs = func_attrs + ["__attribute__((weak))"]
- local_defines = local_defines or ["LIBC_COPT_PUBLIC_PACKAGING"]
- local_defines = local_defines + ["LLVM_LIBC_FUNCTION_ATTR='%s'" % " ".join(func_attrs)]
+ global_func_attrs = [
----------------
vonosmas wrote:
Remove temp variable for clarity - you can just use `LLVM_LIBC_FUNCTION_ATTR='[[gnu:visibility(\"default\")]]'` below instead.
https://github.com/llvm/llvm-project/pull/116160
More information about the libc-commits
mailing list