Files
xen/tools/libfsimage/Rules.mk
T
Alejandro Vallejo 766126159e libfsimage/xfs: Add compile-time check to libfsimage
Adds the common tools include folder to the -I compile flags
of libfsimage. This allows us to use:
  xen-tools/common-macros.h:BUILD_BUG_ON()

With it, statically assert a sanitized "blocklog - SECTOR_BITS" cannot
underflow.

This is part of XSA-443 / CVE-2023-34325

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 7d85c70431)
2023-09-27 16:29:50 +01:00

35 lines
848 B
Makefile

include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ $(CFLAGS_xeninclude) -DFSIMAGE_FSDIR=\"$(FSDIR)\"
CFLAGS += -Werror -D_GNU_SOURCE
LDFLAGS += -L../common/
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
FSDIR = $(libdir)/xenfsimage
FSLIB = fsimage.so
.PHONY: fs-all
fs-all: $(FSLIB)
.PHONY: fs-install
fs-install: fs-all
$(INSTALL_DIR) $(DESTDIR)$(FSDIR)/$(FS)
$(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)/$(FS)
.PHONY: fs-uninstall
fs-uninstall:
rm -f $(addprefix $(DESTDIR)$(FSDIR)/$(FS)/, $(FSLIB))
if [ -d $(DESTDIR)$(FSDIR)/$(FS) ]; then \
rmdir $(DESTDIR)$(FSDIR)/$(FS); \
fi
$(FSLIB): $(PIC_OBJS)
$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lxenfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
clean distclean::
rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
-include $(DEPS_INCLUDE)