All of lore.kernel.org
 help / color / mirror / Atom feed
From: mtkaczyk@kernel.org
To: linux-raid@vger.kernel.org
Cc: Mariusz Tkaczyk <mtkaczyk@kernel.org>, Xiao Ni <xni@redhat.com>,
	Nigel Croxon <ncroxon@redhat.com>, Song Liu <song@kernel.org>,
	Yu Kuai <yukuai@kernel.org>
Subject: [PATCH v0 1/3] mdadm: Remove klibc and uclibc support
Date: Wed, 19 Mar 2025 18:10:56 +0100	[thread overview]
Message-ID: <20250319171058.20052-2-mtkaczyk@kernel.org> (raw)
In-Reply-To: <20250319171058.20052-1-mtkaczyk@kernel.org>

From: Mariusz Tkaczyk <mtkaczyk@kernel.org>

Klibc compilation is not working for at least 3 years because of
following error:
mdadm.h:1912:15: error: unknown type name 'sighandler_t'

It will have a conflict with le/be_to_cpu() functions family provided by
asm/byteorder.h which will be included with raid/md_p.h. Therefore we
need to remove support for it. Also, remove uclibc because it is not actively
maintained.

Remove klibc and uclibc targets from Makefile and special klibc code.
Targets can be removed safely because using CC is recommended.

Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
---
 Makefile  | 34 +++-------------------------------
 README.md |  3 ---
 mdadm.h   | 37 +------------------------------------
 3 files changed, 4 insertions(+), 70 deletions(-)

diff --git a/Makefile b/Makefile
index bcd092de50c7..387e4a56f519 100644
--- a/Makefile
+++ b/Makefile
@@ -31,16 +31,6 @@
 # define "CXFLAGS" to give extra flags to CC.
 # e.g.  make CXFLAGS=-O to optimise
 CXFLAGS ?=-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE
-TCC = tcc
-UCLIBC_GCC = $(shell for nm in i386-uclibc-linux-gcc i386-uclibc-gcc; do which $$nm > /dev/null && { echo $$nm ; exit; } ; done; echo false No uclibc found )
-#DIET_GCC = diet gcc
-# sorry, but diet-libc doesn't know about posix_memalign,
-# so we cannot use it any more.
-DIET_GCC = gcc -DHAVE_STDINT_H
-
-KLIBC=/home/src/klibc/klibc-0.77
-
-KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
 ifdef COVERITY
 COVERITY_FLAGS=-include coverity-gcc-hack.h
@@ -225,8 +215,6 @@ everything: all swap_super test_stripe raid6check \
 	mdadm.Os mdadm.O2 man
 everything-test: all swap_super test_stripe \
 	mdadm.Os mdadm.O2 man
-# mdadm.uclibc doesn't work on x86-64
-# mdadm.tcc doesn't work..
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) $(COVERITY_FLAGS) -o $@ -c $<
@@ -237,13 +225,6 @@ mdadm : $(OBJS) | check_rundir
 mdadm.static : $(OBJS) $(STATICOBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) $(LDLIBS)
 
-mdadm.tcc : $(SRCS) $(INCL)
-	$(TCC) -o mdadm.tcc $(SRCS)
-
-mdadm.klibc : $(SRCS) $(INCL)
-	rm -f $(OBJS)
-	$(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
-
 mdadm.Os : $(SRCS) $(INCL)
 	$(CC) -o mdadm.Os $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) $(LDLIBS)
 
@@ -298,15 +279,6 @@ install : install-bin install-man install-udev
 install-static : mdadm.static install-man
 	$(INSTALL) -D $(STRIP) -m 755 mdadm.static $(DESTDIR)$(BINDIR)/mdadm
 
-install-tcc : mdadm.tcc install-man
-	$(INSTALL) -D $(STRIP) -m 755 mdadm.tcc $(DESTDIR)$(BINDIR)/mdadm
-
-install-uclibc : mdadm.uclibc install-man
-	$(INSTALL) -D $(STRIP) -m 755 mdadm.uclibc $(DESTDIR)$(BINDIR)/mdadm
-
-install-klibc : mdadm.klibc install-man
-	$(INSTALL) -D $(STRIP) -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm
-
 install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
 	$(INSTALL) -D -m 644 mdadm.8 $(DESTDIR)$(MAN8DIR)/mdadm.8
 	$(INSTALL) -D -m 644 mdmon.8 $(DESTDIR)$(MAN8DIR)/mdmon.8
