summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorSASANO Takayoshi <[email protected]>2018-10-06 18:33:18 +0900
committerSASANO Takayoshi <[email protected]>2018-10-06 18:33:18 +0900
commit86742879f3631e2fb995291877f9bdb98e4a0107 (patch)
tree0b5b8aa77d3be7f3a14373889c9ae96dacf2de5f /bsp
parentee1e316d1ead8e9dddfe45d066f2e7864072e032 (diff)
There is no problem to create hello.mo with default compiler on
Debian-9.5/amd64. But building hello.mo with i386-elf-gcc (5.5.0) cross compiler on OpenBSD-6.3/amd64, undefined reference to 'rt_kprintf' error occurs. To avoid this error, "compile and link" process needs to be divided to simply "compile" and "link". On Debian-9.5, both previous and current method produces same hello.mo. We have to improve disk image creation (Linux dependent), this is a future homework.
Diffstat (limited to 'bsp')
-rw-r--r--bsp/x86/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/bsp/x86/Makefile b/bsp/x86/Makefile
index cdb4f4ca8c..eb4654193b 100644
--- a/bsp/x86/Makefile
+++ b/bsp/x86/Makefile
@@ -7,7 +7,7 @@ all: rtthread rtsym exe dll floppy.img
@sudo mount -t vfat floppy.img tmp -o loop
@sudo cp -fv rtthread.elf tmp/boot/oskernel
@sudo rm tmp/bin/* -fr
- @sudo cp out/* tmp/bin/ -fv
+ @sudo cp out/*.mo tmp/bin/ -fv
@sudo umount tmp
rtthread:
@@ -23,7 +23,8 @@ out:
mkdir -p out
dll: obj out
- $(CC) -shared -s -fPIC -e main -Isrc src/hello.c -o out/hello.mo
+ $(CC) -c -fPIC -Isrc src/hello.c -o out/hello.o
+ $(CC) -s -Wl,-shared,-melf_i386,--entry=main -o out/hello.mo out/hello.o
disasm: obj out
$(CC) -shared -S -fPIC -Isrc src/hello.c -o obj/hello.s