Skip to contentSkip to conversation

dbench: fixes for latest glibc

PATCH New Luis Chamberlain 1 participant 5 messages Feb 9, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

cover dbench: fixes for latest glibc

debian testing dropped dbench...

I looked into it and it turns out that this has to do with it not compiling anymore.

glibc nuked rpc/rpc.h and so libtirpc-devel is needed now. This fixes this and few other minor issues when trying to compile dbench on a modern distro.

fstests generic/241 uses dbench and so I'm Cc'ing the fstests list as folks there would be interested. I'm not sure when and if the dbench git repo from samba will be updated so I just put this up on my git tree in case this helps others:

https://github.com/mcgrof/dbench

Luis Chamberlain (4):
configure.in: rename to configure.ac config.h.in: run autoheader and update
Makefile: address deprecation of /usr/include/rpc libnfs.c: fix compilation due to intptr_t move

 Makefile.in                  | 14 ++++++++------
 config.h.in                  | 18 ++++++++++++------
 configure.in => configure.ac |  0
 libnfs.c                     |  1 +
 4 files changed, 21 insertions(+), 12 deletions(-)
 rename configure.in => configure.ac (100%)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/4 configure.in: rename to configure.ac

autoheader complains and tell us to rename configure.in to configure.ac. Let's do that.

---
 configure.in => configure.ac | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename configure.in => configure.ac (100%)
configure.ac renamed from configure.in +0 -0
similarity index 100%
rename from configure.in
rename to configure.ac
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/4 Makefile: address deprecation of /usr/include/rpc

In reply to Luis Chamberlain

/usr/include/rpc is now removed from glibc. Software which uses that should use libtirpc-devel, and to make it work we should use pkg-config against that library.

Fix making dbench compile again for rpc stuff.

---
 Makefile.in | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
Makefile.in +8 -6
index 00af80e..a12affb 100644
@@ -15,6 +15,8 @@ LIBS=@LIBS@ -lpopt -lz @LIBSMBCLIENT@ @LIBISCSI@
 DESTDIR=/
 CC=@CC@
 CFLAGS=@CFLAGS@ -I. -DVERSION=\"$(VERSION)\" -DDATADIR=\"$(datadir)\"
+CFLAGS+=`pkg-config --cflags libtirpc`
+LIBS+=`pkg-config --libs libtirpc`
 EXEEXT=@EXEEXT@
 
 LIBNFS_OBJ = libnfs.o mount_client.o nfs_client.o mount_xdr.o nfs_xdr.o
@@ -40,11 +42,11 @@ libnfs.a: $(LIBNFS_OBJ)
 
 nfsio.o: nfsio.c mount.h nfs.h
 	@echo Compiling $@
-	gcc -g -c nfsio.c -o $@
+	gcc -g $(CFLAGS) -c nfsio.c -o $@
 
 libnfs.o: libnfs.c libnfs.h mount.h nfs.h
 	@echo Compiling $@
-	gcc -g -c libnfs.c -o $@
+	gcc -g $(CFLAGS) -c libnfs.c -o $@
 
 mount.h: mount.x
 	@echo Generating $@
@@ -56,7 +58,7 @@ nfs.h: nfs.x
 
 mount_xdr.o: mount_xdr.c mount.h
 	@echo Compiling $@
-	gcc -g -c mount_xdr.c -o $@
+	gcc -g $(CFLAGS) -c mount_xdr.c -o $@
 
 mount_xdr.c: mount.x
 	@echo Generating $@
@@ -64,7 +66,7 @@ mount_xdr.c: mount.x
 
 mount_client.o: mount_client.c mount.h
 	@echo Compiling $@
-	gcc -g -c mount_client.c -o $@
+	gcc -g $(CFLAGS) -c mount_client.c -o $@
 
 mount_client.c: mount.x
 	@echo Generating $@
@@ -72,7 +74,7 @@ mount_client.c: mount.x
 
 nfs_xdr.o: nfs_xdr.c nfs.h
 	@echo Compiling $@
-	gcc -g -c nfs_xdr.c -o $@
+	gcc $(CFLAGS) -g -c nfs_xdr.c -o $@
 
 nfs_xdr.c: nfs.x
 	@echo Generating $@
@@ -80,7 +82,7 @@ nfs_xdr.c: nfs.x
 
 nfs_client.o: nfs_client.c nfs.h
 	@echo Compiling $@
-	gcc -g -c nfs_client.c -o $@
+	gcc -g $(CFLAGS) -c nfs_client.c -o $@
 
 nfs_client.c: nfs.x
 	@echo Generating $@
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/4 libnfs.c: fix compilation due to intptr_t move

In reply to Luis Chamberlain

intptr_t is now part of thread_db.h, so include that file to make it compile again.

dbench now at least compiles on debian testing.

---
 libnfs.c | 1 +
 1 file changed, 1 insertion(+)
libnfs.c +1 -0
index 1f60ef0..edbcd61 100644
@@ -17,6 +17,7 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 #define _FILE_OFFSET_BITS 64
+#include <thread_db.h>
 #include "mount.h"
 #include "nfs.h"
 #include "libnfs.h"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/4 config.h.in: run autoheader and update

In reply to Luis Chamberlain

Run autoheader and update config.h.in based on the latest autotools.

---
 config.h.in | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
config.h.in +12 -6
index 0b8a24f..82d417b 100644
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the `asprintf' function. */
 #undef HAVE_ASPRINTF
@@ -121,9 +121,6 @@
 /* Define to 1 if you have the `lsetxattr' function. */
 #undef HAVE_LSETXATTR
 
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
@@ -139,6 +136,9 @@
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
@@ -171,6 +171,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
@@ -219,10 +222,13 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+   required in a freestanding environment). This macro is provided for
+   backward compatibility; new code need not use it. */
 #undef STDC_HEADERS
 
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
+   macro is obsolete. */
 #undef TIME_WITH_SYS_TIME
 
 /* Define _GNU_SOURCE so that we get all necessary prototypes */
Signature · 1 line
2.34.1