@@ -354,9 +326,9 @@ test: mdadm mdmon test_stripe swap_super raid6check
 
 clean :
 	rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
-	mdadm.tcc mdadm.uclibc mdadm.static *.orig *.porig *.rej *.alt \
-	.merge_file_* mdadm.Os mdadm.O2 mdmon.O2 swap_super init.cpio.gz \
-	mdadm.uclibc.static test_stripe raid6check raid6check.o mdmon mdadm.8
+	mdadm.static *.orig *.porig *.rej *.alt merge_file_* \
+	mdadm.Os mdadm.O2 mdmon.O2 swap_super init.cpio.gz \
+	test_stripe raid6check raid6check.o mdmon mdadm.8
 	rm -rf cov-int
 
 dist : clean
diff --git a/README.md b/README.md
index 0c299a9a26a2..12a26353e7e9 100644
--- a/README.md
+++ b/README.md
@@ -138,9 +138,6 @@ List of installation targets:
 
 The following targets are deprecated and should not be used:
 - `install-static`
-- `install-tcc`
-- `install-uclibc`
-- `install-klibc`
 
 # License
 
diff --git a/mdadm.h b/mdadm.h
index e84c341c3040..0b86e4849d33 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -43,6 +43,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 #include	<sys/time.h>
 #include	<getopt.h>
 #include	<fcntl.h>
+#include	<ftw.h>
 #include	<stdio.h>
 #include	<errno.h>
 #include	<string.h>
@@ -189,7 +190,6 @@ struct dlm_lksb {
 			     ((x) & 0x00000000ff000000ULL) << 8 |  \
 			     ((x) & 0x000000ff00000000ULL) >> 8)
 
-#if !defined(__KLIBC__)
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define	__cpu_to_le16(_x) (unsigned int)(_x)
 #define __cpu_to_le32(_x) (unsigned int)(_x)
@@ -221,7 +221,6 @@ struct dlm_lksb {
 #else
 #  error "unknown endianness."
 #endif
-#endif /* __KLIBC__ */
 
 /*
  * Partially stolen from include/linux/unaligned/packed_struct.h
@@ -1530,40 +1529,6 @@ extern void sysfsline(char *line);
 struct stat64;
 #endif
 
-#define HAVE_NFTW  we assume
-#define HAVE_FTW
-
-#ifdef __UCLIBC__
-# include <features.h>
-# ifndef __UCLIBC_HAS_LFS__
-#  define lseek64 lseek
-# endif
-# ifndef  __UCLIBC_HAS_FTW__
-#  undef HAVE_FTW
-#  undef HAVE_NFTW
-# endif
-#endif
-
-#ifdef __dietlibc__
-# undef HAVE_NFTW
-#endif
-
-#if defined(__KLIBC__)
-# undef HAVE_NFTW
-# undef HAVE_FTW
-#endif
-
-#ifndef HAVE_NFTW
-# define FTW_PHYS 1
-# ifndef HAVE_FTW
-  struct FTW {};
-# endif
-#endif
-
-#ifdef HAVE_FTW
-# include <ftw.h>
-#endif
-
 extern int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s);
 
 extern int Manage_ro(char *devname, int fd, int readonly);
-- 
2.43.0


  reply	other threads:[~2025-03-19 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 17:10 [PATCH v0 0/3] mdadm: Use kernel raid headers mtkaczyk
2025-03-19 17:10 ` mtkaczyk [this message]
2025-03-19 17:10 ` [PATCH v0 2/3] mdadm: include asm/byteorder.h mtkaczyk
2025-03-19 17:10 ` [PATCH v0 3/3] mdadm: use kernel raid headers mtkaczyk
2025-03-20  5:45 ` [PATCH v0 0/3] mdadm: Use " Xiao Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319171058.20052-2-mtkaczyk@kernel.org \
    --to=mtkaczyk@kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yukuai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.