Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc/config/linux/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.ctype.toupper

# dlfcn.h entrypoints
libc.src.dlfcn.dladdr
libc.src.dlfcn.dlclose
libc.src.dlfcn.dlerror
libc.src.dlfcn.dlopen
Expand Down
9 changes: 9 additions & 0 deletions libc/hdr/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,12 @@ add_proxy_header_library(
libc.include.llvm-libc-types.struct_sched_param
libc.include.sched
)

add_proxy_header_library(
dl_info
HDRS
dl_info.h
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.dl_info
libc.include.dlfcn
)
21 changes: 21 additions & 0 deletions libc/hdr/types/dl_info.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===-- Proxy for struct timespec ----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_HDR_TYPES_DLINFO_H
#define LLVM_LIBC_HDR_TYPES_DLINFO_H

#ifdef LIBC_FULL_BUILD

#include "include/llvm-libc-types/Dl_info.h"

#else

#include <dlfcn.h>

#endif // LIBC_FULL_BUILD

#endif // LLVM_LIBC_HDR_TYPES_STRUCT_TIMESPEC_H
1 change: 1 addition & 0 deletions libc/src/dlfcn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ add_entrypoint_object(
dladdr.h
DEPENDS
libc.include.dlfcn
libc.hdr.types.dl_info
)
3 changes: 2 additions & 1 deletion libc/src/dlfcn/dladdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ namespace LIBC_NAMESPACE_DECL {

// TODO: https:// github.com/llvm/llvm-project/issues/97929
LLVM_LIBC_FUNCTION(int, dladdr,
(const void *__restrict addr, Dl_info *__restrict info)) {
([[maybe_unused]] const void *__restrict addr,
[[maybe_unused]] Dl_info *__restrict info)) {
return -1;
}

Expand Down
2 changes: 2 additions & 0 deletions libc/src/dlfcn/dladdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "src/__support/macros/config.h"

#include "hdr/types/dl_info.h"

namespace LIBC_NAMESPACE_DECL {

int dladdr(const void *__restrict, Dl_info *__restrict);
Expand Down
Loading