From 75221845e54b9c1130b01544fd498c358f217132 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Mon, 29 Jan 2024 17:06:09 +1100 Subject: [PATCH] Update code for GCC version 12 The only change necessary to update from GCC 10 to GCC 12 is that the option `-g3` needs to be `-g` instead. Why do we have to update to GCC 12? The main motivation is to have the toolchain available for macOS Apple Silicon hosts that want to build the Microkit SDK from source. The toolchain for Apple Silicon hosts is only available from GCC 12 and above. Signed-off-by: Ivan Velickovic --- example/imx8mm_evk/passive_server/Makefile | 4 ++-- example/maaxboard/hello/Makefile | 4 ++-- example/tqma8xqp1gb/ethernet/Makefile | 4 ++-- example/zcu102/hello/Makefile | 4 ++-- libmicrokit/Makefile | 4 ++-- loader/Makefile | 4 ++-- monitor/Makefile | 4 ++-- tests/capfault/Makefile | 4 ++-- tests/overlapping_pages/Makefile | 4 ++-- tests/simplemrs/Makefile | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/example/imx8mm_evk/passive_server/Makefile b/example/imx8mm_evk/passive_server/Makefile index a78ba316..d1a0a486 100644 --- a/example/imx8mm_evk/passive_server/Makefile +++ b/example/imx8mm_evk/passive_server/Makefile @@ -34,7 +34,7 @@ CLIENT_OBJS := client.o BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) IMAGES := server.elf client.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld @@ -47,7 +47,7 @@ $(BUILD_DIR)/%.o: %.c Makefile $(CC) -c $(CFLAGS) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ $(BUILD_DIR)/server.elf: $(addprefix $(BUILD_DIR)/, $(SERVER_OBJS)) $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ diff --git a/example/maaxboard/hello/Makefile b/example/maaxboard/hello/Makefile index b78ab030..e7bdffb0 100644 --- a/example/maaxboard/hello/Makefile +++ b/example/maaxboard/hello/Makefile @@ -33,7 +33,7 @@ HELLO_OBJS := hello.o BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld @@ -46,7 +46,7 @@ $(BUILD_DIR)/%.o: %.c Makefile $(CC) -c $(CFLAGS) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ $(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ diff --git a/example/tqma8xqp1gb/ethernet/Makefile b/example/tqma8xqp1gb/ethernet/Makefile index f87b3358..2e8ebbf5 100644 --- a/example/tqma8xqp1gb/ethernet/Makefile +++ b/example/tqma8xqp1gb/ethernet/Makefile @@ -35,7 +35,7 @@ GPT_OBJS := gpt.o BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) IMAGES := eth.elf pass.elf gpt.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld @@ -48,7 +48,7 @@ $(BUILD_DIR)/%.o: %.c Makefile $(CC) -c $(CFLAGS) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ $(BUILD_DIR)/eth.elf: $(addprefix $(BUILD_DIR)/, $(ETH_OBJS)) $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ diff --git a/example/zcu102/hello/Makefile b/example/zcu102/hello/Makefile index b78ab030..e7bdffb0 100644 --- a/example/zcu102/hello/Makefile +++ b/example/zcu102/hello/Makefile @@ -33,7 +33,7 @@ HELLO_OBJS := hello.o BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld @@ -46,7 +46,7 @@ $(BUILD_DIR)/%.o: %.c Makefile $(CC) -c $(CFLAGS) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ $(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ diff --git a/libmicrokit/Makefile b/libmicrokit/Makefile index 7d0a9f28..3dd5f0b7 100644 --- a/libmicrokit/Makefile +++ b/libmicrokit/Makefile @@ -12,13 +12,13 @@ $(error GCC_CPU must be specified) endif TOOLCHAIN := aarch64-none-elf- -CFLAGS := -std=gnu11 -g3 -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -Wall -Wno-maybe-uninitialized -Wno-unused-function -Werror -Iinclude -I$(SEL4_SDK)/include +CFLAGS := -std=gnu11 -g -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -Wall -Wno-maybe-uninitialized -Wno-unused-function -Werror -Iinclude -I$(SEL4_SDK)/include LIBS := libmicrokit.a OBJS := main.o crt0.o dbg.o $(BUILD_DIR)/%.o : src/%.S - $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g3 -mcpu=$(GCC_CPU) $< -o $@ + $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g -mcpu=$(GCC_CPU) $< -o $@ $(BUILD_DIR)/%.o : src/%.s $(TOOLCHAIN)as -g -mcpu=$(GCC_CPU) $< -o $@ diff --git a/loader/Makefile b/loader/Makefile index 8c431014..cbcc261f 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -21,7 +21,7 @@ endif TOOLCHAIN := aarch64-none-elf- -CFLAGS := -std=gnu11 -g3 -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -DBOARD_$(BOARD) -Wall -Werror +CFLAGS := -std=gnu11 -g -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -DBOARD_$(BOARD) -Wall -Werror PROGS := loader.elf OBJECTS := loader.o crt0.o util64.o @@ -29,7 +29,7 @@ LINKSCRIPT_INPUT := loader.ld LINKSCRIPT := $(BUILD_DIR)/link.ld $(BUILD_DIR)/%.o : src/%.S - $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g3 -mcpu=$(GCC_CPU) $< -o $@ + $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g -mcpu=$(GCC_CPU) $< -o $@ $(BUILD_DIR)/%.o : src/%.s $(TOOLCHAIN)as -g -mcpu=$(GCC_CPU) $< -o $@ diff --git a/monitor/Makefile b/monitor/Makefile index 569f4d2b..194c9601 100644 --- a/monitor/Makefile +++ b/monitor/Makefile @@ -12,14 +12,14 @@ $(error GCC_CPU must be specified) endif TOOLCHAIN := aarch64-none-elf- -CFLAGS := -std=gnu11 -g3 -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -Wall -Wno-maybe-uninitialized -Werror -I$(SEL4_SDK)/include +CFLAGS := -std=gnu11 -g -O3 -nostdlib -ffreestanding -mcpu=$(GCC_CPU) -Wall -Wno-maybe-uninitialized -Werror -I$(SEL4_SDK)/include PROGS := monitor.elf OBJECTS := main.o crt0.o debug.o util.o LINKSCRIPT := monitor.ld $(BUILD_DIR)/%.o : src/%.S - $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g3 -mcpu=$(GCC_CPU) $< -o $@ + $(TOOLCHAIN)gcc -x assembler-with-cpp -c -g -mcpu=$(GCC_CPU) $< -o $@ $(BUILD_DIR)/%.o : src/%.s $(TOOLCHAIN)as -g -mcpu=$(GCC_CPU) $< -o $@ diff --git a/tests/capfault/Makefile b/tests/capfault/Makefile index 68f2735d..3a182f40 100644 --- a/tests/capfault/Makefile +++ b/tests/capfault/Makefile @@ -16,7 +16,7 @@ AS := $(TOOLCHAIN)-as CAPFAULT_OBJS := capfault.o IMAGES := capfault.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include LDFLAGS := -L$(LIBMICROKIT) -Tmicrokit.ld LIBS := -lmicrokit @@ -27,7 +27,7 @@ all: $(IMAGES) $(CC) -c $(CFLAGS) $< -o $@ %.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ capfault.elf: $(CAPFAULT_OBJS) $(LD) $(LDFLAGS) $(CAPFAULT_OBJS) $(LIBS) -o $@ diff --git a/tests/overlapping_pages/Makefile b/tests/overlapping_pages/Makefile index c2e6510d..6a8e3f8f 100644 --- a/tests/overlapping_pages/Makefile +++ b/tests/overlapping_pages/Makefile @@ -16,7 +16,7 @@ AS := $(TOOLCHAIN)-as OVERLAPPING_PAGES_OBJS := overlapping_pages.o IMAGES := overlapping_pages.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include LDFLAGS := -L$(LIBMICROKIT) -Tmicrokit.ld LIBS := -lmicrokit @@ -27,7 +27,7 @@ all: $(IMAGES) $(CC) -c $(CFLAGS) $< -o $@ %.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ overlapping_pages.elf: $(OVERLAPPING_PAGES_OBJS) $(LD) $(LDFLAGS) $(OVERLAPPING_PAGES_OBJS) $(LIBS) -o $@ diff --git a/tests/simplemrs/Makefile b/tests/simplemrs/Makefile index 92f568f8..3ac8f4f7 100644 --- a/tests/simplemrs/Makefile +++ b/tests/simplemrs/Makefile @@ -16,7 +16,7 @@ AS := $(TOOLCHAIN)-as SIMPLEMRS_OBJS := simplemrs.o IMAGES := simplemrs.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include +CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(SEL4_SDK)/include -I$(LIBMICROKIT)/include LDFLAGS := -L$(LIBMICROKIT) -Tmicrokit.ld LIBS := -lmicrokit @@ -27,7 +27,7 @@ all: $(IMAGES) $(CC) -c $(CFLAGS) $< -o $@ %.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ + $(AS) -g -mcpu=$(CPU) $< -o $@ simplemrs.elf: $(SIMPLEMRS_OBJS) $(LD) $(LDFLAGS) $(SIMPLEMRS_OBJS) $(LIBS) -o $@