mirror of https://github.com/seL4/microkit.git
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 <i.velickovic@unsw.edu.au>
This commit is contained in:
parent
9d8cdd0df7
commit
41cbb7b2de
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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 $@
|
||||
|
|
Loading…
Reference in New Issue