Skip to content

Commit

Permalink
misc: Remove crypt/iconv/intl stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Oct 16, 2024
1 parent 7199623 commit e127c82
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 291 deletions.
6 changes: 0 additions & 6 deletions dummy-libs/libcrypt/src/dummy.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ build_tests = get_option('build_tests')
build_tests_host_libc = get_option('build_tests_host_libc')
disable_posix_option = get_option('disable_posix_option')
disable_linux_option = get_option('disable_linux_option')
disable_iconv_option = get_option('disable_iconv_option')
disable_intl_option = get_option('disable_intl_option')
disable_glibc_option = get_option('disable_glibc_option')
disable_crypt_option = get_option('disable_crypt_option')
disable_bsd_option = get_option('disable_bsd_option')
disable_libgcc_dependency = get_option('disable_libgcc_dependency')
internal_conf = configuration_data()
Expand Down Expand Up @@ -280,10 +277,7 @@ endif

mlibc_conf.set10('__MLIBC_POSIX_OPTION', not disable_posix_option)
mlibc_conf.set10('__MLIBC_LINUX_OPTION', not disable_linux_option)
mlibc_conf.set10('__MLIBC_INTL_OPTION', not disable_intl_option)
mlibc_conf.set10('__MLIBC_ICONV_OPTION', not disable_iconv_option)
mlibc_conf.set10('__MLIBC_GLIBC_OPTION', not disable_glibc_option)
mlibc_conf.set10('__MLIBC_CRYPT_OPTION', not disable_crypt_option)
mlibc_conf.set10('__MLIBC_BSD_OPTION', not disable_bsd_option)
mlibc_conf.set10('__MLIBC_SYSDEP_HAS_BITS_SYSCALL_H', provides_bits_syscall_h)

Expand All @@ -295,15 +289,6 @@ if not disable_posix_option
libc_include_dirs += include_directories('options/posix/include')
endif

if not disable_iconv_option
rtld_include_dirs += include_directories('options/iconv/include')
libc_include_dirs += include_directories('options/iconv/include')
endif

if not disable_intl_option
libc_include_dirs += include_directories('options/intl/include')
endif

if not disable_linux_option
if not headers_only
if get_option('linux_kernel_headers') == ''
Expand All @@ -329,10 +314,6 @@ if not disable_glibc_option
libc_include_dirs += include_directories('options/glibc/include')
endif

if not disable_crypt_option
libc_include_dirs += include_directories('options/crypt/include')
endif

if not disable_bsd_option
rtld_include_dirs += include_directories('options/bsd/include')
libc_include_dirs += include_directories('options/bsd/include')
Expand Down Expand Up @@ -434,9 +415,6 @@ subdir('options/posix')
subdir('options/lsb')
subdir('options/glibc')
subdir('options/linux')
subdir('options/iconv')
subdir('options/intl')
subdir('options/crypt')
subdir('options/bsd')

