fio: a couple build fixes
cover fio: a couple build fixes
Maybe it's just me, but t/io_uring.c doesn't link for me without -laio when CONFIG_LIBAIO is set.
I also got a report that dynamic engines aren't properly picking up LDFLAGS set by the build system (in this case, -Wl,-z,now).
So these two patches try to resolve those issues.
PATCH 1/2 t/io_uring: link with libaio when necessary
When CONFIG_LIBAIO is enabled, we need t/io_uring to link with it. (libaio_LIBS only affects the aio engine, AFAICT.)
---
Makefile +1 -0
@@ -99,6 +99,7 @@ endif ifdef CONFIG_LIBAIO libaio_SRCS = engines/libaio.c cmdprio_SRCS = engines/cmdprio.c + LIBS += -laio libaio_LIBS = -laio ENGINES += libaio endif
PATCH 2/2 fio: use LDFLAGS when linking dynamic engines
In reply to Eric SandeenWithout this, locally defined LDFLAGS won't be applied when linking the dynamically loaded IO engines.
---
Makefile +1 -1
@@ -294,7 +295,7 @@ define engine_template = $(1)_OBJS := $$($(1)_SRCS:.c=.o) $$($(1)_OBJS): CFLAGS := -fPIC $$($(1)_CFLAGS) $(CFLAGS) engines/fio-$(1).so: $$($(1)_OBJS) - $$(QUIET_LINK)$(CC) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS) + $$(QUIET_LINK)$(CC) $(LDFLAGS) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS) ENGS_OBJS += engines/fio-$(1).so endef else # !CONFIG_DYNAMIC_ENGINES
PATCH v2 2/2 fio: use LDFLAGS when linking dynamic engines
Without this, locally defined LDFLAGS won't be applied when linking the dynamically loaded IO engines.
---
V2: Seems like V1 inexplicably got whitespace damaged, sorry, let's try again :/
Makefile +1 -1
@@ -294,7 +295,7 @@ define engine_template = $(1)_OBJS := $$($(1)_SRCS:.c=.o) $$($(1)_OBJS): CFLAGS := -fPIC $$($(1)_CFLAGS) $(CFLAGS) engines/fio-$(1).so: $$($(1)_OBJS) - $$(QUIET_LINK)$(CC) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS) + $$(QUIET_LINK)$(CC) $(DYNAMIC) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS) ENGS_OBJS += engines/fio-$(1).so endef else # !CONFIG_DYNAMIC_ENGINES
Jens Axboe
AppliedQuoted 7 lines · Eric Sandeen
Maybe it's just me, but
t/io_uring.cdoesn't link for me without -laio whenCONFIG_LIBAIOis set.I also got a report that dynamic engines aren't properly picking up LDFLAGS set by the build system (in this case, -Wl,-z,now).
So these two patches try to resolve those issues.
Applied, thanks Eric. On the patches, looks like format=flowed is set, which may explain why it ends up being borken.
Signature · 1 line
Jens Axboe