| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("../libc.gni") |
| |
| llvm_libc_group("stdlib") { |
| deps = [ ":generic" ] |
| if (is_fuchsia) { |
| deps += [ ":exit" ] |
| } |
| } |
| |
| llvm_libc_source_set("generic") { |
| functions = [ |
| "abs", |
| "atoi", |
| "atol", |
| "atoll", |
| "bsearch", |
| "div", |
| "labs", |
| "ldiv", |
| "llabs", |
| "lldiv", |
| "strtol", |
| "strtoll", |
| "strtoul", |
| "strtoull", |
| ] |
| |
| no_test_functions = [ "qsort" ] |
| test_sources = [ "quick_sort_test.cpp" ] |
| |
| deps = [ ":abort" ] |
| |
| functions += no_test_functions |
| } |
| |
| llvm_libc_source_set("abort") { |
| functions = [ "abort" ] |
| os_functions = functions |
| local_deps = [ "//zircon/system/ulib/zircon-internal" ] |
| } |
| |
| if (is_fuchsia) { |
| llvm_libc_source_set("exit") { |
| functions = [ "exit" ] |
| os_functions = functions |
| no_test_functions = functions |
| local_deps = [ |
| "..:weak", |
| "//src/zircon/lib/zircon", |
| "//zircon/third_party/ulib/musl:musl_internal", |
| ] |
| |
| deps = [ ":_Exit" ] |
| } |
| |
| llvm_libc_source_set("_Exit") { |
| functions = [ "_Exit" ] |
| os_functions = functions |
| no_test_functions = functions |
| local_deps = [ "//src/zircon/lib/zircon" ] |
| } |
| } |
| |
| # This provides an archive library of the universally safe stdlib functions. |
| # When built outside the "user.libc" environment, these always define only |
| # hidden-visibility symbols and should be safe in any build environment. |
| static_library("hermetic") { |
| complete_static_lib = true |
| deps = [ ":generic" ] |
| } |