| # Copyright 2025 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("//build/test.gni") |
| import("../libc.gni") |
| |
| llvm_libc_source_set("dlfcn") { |
| # Currently llvm-libc has per-function headers and (stub) implementations but |
| # no corresponding tests. If llvm-libc adds test/src/dlfcn/*_test.cpp files |
| # then they can be used (by listing the functions here). But they would all |
| # be classed as os_functions anyway. |
| functions = [] |
| } |
| |
| source_set("dlfcn-abi") { |
| public = [ "dlfcn-abi.h" ] |
| public_deps = [ |
| "..:weak", |
| "//sdk/lib/ld:headers", |
| ] |
| } |
| |
| source_set("dl_phdr_info") { |
| public = [ "dl_phdr_info.h" ] |
| public_configs = [ ":dl_phdr_info.config" ] |
| } |
| |
| config("dl_phdr_info.config") { |
| visibility = [ ":dl_phdr_info" ] |
| |
| # This really needs to be ordered before any other headers that might reach |
| # either <lib/ld/abi.h> or <link.h> even transitively. So just actually poke |
| # it in first so that the explicit `#include` lines will just be redundant |
| # (but still get references properly checked by GN for proper deps). |
| inputs = [ "dl_phdr_info.h" ] |
| cflags = [ |
| "-include", |
| rebase_path(inputs[0], root_build_dir), |
| ] |
| } |
| |
| # This never needs to go into a boot test, so it can use gtest. It's defined |
| # as a libc_test() target for LIBC_NAMESPACE et al, though it doesn't go into |
| # the :unittests target. |
| libc_test("abi-tests") { |
| visibility = [ ":dlfcn-abi-tests" ] |
| sources = [] |
| gtest = true |
| deps = [ |
| ":dlfcn-abi", |
| "..:asm-linkage", |
| ] |
| } |
| |
| # This becomes its own test component in ../test/BUILD.gn but the component |
| # can't be defined here and still go into the libc-tests package. |
| test("dlfcn-abi-tests") { |
| deps = [ |
| ":abi-tests", |
| "../link:dlfcn-abi-tests", |
| ] |
| assert_no_deps = [ "//zircon/system/ulib/zxtest/*" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "dl:tests" ] |
| } |