logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: f412cdcf5e1edbf55d0de5c64bead37f7120c9c6
parent f4d1d6a1596e6fdce7beb9091e03201fa3f69a92
Author: Michael Forney <mforney@mforney.org>
Date:   Tue,  2 Mar 2021 13:43:00 -0800

e2fsprogs: Update to 1.46.2

Diffstat:

M.gitmodules1+
Mpkg/e2fsprogs/config.h86+++++++------------------------------------------------------------------------
Mpkg/e2fsprogs/gen.lua13+++++++------
Apkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch40++++++++++++++++++++++++++++++++++++++++
Apkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch40++++++++++++++++++++++++++++++++++++++++
Apkg/e2fsprogs/patch/0004-libsupport-remove-unused-sort_r-definition.patch157+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpkg/e2fsprogs/ver2+-
8 files changed, 364 insertions(+), 86 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -58,6 +58,7 @@ [submodule "pkg/e2fsprogs/src"] path = pkg/e2fsprogs/src url = https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git + ignore = all [submodule "pkg/efibootmgr/src"] path = pkg/efibootmgr/src url = https://github.com/rhinstaller/efibootmgr diff --git a/pkg/e2fsprogs/config.h b/pkg/e2fsprogs/config.h @@ -1,38 +1,25 @@ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* #undef CONFIG_BLKID_DEBUG */ #define CONFIG_BUILD_FINDFS 1 +/* #undef CONFIG_DEVELOPER_FEATURES */ /* #undef CONFIG_JBD_DEBUG */ #define CONFIG_MMP 1 /* #undef CONFIG_TDB */ /* #undef CONFIG_TESTIO_DEBUG */ -/* #undef CRAY_STACKSEG_END */ -/* #undef C_ALLOCA */ /* #undef DISABLE_BACKTRACE */ #define ENABLE_BMAP_STATS 1 /* #undef ENABLE_BMAP_STATS_OPS */ /* #undef ENABLE_NLS */ /* #undef HAVE_ADD_KEY */ -#define HAVE_ALLOCA 1 -#define HAVE_ALLOCA_H 1 -/* #undef HAVE_ARGZ_COUNT */ -/* #undef HAVE_ARGZ_H */ -/* #undef HAVE_ARGZ_NEXT */ -/* #undef HAVE_ARGZ_STRINGIFY */ -#define HAVE_ASPRINTF 1 /* #undef HAVE_ATTR_XATTR_H */ /* #undef HAVE_BACKTRACE */ /* #undef HAVE_BLKID_PROBE_ENABLE_PARTITIONS */ /* #undef HAVE_BLKID_PROBE_GET_TOPOLOGY */ -#define HAVE_BUILTIN_EXPECT 1 -/* #undef HAVE_CFLOCALECOPYCURRENT */ +/* #undef HAVE_BLKID_TOPOLOGY_GET_DAX */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ /* #undef HAVE_CHFLAGS */ /* #undef HAVE_DCGETTEXT */ -#define HAVE_DECL_FEOF_UNLOCKED 1 -#define HAVE_DECL_FGETS_UNLOCKED 1 -#define HAVE_DECL_GETC_UNLOCKED 1 -#define HAVE_DECL__SNPRINTF 0 -#define HAVE_DECL__SNWPRINTF 0 #define HAVE_DIRENT_H 1 #define HAVE_DLOPEN 1 /* #undef HAVE_DOPRNT */ @@ -45,37 +32,25 @@ #define HAVE_FCHOWN 1 #define HAVE_FCNTL 1 #define HAVE_FDATASYNC 1 -#define HAVE_FEATURES_H 1 #define HAVE_FSTAT64 1 #define HAVE_FSYNC 1 #define HAVE_FTRUNCATE64 1 /* #undef HAVE_FUSE_H */ #define HAVE_FUTIMES 1 -#define HAVE_FWPRINTF 1 #define HAVE_GETCWD 1 #define HAVE_GETDTABLESIZE 1 -#define HAVE_GETEGID 1 -#define HAVE_GETEUID 1 -#define HAVE_GETGID 1 #define HAVE_GETHOSTNAME 1 /* #undef HAVE_GETMNTINFO */ #define HAVE_GETOPT_H 1 -#define HAVE_GETPAGESIZE 1 #define HAVE_GETPWUID_R 1 #define HAVE_GETRLIMIT 1 #define HAVE_GETRUSAGE 1 /* #undef HAVE_GETTEXT */ -#define HAVE_GETUID 1 -#define HAVE_ICONV 1 -#define HAVE_INTMAX_T 1 +/* #undef HAVE_ICONV */ #define HAVE_INTPTR_T 1 #define HAVE_INTTYPES_H 1 -#define HAVE_INTTYPES_H_WITH_UINTMAX 1 #define HAVE_JRAND48 1 /* #undef HAVE_KEYCTL */ -#define HAVE_LANGINFO_CODESET 1 -#define HAVE_LC_MESSAGES 1 -#define HAVE_LIMITS_H 1 #define HAVE_LINUX_FALLOC_H 1 #define HAVE_LINUX_FD_H 1 #define HAVE_LINUX_FSMAP_H 1 @@ -85,13 +60,11 @@ #define HAVE_LLISTXATTR 1 /* #undef HAVE_LLSEEK */ /* #undef HAVE_LLSEEK_PROTOTYPE */ -#define HAVE_LONG_LONG_INT 1 #define HAVE_LSEEK64 1 #define HAVE_LSEEK64_PROTOTYPE 1 /* #undef HAVE_MAGIC_H */ /* #undef HAVE_MALLINFO */ #define HAVE_MALLOC_H 1 -#define HAVE_MBRTOWC 1 #define HAVE_MBSTOWCS 1 #define HAVE_MEMALIGN 1 #define HAVE_MEMORY_H 1 @@ -101,12 +74,10 @@ #define HAVE_MOUNT_NODEV 1 #define HAVE_MOUNT_NOSUID 1 #define HAVE_MSYNC 1 -#define HAVE_MUNMAP 1 #define HAVE_NANOSLEEP 1 #define HAVE_NETINET_IN_H 1 /* #undef HAVE_NET_IF_DL_H */ #define HAVE_NET_IF_H 1 -#define HAVE_NEWLOCALE 1 #define HAVE_OPEN64 1 #define HAVE_OPTRESET 1 #define HAVE_PATHCONF 1 @@ -114,14 +85,12 @@ #define HAVE_POSIX_FADVISE 1 #define HAVE_POSIX_FADVISE64 1 #define HAVE_POSIX_MEMALIGN 1 -#define HAVE_POSIX_PRINTF 1 #define HAVE_PRCTL 1 #define HAVE_PREAD 1 #define HAVE_PREAD64 1 +#define HAVE_PTHREAD 1 #define HAVE_PTHREAD_H 1 -#define HAVE_PTHREAD_MUTEX_RECURSIVE 1 -#define HAVE_PTHREAD_RWLOCK 1 -#define HAVE_PUTENV 1 +#define HAVE_PTHREAD_PRIO_INHERIT 1 #define HAVE_PWRITE 1 #define HAVE_PWRITE64 1 #define HAVE_RECLEN_DIRENT 1 @@ -129,9 +98,7 @@ #define HAVE_SECURE_GETENV 1 #define HAVE_SEMAPHORE_H 1 /* #undef HAVE_SEM_INIT */ -#define HAVE_SETENV 1 #define HAVE_SETJMP_H 1 -#define HAVE_SETLOCALE 1 #define HAVE_SETMNTENT 1 #define HAVE_SETRESGID 1 #define HAVE_SETRESUID 1 @@ -140,9 +107,7 @@ #define HAVE_SRANDOM 1 /* #undef HAVE_STAT_FLAGS */ #define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 #define HAVE_STDINT_H 1 -#define HAVE_STDINT_H_WITH_UINTMAX 1 #define HAVE_STDLIB_H 1 #define HAVE_STPCPY 1 #define HAVE_STRCASECMP 1 @@ -151,10 +116,8 @@ #define HAVE_STRING_H 1 #define HAVE_STRNLEN 1 #define HAVE_STRPTIME 1 -#define HAVE_STRTOUL 1 #define HAVE_STRTOULL 1 #define HAVE_STRUCT_STAT_ST_ATIM 1 -#define HAVE_SYMLINK 1 #define HAVE_SYNC_FILE_RANGE 1 #define HAVE_SYSCONF 1 /* #undef HAVE_SYS_ACL_H */ @@ -166,7 +129,6 @@ /* #undef HAVE_SYS_MKDEV_H */ #define HAVE_SYS_MMAN_H 1 #define HAVE_SYS_MOUNT_H 1 -#define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_PRCTL_H 1 #define HAVE_SYS_RESOURCE_H 1 #define HAVE_SYS_SELECT_H 1 @@ -174,7 +136,6 @@ /* #undef HAVE_SYS_SOCKIO_H */ #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_SYSCALL_H 1 -/* #undef HAVE_SYS_SYSCTL_H */ #define HAVE_SYS_SYSMACROS_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TYPES_H 1 @@ -183,30 +144,15 @@ #define HAVE_SYS_XATTR_H 1 #define HAVE_TERMIOS_H 1 /* #undef HAVE_TERMIO_H */ -#define HAVE_TSEARCH 1 #define HAVE_TYPE_SSIZE_T 1 -#define HAVE_UINTMAX_T 1 #define HAVE_UNISTD_H 1 -#define HAVE_UNSIGNED_LONG_LONG_INT 1 -#define HAVE_USELOCALE 1 #define HAVE_USLEEP 1 #define HAVE_UTIME 1 #define HAVE_UTIMES 1 #define HAVE_UTIME_H 1 #define HAVE_VALLOC 1 -#define HAVE_VISIBILITY 1 #define HAVE_VPRINTF 1 -#define HAVE_WCHAR_T 1 -#define HAVE_WCRTOMB 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSNLEN 1 -#define HAVE_WINT_T 1 -#define HAVE_WORKING_O_NOATIME 1 -#define HAVE_WORKING_O_NOFOLLOW 1 -#define HAVE___FSETLOCKING 1 /* #undef HAVE___SECURE_GETENV */ -#define ICONV_CONST -#define INTDIV0_RAISES_SIGFPE 1 #define PACKAGE "e2fsprogs" #define PACKAGE_BUGREPORT "" #define PACKAGE_NAME "" @@ -214,28 +160,17 @@ #define PACKAGE_TARNAME "" #define PACKAGE_URL "" #define PACKAGE_VERSION "" -/* #undef PRI_MACROS_BROKEN */ -/* #undef PTHREAD_IN_USE_DETECTION_HARD */ +/* #undef PTHREAD_CREATE_JOINABLE */ #define SIZEOF_INT 4 /* probe SIZEOF_LONG */ #define SIZEOF_LONG_LONG 8 #define SIZEOF_OFF_T 8 #define SIZEOF_SHORT 2 /* probe SIZEOF_TIME_T */ -#ifndef SIZE_MAX -/* # undef SIZE_MAX */ -#endif -/* #undef STACK_DIRECTION */ #define STDC_HEADERS 1 #ifdef HAVE__THREAD_LOCAL # define TLS _Thread_local #endif -#define USE_POSIX_THREADS 1 -#define USE_POSIX_THREADS_WEAK 1 -/* #undef USE_PTH_THREADS */ -/* #undef USE_PTH_THREADS_WEAK */ -/* #undef USE_SOLARIS_THREADS */ -/* #undef USE_SOLARIS_THREADS_WEAK */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif @@ -252,7 +187,6 @@ # define __EXTENSIONS__ 1 #endif /* #undef USE_UUIDD */ -/* #undef USE_WINDOWS_THREADS */ #define VERSION "0.14.1" #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ @@ -267,11 +201,5 @@ /* #undef _MINIX */ /* #undef _POSIX_1_SOURCE */ /* #undef _POSIX_SOURCE */ -#ifndef __cplusplus -/* #undef inline */ -#endif -/* #undef ptrdiff_t */ -/* #undef size_t */ -/* #undef uintmax_t */ #define LOCALEDIR "/share/locale" #define ROOT_SYSCONFDIR "/etc" diff --git a/pkg/e2fsprogs/gen.lua b/pkg/e2fsprogs/gen.lua @@ -1,8 +1,9 @@ -set('version', '1.45.7') +set('version', '1.46.2') cflags{ '-std=c99', '-Wall', - '-Wno-address-of-packed-member', '-Wno-format-truncation', '-Wno-format-overflow', - '-Wno-pointer-sign', '-Wno-maybe-uninitialized', + '-Wno-address-of-packed-member', '-Wno-format-truncation', + '-Wno-unused-variable', '-Wno-stringop-truncation', + '-Wno-stringop-overflow', '-Wno-unused-label', '-D HAVE_CONFIG_H', '-I $outdir', '-I $outdir/include', @@ -22,7 +23,7 @@ build('cat', '$outdir/config.h', { set('subst', { '-e s,@E2FSPROGS_VERSION@,$version,', - '-e s,@E2FSPROGS_MONTH@,Jan,', + '-e s,@E2FSPROGS_MONTH@,Feb,', '-e s,@E2FSPROGS_YEAR@,2021,', '-e s,@JDEV@,,', }) @@ -93,7 +94,7 @@ lib('libe2p.a', [[lib/e2p/( getflags.c getversion.c hashstr.c iod.c ls.c ljs.c mntopts.c parse_num.c pe.c pf.c ps.c setflags.c setversion.c uuid.c ostype.c percent.c crypto_mode.c fgetproject.c fsetproject.c - encoding.c + encoding.c errcode.c )]]) lib('libext2fs.a', [[$outdir/ext2_err.c lib/ext2fs/( alloc.c @@ -195,7 +196,7 @@ exe('bin/e2fsck', [[ dx_dirinfo.c ehandler.c problem.c message.c quota.c recovery.c region.c revoke.c ea_refcount.c rehash.c logfile.c sigcatcher.c readahead.c - extents.c + extents.c encrypted_files.c ) libsupport.a libext2fs.a libe2p.a libblkid.a libcomm_err.a $builddir/pkg/util-linux/libuuid.a.d diff --git a/pkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch b/pkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch @@ -0,0 +1,111 @@ +From c27416b8e150162d8a629dfb6c02c04081531a8b Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Mar 2021 14:24:01 -0800 +Subject: [PATCH] libext2fs: avoid pointer arithmetic on `void *` + +The pointer operand to the + operator must be to a complete object +type. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + e2fsck/recovery.c | 2 +- + lib/ext2fs/link.c | 20 +++++++++++--------- + lib/ext2fs/unix_io.c | 2 +- + 3 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c +index dc0694fc..889cd0e6 100644 +--- a/e2fsck/recovery.c ++++ b/e2fsck/recovery.c +@@ -179,7 +179,7 @@ static int jbd2_descriptor_block_csum_verify(journal_t *j, void *buf) + if (!jbd2_journal_has_csum_v2or3(j)) + return 1; + +- tail = (struct jbd2_journal_block_tail *)(buf + j->j_blocksize - ++ tail = (struct jbd2_journal_block_tail *)((char *)buf + j->j_blocksize - + sizeof(struct jbd2_journal_block_tail)); + provided = tail->t_checksum; + tail->t_checksum = 0; +diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c +index a2c34ac5..80b16ac5 100644 +--- a/lib/ext2fs/link.c ++++ b/lib/ext2fs/link.c +@@ -110,7 +110,8 @@ static errcode_t dx_lookup(ext2_filsys fs, ext2_ino_t dir, + info->frames[0].buf); + if (errcode) + goto out_err; +- root = info->frames[0].buf + EXT2_DX_ROOT_OFF; ++ root = (struct ext2_dx_root_info *) ++ ((char *) info->frames[0].buf + EXT2_DX_ROOT_OFF); + hash_alg = root->hash_version; + if (hash_alg != EXT2_HASH_TEA && hash_alg != EXT2_HASH_HALF_MD4 && + hash_alg != EXT2_HASH_LEGACY) { +@@ -329,19 +330,19 @@ static errcode_t dx_move_dirents(ext2_filsys fs, struct dx_hash_map *map, + csum_size = sizeof(struct ext2_dir_entry_tail); + + for (i = 0; i < count; i++) { +- de = from + map[i].off; ++ de = (struct ext2_dir_entry *) ((char *) from + map[i].off); + rec_len = EXT2_DIR_REC_LEN(ext2fs_dirent_name_len(de)); + memcpy(to, de, rec_len); +- retval = ext2fs_set_rec_len(fs, rec_len, to); ++ retval = ext2fs_set_rec_len(fs, rec_len, (struct ext2_dir_entry *) to); + if (retval) + return retval; +- to += rec_len; ++ to = (char *)to + rec_len; + } + /* + * Update rec_len of the last dir entry to stretch to the end of block + */ +- to -= rec_len; +- rec_len = fs->blocksize - (to - base) - csum_size; ++ to = (char *)to - rec_len; ++ rec_len = fs->blocksize - ((char *) to - (char *) base) - csum_size; + retval = ext2fs_set_rec_len(fs, rec_len, to); + if (retval) + return retval; +@@ -396,7 +397,7 @@ static errcode_t dx_split_leaf(ext2_filsys fs, ext2_ino_t dir, + return retval; + } + for (offset = 0; offset < fs->blocksize; offset += rec_len) { +- de = buf + offset; ++ de = (struct ext2_dir_entry *) ((char *) buf + offset); + retval = ext2fs_get_rec_len(fs, de, &rec_len); + if (retval) + goto out; +@@ -501,7 +502,7 @@ static errcode_t dx_grow_tree(ext2_filsys fs, ext2_ino_t dir, + retval = ext2fs_set_rec_len(fs, fs->blocksize, de); + if (retval) + return retval; +- head = buf + 8; ++ head = (struct ext2_dx_countlimit *) ((char *) buf + 8); + count = ext2fs_le16_to_cpu(info->frames[i+1].head->count); + /* Growing tree depth? */ + if (i < 0) { +@@ -517,7 +518,8 @@ static errcode_t dx_grow_tree(ext2_filsys fs, ext2_ino_t dir, + /* Now update tree root */ + info->frames[0].head->count = ext2fs_cpu_to_le16(1); + info->frames[0].entries[0].block = ext2fs_cpu_to_le32(lblk); +- root = info->frames[0].buf + EXT2_DX_ROOT_OFF; ++ root = (struct ext2_dx_root_info *) ++ ((char *) info->frames[0].buf + EXT2_DX_ROOT_OFF); + root->indirect_levels++; + } else { + /* Splitting internal node in two */ +diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c +index 64eee342..6764a947 100644 +--- a/lib/ext2fs/unix_io.c ++++ b/lib/ext2fs/unix_io.c +@@ -315,7 +315,7 @@ bounce_read: + if (actual > align_size) + actual = align_size; + actual -= offset; +- memcpy(buf, data->bounce + offset, actual); ++ memcpy(buf, (char *) data->bounce + offset, actual); + + really_read += actual; + size -= actual; +-- +2.30.0 + diff --git a/pkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch b/pkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch @@ -0,0 +1,40 @@ +From 54cdf16b2e2f662635accdd2f1987068686ee553 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Mar 2021 14:37:20 -0800 +Subject: [PATCH] libext2fs: use offsetof() from stddef.h + +offsetof is a standard C feature available from stddef.h, going +back all the way to ANSI C. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + lib/ext2fs/compiler.h | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +diff --git a/lib/ext2fs/compiler.h b/lib/ext2fs/compiler.h +index 9aa9b4ec..49fe025e 100644 +--- a/lib/ext2fs/compiler.h ++++ b/lib/ext2fs/compiler.h +@@ -1,18 +1,7 @@ + #ifndef _EXT2FS_COMPILER_H + #define _EXT2FS_COMPILER_H + +-#ifndef __has_builtin +-#define __has_builtin(x) 0 +-#endif +- +-#undef offsetof +-#if __has_builtin(__builtin_offsetof) +-#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) +-#elif defined(__compiler_offsetof) +-#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) +-#else +-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +-#endif ++#include <stddef.h> + + #define container_of(ptr, type, member) ({ \ + const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ +-- +2.30.0 + diff --git a/pkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch b/pkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch @@ -0,0 +1,40 @@ +From ced6ce86e63fcbc7612253a60b6c87dfb173bd91 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Mar 2021 14:42:53 -0800 +Subject: [PATCH] libext2fs: use statement-expression for container_of only on + GNU-compatible compilers + +Functionally, the statement-expression is not necessary here; it +just gives a bit of type-safety to make sure the pointer really +does have a compatible type with the specified member of the struct. + +When statement expressions are not available, we can just use a +portable fallback macro that skips this member type check. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + lib/ext2fs/compiler.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/ext2fs/compiler.h b/lib/ext2fs/compiler.h +index 49fe025e..42faa61c 100644 +--- a/lib/ext2fs/compiler.h ++++ b/lib/ext2fs/compiler.h +@@ -3,9 +3,14 @@ + + #include <stddef.h> + ++#ifdef __GNUC__ + #define container_of(ptr, type, member) ({ \ + const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) ++#else ++#define container_of(ptr, type, member) \ ++ ((type *)((char *)(ptr) - offsetof(type, member))) ++#endif + + + #endif /* _EXT2FS_COMPILER_H */ +-- +2.30.0 + diff --git a/pkg/e2fsprogs/patch/0004-libsupport-remove-unused-sort_r-definition.patch b/pkg/e2fsprogs/patch/0004-libsupport-remove-unused-sort_r-definition.patch @@ -0,0 +1,157 @@ +From 6a898554d5862f7cffbd674b0e1c690c6c8e83e4 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Mar 2021 15:47:20 -0800 +Subject: [PATCH] libsupport: remove unused sort_r definition + +e2fsprogs uses sort_r_simple directly, so sort_r is not needed. + +On any linux (including linux-musl), sort_r is defined in terms of +qsort_r, so a compiler that does not support inlining may still +emit a reference to qsort_r. +--- + lib/support/sort_r.h | 120 ++----------------------------------------- + 1 file changed, 3 insertions(+), 117 deletions(-) + +diff --git a/lib/support/sort_r.h b/lib/support/sort_r.h +index dc17e8af..4c4ebf3b 100644 +--- a/lib/support/sort_r.h ++++ b/lib/support/sort_r.h +@@ -22,20 +22,11 @@ void sort_r(void *base, size_t nel, size_t width, + + */ + +-#define _SORT_R_INLINE inline +- +-#if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \ +- defined __FreeBSD__ || defined __DragonFly__) +-# define _SORT_R_BSD +-#elif (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \ +- defined __linux__ || defined __MINGW32__ || defined __GLIBC__) +-# define _SORT_R_LINUX +-#elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) +-# define _SORT_R_WINDOWS +-# undef _SORT_R_INLINE ++ ++#if (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) + # define _SORT_R_INLINE __inline + #else +- /* Using our own recursive quicksort sort_r_simple() */ ++# define _SORT_R_INLINE inline + #endif + + #if (defined NESTED_QSORT && NESTED_QSORT == 0) +@@ -211,111 +202,6 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, + } + } + +- +-#if defined NESTED_QSORT +- +- static _SORT_R_INLINE void sort_r(void *base, size_t nel, size_t width, +- int (*compar)(const void *_a, +- const void *_b, +- void *aarg), +- void *arg) +- { +- int nested_cmp(const void *a, const void *b) +- { +- return compar(a, b, arg); +- } +- +- qsort(base, nel, width, nested_cmp); +- } +- +-#else /* !NESTED_QSORT */ +- +- /* Declare structs and functions */ +- +- #if defined _SORT_R_BSD +- +- /* Ensure qsort_r is defined */ +- extern void qsort_r(void *base, size_t nel, size_t width, void *thunk, +- int (*compar)(void *_thunk, +- const void *_a, const void *_b)); +- +- #endif +- +- #if defined _SORT_R_BSD || defined _SORT_R_WINDOWS +- +- /* BSD (qsort_r), Windows (qsort_s) require argument swap */ +- +- struct sort_r_data +- { +- void *arg; +- int (*compar)(const void *_a, const void *_b, void *_arg); +- }; +- +- static _SORT_R_INLINE int sort_r_arg_swap(void *s, +- const void *a, const void *b) +- { +- struct sort_r_data *ss = (struct sort_r_data*)s; +- return (ss->compar)(a, b, ss->arg); +- } +- +- #endif +- +- #if defined _SORT_R_LINUX +- +- typedef int(* __compar_d_fn_t)(const void *, const void *, void *); +- extern void qsort_r(void *base, size_t nel, size_t width, +- __compar_d_fn_t __compar, void *arg) +- __attribute__((nonnull (1, 4))); +- +- #endif +- +- /* implementation */ +- +- static _SORT_R_INLINE void sort_r(void *base, size_t nel, size_t width, +- int (*compar)(const void *_a, +- const void *_b, void *_arg), +- void *arg) +- { +- #if defined _SORT_R_LINUX +- +- #if defined __GLIBC__ && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)) +- +- /* no qsort_r in glibc before 2.8, need to use nested qsort */ +- sort_r_simple(base, nel, width, compar, arg); +- +- #else +- +- qsort_r(base, nel, width, compar, arg); +- +- #endif +- +- #elif defined _SORT_R_BSD +- +- struct sort_r_data tmp; +- tmp.arg = arg; +- tmp.compar = compar; +- qsort_r(base, nel, width, &tmp, sort_r_arg_swap); +- +- #elif defined _SORT_R_WINDOWS +- +- struct sort_r_data tmp; +- tmp.arg = arg; +- tmp.compar = compar; +- qsort_s(base, nel, width, sort_r_arg_swap, &tmp); +- +- #else +- +- /* Fall back to our own quicksort implementation */ +- sort_r_simple(base, nel, width, compar, arg); +- +- #endif +- } +- +-#endif /* !NESTED_QSORT */ +- + #undef _SORT_R_INLINE +-#undef _SORT_R_WINDOWS +-#undef _SORT_R_LINUX +-#undef _SORT_R_BSD + + #endif /* SORT_R_H_ */ +-- +2.30.0 + diff --git a/pkg/e2fsprogs/ver b/pkg/e2fsprogs/ver @@ -1 +1 @@ -1.45.7 r0 +1.46.2 r0