rtlib_deps = []
Expand Down Expand Up @@ -536,9 +514,6 @@ if not headers_only
library('rt', 'dummy-libs/librt/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
library('util', 'dummy-libs/libutil/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
library('m', 'dummy-libs/libm/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
if not disable_crypt_option
library('crypt', 'dummy-libs/libcrypt/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
endif
library('resolv', 'dummy-libs/libresolv/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
library('dl', 'dummy-libs/libdl/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
library('ssp', 'dummy-libs/libssp/src/dummy.cpp', cpp_args: libc_cpp_args, install: true)
Expand All @@ -552,11 +527,8 @@ summary(summary_info, bool_yn: true, section: 'tests')

summary_info = {}
summary_info += {'headers-only': headers_only}
summary_info += {'crypt option': not disable_crypt_option}
summary_info += {'POSIX option': not disable_posix_option}
summary_info += {'Linux option': not disable_linux_option}
summary_info += {'iconv option': not disable_iconv_option}
summary_info += {'intl option': not disable_intl_option}
summary_info += {'glibc option': not disable_glibc_option}
summary_info += {'BSD option': not disable_bsd_option}
summary_info += {'debug allocator': get_option('debug_allocator')}
Expand Down
3 changes: 0 additions & 3 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ option('headers_only', type : 'boolean', value : false)
option('mlibc_no_headers', type : 'boolean', value : false)
option('build_tests', type: 'boolean', value : false)
option('build_tests_host_libc', type: 'boolean', value : true)
option('disable_crypt_option', type: 'boolean', value : false)
option('disable_posix_option', type: 'boolean', value : false)
option('disable_linux_option', type: 'boolean', value : false)
option('disable_iconv_option', type: 'boolean', value : false)
option('disable_intl_option', type: 'boolean', value : false)
option('disable_glibc_option', type: 'boolean', value : false)
option('disable_bsd_option', type: 'boolean', value : false)
option('disable_libgcc_dependency', type : 'boolean', value : false)
Expand Down
3 changes: 0 additions & 3 deletions mlibc-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
#mesondefine __MLIBC_BSD_OPTION
#mesondefine __MLIBC_POSIX_OPTION
#mesondefine __MLIBC_LINUX_OPTION
#mesondefine __MLIBC_INTL_OPTION
#mesondefine __MLIBC_ICONV_OPTION
#mesondefine __MLIBC_GLIBC_OPTION
#mesondefine __MLIBC_CRYPT_OPTION
#mesondefine __MLIBC_SYSDEP_HAS_BITS_SYSCALL_H

#endif /* _MLIBC_CONFIG_H */
7 changes: 0 additions & 7 deletions options/crypt/generic/crypt.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions options/crypt/include/crypt.h

This file was deleted.

13 changes: 0 additions & 13 deletions options/crypt/meson.build

This file was deleted.

35 changes: 0 additions & 35 deletions options/iconv/generic/iconv.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions options/iconv/include/iconv.h

This file was deleted.

12 changes: 0 additions & 12 deletions options/iconv/meson.build

This file was deleted.

73 changes: 0 additions & 73 deletions options/intl/generic/libintl.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions options/intl/include/libintl.h

This file was deleted.

12 changes: 0 additions & 12 deletions options/intl/meson.build

This file was deleted.

11 changes: 0 additions & 11 deletions options/posix/generic/unistd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,11 +758,7 @@ long sysconf(int number) {
// Linux defines it as 2048.
return 2048;
case _SC_XOPEN_CRYPT:
#if __MLIBC_CRYPT_OPTION
return _XOPEN_CRYPT;
#else
return -1;
#endif /* __MLIBC_CRYPT_OPTION */
case _SC_NPROCESSORS_CONF:
// TODO: actually return a proper value for _SC_NPROCESSORS_CONF
mlibc::infoLogger() << "\e[31mmlibc: sysconf(_SC_NPROCESSORS_CONF) unconditionally returns fallback value 1\e[39m" << frg::endlog;
Expand Down Expand Up @@ -1290,13 +1286,6 @@ int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) {
return 0;
}

#if __MLIBC_CRYPT_OPTION
void encrypt(char[64], int) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
#endif

#if __MLIBC_BSD_OPTION
void *sbrk(intptr_t increment) {
if(increment) {
Expand Down
10 changes: 0 additions & 10 deletions options/posix/include/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ extern "C" {
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
#define _POSIX_MONOTONIC_CLOCK 0

#if __MLIBC_CRYPT_OPTION
#define _XOPEN_CRYPT 1
#endif

/* MISSING: additional _POSIX and _XOPEN feature macros */
/* MISSING: _POSIX_TIMESTAMP_RESOLUTION and _POSIX2_SYMLINKS */

Expand Down Expand Up @@ -384,12 +380,6 @@ int setdomainname(const char *__name, size_t __len);
int getresuid(uid_t *__ruid, uid_t *__euid, uid_t *__suid);
int getresgid(gid_t *__rgid, gid_t *__egid, gid_t *__sgid);

/* Glibc doesn't provide them by default anymore, lock behind an option */
#if __MLIBC_CRYPT_OPTION
char *crypt(const char *__key, const char *__salt);
void encrypt(char __block[64], int __flags);
#endif

#endif /* !__MLIBC_ABI_ONLY */

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit e127c82

Please sign in to comment.