From f8817bf7af013c71cde853fc4d73c6a797936108 Mon Sep 17 00:00:00 2001 From: Traian Avram Date: Mon, 4 May 2026 10:04:40 +0300 Subject: [PATCH] Lab9/max-c-calls-x86: Actually compile in 32-bit mode The current Makefile invokes the assembler and compiler in 64-bit mode, which causes some errors in max.asm. This patch fixes these issues by essentially copying the flags from the 'max-assembly-calls-x86' task. Signed-off-by: Traian Avram --- labs/lab-09/tasks/max-c-calls-x86/support/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/labs/lab-09/tasks/max-c-calls-x86/support/Makefile b/labs/lab-09/tasks/max-c-calls-x86/support/Makefile index c96576c80..ea173e15e 100644 --- a/labs/lab-09/tasks/max-c-calls-x86/support/Makefile +++ b/labs/lab-09/tasks/max-c-calls-x86/support/Makefile @@ -1,6 +1,7 @@ -CFLAGS = -Wall -g +CFLAGS = -Wall -g -m32 ASM = nasm -ASMFLAGS = -f elf64 -F dwarf +ASMFLAGS = -f elf32 +LDFLAGS = -no-pie .DEFAULT_GOAL: all @@ -9,12 +10,13 @@ ASMFLAGS = -f elf64 -F dwarf all: main main: main.o max.o - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) -m32 $(LDFLAGS) -o $@ $^ + +main.o: main.c + $(CC) $(CFLAGS) -c -o $@ $< max.o: max.asm $(ASM) $(ASMFLAGS) -o $@ $< -main.o: main.c - clean: -rm -f main *.o