aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-05-11 23:08:08 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-05-11 23:08:08 +0300
commit5cb26317c8b39890abd247335885fe6f4c07146e (patch)
treee40a08106c7b54c2d59cfda857cc892348fb30b4
parent27ffa747f36aee9c1d5bbc61395a078238366070 (diff)
downloadkmi-5cb26317c8b39890abd247335885fe6f4c07146e.tar.gz
kmi-5cb26317c8b39890abd247335885fe6f4c07146e.zip
only init is pic and fix a warning
-rw-r--r--Makefile4
-rw-r--r--common/uapi/dispatch.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 89f8033..3d70d6b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ DEBUGFLAGS != [ $(RELEASE) ] \
&& echo "-flto -O2 -DNDEBUG" \
|| echo "-O0 -DDEBUG"
-CFLAGS = -ffreestanding -nostdlib -fno-pie -std=c17 -Wall -Wextra -Wvla -D$(ARCH) -g -fpic
+CFLAGS = -ffreestanding -nostdlib -fno-pie -std=c17 -Wall -Wextra -Wvla -D$(ARCH) -g
DEPFLAGS = -MT $@ -MMD -MP -MF $@.d
LINTFLAGS = -fsyntax-only
PREPROCESS = -E
@@ -71,7 +71,7 @@ KERNEL_LINK := arch/$(ARCH)/conf/kernel-link
INIT_LINK := arch/$(ARCH)/conf/init-link
KERN_FLAGS != [ $(UBSAN) ] && echo -fsanitize=undefined || echo
-INIT_FLAGS :=
+INIT_FLAGS := -fpic
KERNEL_OBJECTS != ./scripts/gen-deps --kernel --compile "$(KERNEL_SOURCES)"
INIT_OBJECTS != ./scripts/gen-deps --init --compile "$(INIT_SOURCES)"
diff --git a/common/uapi/dispatch.c b/common/uapi/dispatch.c
index 8db7982..8ffbf54 100644
--- a/common/uapi/dispatch.c
+++ b/common/uapi/dispatch.c
@@ -36,9 +36,7 @@ SYSCALL_DEFINE0(noop)(struct tcb *t)
*/
SYSCALL_DEFINE1(putch)(struct tcb *t, sys_arg_t a)
{
- const char c[2] = {a, 0};
- MAYBE_UNUSED(c);
- dbg((const char *)&c);
+ dbg("%c", (char)a);
set_args(t, SYS_RET1(OK));
}