Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeAOT: remove some headers that are not needed #77042

Merged
merged 2 commits into from
Oct 17, 2022
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
20 changes: 0 additions & 20 deletions src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@
#include <lwp.h>
#endif

#if HAVE_SYS_VMPARAM_H
#include <sys/vmparam.h>
#endif // HAVE_SYS_VMPARAM_H

#if HAVE_MACH_VM_TYPES_H
#include <mach/vm_types.h>
#endif // HAVE_MACH_VM_TYPES_H

#if HAVE_MACH_VM_PARAM_H
#include <mach/vm_param.h>
#endif // HAVE_MACH_VM_PARAM_H

#ifdef __APPLE__
#include <mach/vm_statistics.h>
#include <mach/mach_types.h>
#include <mach/mach_init.h>
#include <mach/mach_host.h>
#include <mach/mach_port.h>
#endif // __APPLE__

#if HAVE_CLOCK_GETTIME_NSEC_NP
#include <time.h>
#endif
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/nativeaot/Runtime/unix/config.h.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef _PAL_CONFIG_H_INCLUDED
#define _PAL_CONFIG_H_INCLUDED 1

#cmakedefine01 HAVE_SYS_VMPARAM_H
#cmakedefine01 HAVE_MACH_VM_TYPES_H
#cmakedefine01 HAVE_MACH_VM_PARAM_H
#cmakedefine01 HAVE_AUXV_HWCAP_H

#cmakedefine01 HAVE_PTHREAD_ATTR_GET_NP
Expand All @@ -18,7 +15,6 @@
#cmakedefine01 HAVE___GREGSET_T

#cmakedefine01 HAVE_SIGINFO_T
#cmakedefine01 HAVE_UCONTEXT_T

#cmakedefine01 HAVE_LWP_SELF
#cmakedefine01 HAVE_SCHED_GETCPU
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/nativeaot/Runtime/unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ endif()

list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64)

check_include_files(sys/vmparam.h HAVE_SYS_VMPARAM_H)
check_include_files(mach/vm_types.h HAVE_MACH_VM_TYPES_H)
check_include_files(mach/vm_param.h HAVE_MACH_VM_PARAM_H)
Copy link
Member

@am11 am11 Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAVE_PTHREAD_ATTR_GET_NP and HAVE_UCONTEXT_T are also unused.

Copy link
Member Author

@akoeplinger akoeplinger Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAVE_PTHREAD_ATTR_GET_NP is used here https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp#L1116

I don't actually see where HAVE_UCONTEXT_T is being defined, but it is set to 1 somehow.

Copy link
Member

@am11 am11 Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAVE_UCONTEXT_T is in config.h.in and check_type_size(ucontext_t UCONTEXT_T) in this file, which can be deleted.

Yes, HAVE_PTHREAD_ATTR_GET_NP is in use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

check_include_files("sys/auxv.h;asm/hwcap.h" HAVE_AUXV_HWCAP_H)

check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
Expand All @@ -44,8 +41,6 @@ set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_EXTRA_INCLUDE_FILES signal.h)
check_type_size(siginfo_t SIGINFO_T)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_EXTRA_INCLUDE_FILES ucontext.h)
check_type_size(ucontext_t UCONTEXT_T)

check_cxx_source_compiles("
#include <lwp.h>
Expand Down