Skip to content

Commit

Permalink
[libc] Revert #73704 and subsequent fixes #73984, #74026 (#74355)
Browse files Browse the repository at this point in the history
The test cases of mincore require getting correct page size from OS. As
`sysconf` is not functioning correctly, these patches are implemented in
a somewhat confusing way. We revert such patches and will reintroduce
mincore after we correct sysconf.

This reverts 54878b8, 985c0d1 and 418a3a4.
  • Loading branch information
SchrodingerZhu committed Dec 4, 2023
1 parent 53d498d commit ff51b60
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 227 deletions.
1 change: 0 additions & 1 deletion libc/config/linux/aarch64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.mman.mprotect
libc.src.sys.mman.munmap
libc.src.sys.mman.posix_madvise
libc.src.sys.mman.mincore

# sys/random.h entrypoints
libc.src.sys.random.getrandom
Expand Down
1 change: 0 additions & 1 deletion libc/config/linux/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.mman.mprotect
libc.src.sys.mman.munmap
libc.src.sys.mman.posix_madvise
libc.src.sys.mman.mincore

# sys/random.h entrypoints
libc.src.sys.random.getrandom
Expand Down
1 change: 0 additions & 1 deletion libc/config/linux/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.mman.mprotect
libc.src.sys.mman.munmap
libc.src.sys.mman.posix_madvise
libc.src.sys.mman.mincore

# sys/random.h entrypoints
libc.src.sys.random.getrandom
Expand Down
15 changes: 1 addition & 14 deletions libc/spec/linux.td
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,7 @@ def Linux : StandardSpec<"Linux"> {

HeaderSpec SysMMan = HeaderSpec<
"sys/mman.h",
[Macro<"MAP_ANONYMOUS">],
[], // Types
[], // Enumerations
[
FunctionSpec<
"mincore",
RetValSpec<IntType>,
[
ArgSpec<VoidPtr>,
ArgSpec<SizeTType>,
ArgSpec<UnsignedCharPtr>,
]
>,
] // Functions
[Macro<"MAP_ANONYMOUS">]
>;


Expand Down
2 changes: 0 additions & 2 deletions libc/spec/spec.td
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def FloatType : NamedType<"float">;
def DoubleType : NamedType<"double">;
def LongDoubleType : NamedType<"long double">;
def CharType : NamedType<"char">;
def UnsignedCharType : NamedType<"unsigned char">;

// TODO: Add compatibility layer to use C23 type _Float128 if possible.
def Float128Type : NamedType<"__float128">;
Expand Down Expand Up @@ -110,7 +109,6 @@ def IntPtr : PtrType<IntType>;
def RestrictedIntPtr : RestrictedPtrType<IntType>;
def FloatPtr : PtrType<FloatType>;
def DoublePtr : PtrType<DoubleType>;
def UnsignedCharPtr : PtrType<UnsignedCharType>;

def SigHandlerT : NamedType<"__sighandler_t">;

Expand Down
7 changes: 0 additions & 7 deletions libc/src/sys/mman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,3 @@ add_entrypoint_object(
DEPENDS
.${LIBC_TARGET_OS}.posix_madvise
)

add_entrypoint_object(
mincore
ALIAS
DEPENDS
.${LIBC_TARGET_OS}.mincore
)
13 changes: 0 additions & 13 deletions libc/src/sys/mman/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,3 @@ add_entrypoint_object(
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
)

add_entrypoint_object(
mincore
SRCS
mincore.cpp
HDRS
../mincore.h
DEPENDS
libc.include.sys_mman
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
28 changes: 0 additions & 28 deletions libc/src/sys/mman/linux/mincore.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions libc/src/sys/mman/mincore.h

This file was deleted.

17 changes: 0 additions & 17 deletions libc/test/src/sys/mman/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,3 @@ add_libc_unittest(
libc.src.sys.mman.posix_madvise
libc.test.UnitTest.ErrnoSetterMatcher
)

add_libc_unittest(
mincore_test
SUITE
libc_sys_mman_unittests
SRCS
mincore_test.cpp
DEPENDS
libc.include.sys_mman
libc.src.errno.errno
libc.src.sys.mman.mmap
libc.src.sys.mman.munmap
libc.src.sys.mman.madvise
libc.src.sys.mman.mincore
libc.src.unistd.sysconf
libc.test.UnitTest.ErrnoSetterMatcher
)
123 changes: 0 additions & 123 deletions libc/test/src/sys/mman/linux/mincore_test.cpp

This file was deleted.

0 comments on commit ff51b60

Please sign in to comment.