diff --git a/dummy-libs/libcrypt/src/dummy.cpp b/dummy-libs/libcrypt/src/dummy.cpp deleted file mode 100644 index 6c3a4c22f..000000000 --- a/dummy-libs/libcrypt/src/dummy.cpp +++ /dev/null @@ -1,6 +0,0 @@ - -// We build an empty libcrypt because shadow expects -lcrypt -// The actual crypt functions reside inside libc - -extern "C" void __mlibc_libcrypt_dummy(void) { } - diff --git a/meson.build b/meson.build index e75d75d44..ad4f9ede1 100644 --- a/meson.build +++ b/meson.build @@ -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() @@ -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) @@ -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') == '' @@ -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') @@ -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 = [] @@ -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) @@ -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')} diff --git a/meson_options.txt b/meson_options.txt index c5a829950..eb3d9d5f8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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) diff --git a/mlibc-config.h.in b/mlibc-config.h.in index 68ef66264..85f6b92d8 100644 --- a/mlibc-config.h.in +++ b/mlibc-config.h.in @@ -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 */ diff --git a/options/crypt/generic/crypt.cpp b/options/crypt/generic/crypt.cpp deleted file mode 100644 index 65e0d238a..000000000 --- a/options/crypt/generic/crypt.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -char *crypt(const char *, const char *) { - __ensure(!"Not implemented"); - __builtin_unreachable(); -} diff --git a/options/crypt/include/crypt.h b/options/crypt/include/crypt.h deleted file mode 100644 index c96294aa0..000000000 --- a/options/crypt/include/crypt.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _CRYPT_H -#define _CRYPT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __MLIBC_ABI_ONLY - -char *crypt(const char *__key, const char *__salt); - -#endif /* !__MLIBC_ABI_ONLY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _CRYPT_H */ diff --git a/options/crypt/meson.build b/options/crypt/meson.build deleted file mode 100644 index 9377604d1..000000000 --- a/options/crypt/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -if disable_crypt_option - subdir_done() -endif - -libc_sources += files( - 'generic/crypt.cpp', -) - -if not no_headers - install_headers( - 'include/crypt.h', - ) -endif diff --git a/options/iconv/generic/iconv.cpp b/options/iconv/generic/iconv.cpp deleted file mode 100644 index 9239a7cd1..000000000 --- a/options/iconv/generic/iconv.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include - -size_t iconv(iconv_t cd, char **__restrict inbuf, size_t *__restrict inbytesleft, char **__restrict outbuf, size_t *__restrict outbytesleft) { - (void)inbytesleft; - (void)outbytesleft; - - mlibc::infoLogger() << "iconv() is unimplemented!" << frg::endlog; - if(cd == (iconv_t)1) { // UTF-8 to UTF-8 - mlibc::infoLogger() << "iconv() from and to are the same, memcpy it is" << frg::endlog; - memcpy(inbuf, outbuf, *inbytesleft); - *outbytesleft = *inbytesleft; - return *outbytesleft; - } - __ensure(!"iconv() not implemented"); - __builtin_unreachable(); -} - -int iconv_close(iconv_t) { - return 0; -} - -iconv_t iconv_open(const char *tocode, const char *fromcode) { - mlibc::infoLogger() << "iconv_open() is unimplemented! args: " << tocode << " and: " << fromcode << frg::endlog; - if(!strcmp(tocode, "UTF-8") && !strcmp(fromcode, "UTF-8")) { - mlibc::infoLogger() << "iconv_open() with UTF-8 on both is a no-op!" << frg::endlog; - iconv_t cd = (iconv_t)1; - return cd; - } - __ensure(!"iconv_open() not implemented"); - __builtin_unreachable(); -} - - diff --git a/options/iconv/include/iconv.h b/options/iconv/include/iconv.h deleted file mode 100644 index f6f7956aa..000000000 --- a/options/iconv/include/iconv.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _ICONV_H -#define _ICONV_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *iconv_t; - -#ifndef __MLIBC_ABI_ONLY - -size_t iconv(iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, - char **__restrict __outbuf, size_t *__restrict __outbytesleft); -int iconv_close(iconv_t __cd); -iconv_t iconv_open(const char *__tocode, const char *__fromcode); - -#endif /* !__MLIBC_ABI_ONLY */ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/options/iconv/meson.build b/options/iconv/meson.build deleted file mode 100644 index f1aed47d5..000000000 --- a/options/iconv/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -if disable_iconv_option - subdir_done() -endif -libc_sources += files( - 'generic/iconv.cpp', -) - -if not no_headers - install_headers( - 'include/iconv.h', - ) -endif diff --git a/options/intl/generic/libintl.cpp b/options/intl/generic/libintl.cpp deleted file mode 100644 index 8d4b28f2b..000000000 --- a/options/intl/generic/libintl.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include - -char *gettext(const char *msgid) { - (void)msgid; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *dgettext(const char *domainname, const char *msgid) { - (void)domainname; - (void)msgid; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *dcgettext(const char *domainname, const char *msgid, - int category) { - (void)domainname; - (void)msgid; - (void)category; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *ngettext(const char *msgid, const char *msgid_plural, unsigned long int n) { - (void)msgid; - (void)msgid_plural; - (void)n; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *dngettext(const char *domainname, const char *msgid, - const char *msgid_plural, unsigned long int n) { - (void)domainname; - (void)msgid; - (void)msgid_plural; - (void)n; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *dcngettext(const char *domainname, const char *msgid, - const char *msgid_plural, unsigned long int n, int category) { - (void)domainname; - (void)msgid; - (void)msgid_plural; - (void)n; - (void)category; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *textdomain(const char *domainname) { - (void)domainname; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *bindtextdomain(const char *domainname, const char *dirname) { - (void)domainname; - (void)dirname; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} - -char *bind_textdomain_codeset(const char *domainname, const char *codeset) { - (void)domainname; - (void)codeset; - __ensure(!"Not implemented"); - __builtin_unreachable(); -} diff --git a/options/intl/include/libintl.h b/options/intl/include/libintl.h deleted file mode 100644 index 3e3746c5a..000000000 --- a/options/intl/include/libintl.h +++ /dev/null @@ -1,33 +0,0 @@ - -#ifndef _LIBINTL_H -#define _LIBINTL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __MLIBC_ABI_ONLY - -char *gettext(const char *__msgid); -char *dgettext(const char *__domainname, const char *__msgid); -char *dcgettext(const char *__domainname, const char *__msgid, - int __category); - -char *ngettext(const char *__msgid, const char *__msgid_plural, unsigned long int __n); -char *dngettext(const char *__domainname, const char *__msgid, - const char *__msgid_plural, unsigned long int __n); -char *dcngettext(const char *__domainname, const char *__msgid, - const char *__msgid_plural, unsigned long int __n, int __category); - -char *textdomain(const char *__domainname); -char *bindtextdomain(const char *__domainname, const char *__dirname); -char *bind_textdomain_codeset(const char *__domainname, const char *__codeset); - -#endif /* !__MLIBC_ABI_ONLY */ - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBINTL_H */ - diff --git a/options/intl/meson.build b/options/intl/meson.build deleted file mode 100644 index b56ad830c..000000000 --- a/options/intl/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -if disable_intl_option - subdir_done() -endif -libc_sources += files( - 'generic/libintl.cpp', -) - -if not no_headers - install_headers( - 'include/libintl.h', - ) -endif diff --git a/options/posix/generic/unistd.cpp b/options/posix/generic/unistd.cpp index 444ad22da..9801d18fa 100644 --- a/options/posix/generic/unistd.cpp +++ b/options/posix/generic/unistd.cpp @@ -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; @@ -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) { diff --git a/options/posix/include/unistd.h b/options/posix/include/unistd.h index 3f4ef12d1..907bad33d 100644 --- a/options/posix/include/unistd.h +++ b/options/posix/include/unistd.h @@ -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 */ @@ -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 diff --git a/scripts/check-options-header-include.sh b/scripts/check-options-header-include.sh index 7f951c814..d0c595f59 100644 --- a/scripts/check-options-header-include.sh +++ b/scripts/check-options-header-include.sh @@ -5,7 +5,7 @@ shopt -s lastpipe errors_found=0 find . -wholename '*include/*.h' -print0 | while read -rd $'\0' file; do - uses=$(grep -c -E "__MLIBC_(ANSI|BSD|POSIX|LINUX|INTL|ICONV|GLIBC|CRYPT)_OPTION" "$file") + uses=$(grep -c -E "__MLIBC_(ANSI|BSD|POSIX|LINUX|GLIBC)_OPTION" "$file") if [ "$uses" -ne 0 ]; then does_include=$(grep -c "#include " "$file") if [ "$does_include" -eq 0 ]; then