guix-mirrors/gnu/packages/patches/psm2-compile-ctor-without-avx.patch
Nigko Yerden eadf133bb0
gnu: psm2: Compile init constructor without AVX flags.
* gnu/packages/linux.scm (psm2)[source]<origin>{patches}: New field.
Add patch to it.
* gnu/packages/patches/psm2-compile-ctor-without-avx.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register it.

Fixes: guix/guix#1446

Change-Id: I150ddc86c2948063e6e13f11014c42e96b553b75
Signed-off-by: Andreas Enge <andreas@enge.fr>
2025-07-25 14:53:40 +02:00

41 lines
No EOL
1.5 KiB
Diff

Subject: Fix issue https://codeberg.org/guix/guix/issues/1446
Author: Nigko Yerden <nigko.yerden@gmail.com>
Date: 2025-07-25
License: gpl3+
diff --git a/opa/Makefile b/opa/Makefile
index 2692886..368973b 100644
--- a/opa/Makefile
+++ b/opa/Makefile
@@ -74,6 +74,7 @@ ${TARGLIB}-objs := opa_debug.o opa_time.o \
${TARGLIB}-objs := $(patsubst %.o, $(OUTDIR)/%.o, ${${TARGLIB}-objs})
DEPS := $(${TARGLIB}-objs:.o=.d)
+BASECFLAGS_NO_AVX := $(filter-out -mavx -mavx2 -mavx512f, $(BASECFLAGS))
.PHONY: all clean
IGNORE_DEP_TARGETS = clean
@@ -84,13 +85,21 @@ install: all
@echo "Nothing to do for install."
$(OUTDIR)/%.d: $(this_srcdir)/%.c
- $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o)
+ if [ "$<" = "$(this_srcdir)/opa_debug.c" ] || [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \
+ $(CC) $(CFLAGS) $(BASECFLAGS_NO_AVX) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o); \
+ else \
+ $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o); \
+ fi
$(OUTDIR)/%.d: $(this_srcdir)/%.S
$(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o)
$(OUTDIR)/%.o: $(this_srcdir)/%.c | ${DEPS}
- $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) -c $< -o $@
+ if [ "$<" = "$(this_srcdir)/opa_debug.c" ] || [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \
+ $(CC) $(CFLAGS) $(BASECFLAGS_NO_AVX) $(INCLUDES) -c $< -o $@; \
+ else \
+ $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) -c $< -o $@; \
+ fi
$(OUTDIR)/%.o: $(this_srcdir)/%.S | ${DEPS}
$(CC) $(ASFLAGS) -c $< -o $@