aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config2
-rw-r--r--Kconfig2
-rw-r--r--Makefile2
-rw-r--r--Makefile.config6
-rw-r--r--i686/sys/control.h6
-rw-r--r--i686/toolchain.mk4
-rw-r--r--rules.mk6
7 files changed, 16 insertions, 12 deletions
diff --git a/.config b/.config
index 038981e..b406c20 100644
--- a/.config
+++ b/.config
@@ -2,7 +2,7 @@
#
# Toolchain
#
-CONFIG_CCFLAGS="-g"
+CONFIG_CFLAGS="-g -Og"
CONFIG_LDFLAGS=""
# end of Toolchain
diff --git a/Kconfig b/Kconfig
index 52eba30..c8ce103 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1,5 +1,5 @@
menu "Toolchain"
- config CCFLAGS
+ config CFLAGS
string "Additional C compiler flags"
config LDFLAGS
string "Additional linker flags"
diff --git a/Makefile b/Makefile
index 5f6fbd7..262cd97 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ info:
@echo " ARCH ${ARCH}"
@echo " MAKE $(shell ${MAKE} --version | head -n1)"
@echo " CC $(shell ${CC} --version | head -n1)"
- @echo " ${CCFLAGS}"
+ @echo " ${CFLAGS}"
@echo " LD $(shell ${LD} --version | head -n1)"
@echo " ${LDFLAGS}"
diff --git a/Makefile.config b/Makefile.config
index 47176b4..1ea871c 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -2,7 +2,7 @@
#
# Toolchain
#
-CONFIG_CCFLAGS="-g"
+CONFIG_CFLAGS="-g -Og"
CONFIG_LDFLAGS=""
# end of Toolchain
@@ -28,8 +28,8 @@ ARCH=i686
#
AS := i686-elf-as
CC := i686-elf-gcc
-CCFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only
-CCFLAGS += $(shell echo ${CONFIG_CCFLAGS})
+CFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only
+CFLAGS += $(shell echo ${CONFIG_CFLAGS})
LD := i686-elf-ld
LDFLAGS := -static -nostdlib
LDFLAGS += $(shell echo ${CONFIG_LDFLAGS})
diff --git a/i686/sys/control.h b/i686/sys/control.h
index 1b38472..7dde3c8 100644
--- a/i686/sys/control.h
+++ b/i686/sys/control.h
@@ -3,9 +3,13 @@
static inline void
abort()
{
- asm volatile(R"(cli
+ /* Symbol h is already defined?
+asm volatile(R"(cli
h: hlt
jmp h)");
+*/
+ asm volatile(R"(cli
+hlt)");
}
static inline void
diff --git a/i686/toolchain.mk b/i686/toolchain.mk
index 6f69cdb..43c758c 100644
--- a/i686/toolchain.mk
+++ b/i686/toolchain.mk
@@ -4,8 +4,8 @@ ARCH=i686
#
AS := i686-elf-as
CC := i686-elf-gcc
-CCFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only
-CCFLAGS += $(shell echo ${CONFIG_CCFLAGS})
+CFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 -mgeneral-regs-only
+CFLAGS += $(shell echo ${CONFIG_CFLAGS})
LD := i686-elf-ld
LDFLAGS := -static -nostdlib
LDFLAGS += $(shell echo ${CONFIG_LDFLAGS})
diff --git a/rules.mk b/rules.mk
index 1083874..ada9789 100644
--- a/rules.mk
+++ b/rules.mk
@@ -6,7 +6,7 @@ $(foreach V,$(filter %.SRCS, ${.VARIABLES}),\
)
# extra flags
-CCFLAGS += -isysteminclude -I../lib
+CFLAGS += -isysteminclude -I../lib
# Suffix rules
%.a:
@@ -20,11 +20,11 @@ CCFLAGS += -isysteminclude -I../lib
.S.o:
@echo ' CC $^'
- @$(CC) $(CCFLAGS) -c -o $@ $^
+ @$(CC) $(CFLAGS) -c -o $@ $^
.c.o:
@echo ' CC $^'
- @$(CC) $(CCFLAGS) -c -o $@ $^
+ @$(CC) $(CFLAGS) -c -o $@ $^
# Test rules
tst/test_%: tst/%.cc