start trying to build rtems with kbuild

printk opentkernel at 163.com
Mon Apr 25 16:23:41 UTC 2016


hi, a11:
I am trying to build rtems with kbuild on linux.
just a hobby, make rtems easier to build on linux.
not support freebsd, windows...
(I guess some company don't use windows or linux,
securty is critical for them. for small companies,
e.g. shenzhen small companies, convenien is more
important.)
but this may make it hard to ship a bsp in lib.
anyway, just for fun. :D
for more infomation about kbuild building and config,
there maybe some video on youtube: compile linux kernel.

repo: (push later)
http://github.com/zhang3/rtems-kbuild

here is some build log:
- - - -
rtems at book:~/rtems-kbuild$ make
  CC      c/src/lib/libcpu/arm/s3c24xx/clock/clockdrv.o
  CC      c/src/lib/libcpu/arm/s3c24xx/clock/support.o
  LD      c/src/lib/libcpu/arm/s3c24xx/clock/built-in.o
  CC      c/src/lib/libcpu/arm/s3c24xx/irq/irq.o
  LD      c/src/lib/libcpu/arm/s3c24xx/irq/built-in.o
  CC      c/src/lib/libcpu/arm/s3c24xx/timer/timer.o
  LD      c/src/lib/libcpu/arm/s3c24xx/timer/built-in.o
  LD      c/src/lib/libcpu/arm/s3c24xx/built-in.o
  LINK    vmlinux
  LD      vmlinux.o
arm-rtems-ld: cannot find arch/arm/kernel/head.o: No such file or directory
c/src/lib/libcpu/arm/s3c24xx/: file not recognized: Is a directory
Makefile:970: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

- - - -

rtems at book:~/rtems-kbuild$ make V=1
make -f ./scripts/Makefile.build obj=c/src/lib/libcpu/arm/s3c24xx
make -f ./scripts/Makefile.build obj=c/src/lib/libcpu/arm/s3c24xx/clock
  arm-rtems-gcc -Wp,-MD,c/src/lib/libcpu/arm/s3c24xx/clock/.clockdrv.o.d  -Ic/src/lib/libcpu/arm/s3c24xx/include -Ic/src/lib/libcpu/arm/include -Ic/src/lib/libcpu/arm/shared/include -Icpukit/score/include -Icpukit/dev/include -Icpukit/include -Icpukit/score/cpu/arm -Ibsp-include -DHAVE_CONFIG_H -DCPU_S3C2410 -D__rtems__ -mlittle-endian -Ic/src/lib/libcpu/arm/s3c24xx/include -fno-dwarf2-cfi-asm -fno-ipa-sra -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCPU_S3C2410 -specs ./c/src/lib/libbsp/arm/smdk2410/bsp_specs    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(clockdrv)"  -D"KBUILD_MODNAME=KBUILD_STR(clockdrv)" -c -o c/src/lib/libcpu/arm/s3c24xx/clock/clockdrv.o c/src/lib/libcpu/arm/s3c24xx/clock/clockdrv.c
  arm-rtems-gcc -Wp,-MD,c/src/lib/libcpu/arm/s3c24xx/clock/.support.o.d  -Ic/src/lib/libcpu/arm/s3c24xx/include -Ic/src/lib/libcpu/arm/include -Ic/src/lib/libcpu/arm/shared/include -Icpukit/score/include -Icpukit/dev/include -Icpukit/include -Icpukit/score/cpu/arm -Ibsp-include -DHAVE_CONFIG_H -DCPU_S3C2410 -D__rtems__ -mlittle-endian -Ic/src/lib/libcpu/arm/s3c24xx/include -fno-dwarf2-cfi-asm -fno-ipa-sra -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCPU_S3C2410 -specs ./c/src/lib/libbsp/arm/smdk2410/bsp_specs    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(support)"  -D"KBUILD_MODNAME=KBUILD_STR(support)" -c -o c/src/lib/libcpu/arm/s3c24xx/clock/support.o c/src/lib/libcpu/arm/s3c24xx/clock/support.c
   arm-rtems-ld -EL    -r -o c/src/lib/libcpu/arm/s3c24xx/clock/built-in.o c/src/lib/libcpu/arm/s3c24xx/clock/clockdrv.o c/src/lib/libcpu/arm/s3c24xx/clock/support.o
(cat /dev/null; ) > c/src/lib/libcpu/arm/s3c24xx/clock/modules.order
make -f ./scripts/Makefile.build obj=c/src/lib/libcpu/arm/s3c24xx/irq
  arm-rtems-gcc -Wp,-MD,c/src/lib/libcpu/arm/s3c24xx/irq/.irq.o.d  -Ic/src/lib/libcpu/arm/s3c24xx/include -Ic/src/lib/libcpu/arm/include -Ic/src/lib/libcpu/arm/shared/include -Icpukit/score/include -Icpukit/dev/include -Icpukit/include -Icpukit/score/cpu/arm -Ibsp-include -DHAVE_CONFIG_H -DCPU_S3C2410 -D__rtems__ -mlittle-endian -Ic/src/lib/libcpu/arm/s3c24xx/include -fno-dwarf2-cfi-asm -fno-ipa-sra -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCPU_S3C2410 -specs ./c/src/lib/libbsp/arm/smdk2410/bsp_specs    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(irq)"  -D"KBUILD_MODNAME=KBUILD_STR(irq)" -c -o c/src/lib/libcpu/arm/s3c24xx/irq/irq.o c/src/lib/libcpu/arm/s3c24xx/irq/irq.c
   arm-rtems-ld -EL    -r -o c/src/lib/libcpu/arm/s3c24xx/irq/built-in.o c/src/lib/libcpu/arm/s3c24xx/irq/irq.o
(cat /dev/null; ) > c/src/lib/libcpu/arm/s3c24xx/irq/modules.order
make -f ./scripts/Makefile.build obj=c/src/lib/libcpu/arm/s3c24xx/timer
  arm-rtems-gcc -Wp,-MD,c/src/lib/libcpu/arm/s3c24xx/timer/.timer.o.d  -Ic/src/lib/libcpu/arm/s3c24xx/include -Ic/src/lib/libcpu/arm/include -Ic/src/lib/libcpu/arm/shared/include -Icpukit/score/include -Icpukit/dev/include -Icpukit/include -Icpukit/score/cpu/arm -Ibsp-include -DHAVE_CONFIG_H -DCPU_S3C2410 -D__rtems__ -mlittle-endian -Ic/src/lib/libcpu/arm/s3c24xx/include -fno-dwarf2-cfi-asm -fno-ipa-sra -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCPU_S3C2410 -specs ./c/src/lib/libbsp/arm/smdk2410/bsp_specs    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(timer)"  -D"KBUILD_MODNAME=KBUILD_STR(timer)" -c -o c/src/lib/libcpu/arm/s3c24xx/timer/timer.o c/src/lib/libcpu/arm/s3c24xx/timer/timer.c
   arm-rtems-ld -EL    -r -o c/src/lib/libcpu/arm/s3c24xx/timer/built-in.o c/src/lib/libcpu/arm/s3c24xx/timer/timer.o
(cat /dev/null; ) > c/src/lib/libcpu/arm/s3c24xx/timer/modules.order
   arm-rtems-ld -EL    -r -o c/src/lib/libcpu/arm/s3c24xx/built-in.o c/src/lib/libcpu/arm/s3c24xx/clock/built-in.o c/src/lib/libcpu/arm/s3c24xx/irq/built-in.o c/src/lib/libcpu/arm/s3c24xx/timer/built-in.o
(cat /dev/null;   cat c/src/lib/libcpu/arm/s3c24xx/clock/modules.order;   cat c/src/lib/libcpu/arm/s3c24xx/irq/modules.order;   cat c/src/lib/libcpu/arm/s3c24xx/timer/modules.order;) > c/src/lib/libcpu/arm/s3c24xx/modules.order
  /bin/bash scripts/link-vmlinux.sh arm-rtems-ld -EL  -p --no-undefined -X --pic-veneer --build-id
+ '[' arm-rtems-ld = clean ']'
+ case "${KCONFIG_CONFIG}" in
+ . ./.config
++ CONFIG_ARM=y
++ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
++ CONFIG_STACKTRACE_SUPPORT=y
++ CONFIG_HAVE_LATENCYTOP_SUPPORT=y
++ CONFIG_LOCKDEP_SUPPORT=y
++ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
++ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
++ CONFIG_FIX_EARLYCON_MEM=y
++ CONFIG_GENERIC_HWEIGHT=y
++ CONFIG_GENERIC_CALIBRATE_DELAY=y
++ CONFIG_NEED_DMA_MAP_STATE=y
++ CONFIG_ARCH_SUPPORTS_UPROBES=y
++ CONFIG_VECTORS_BASE=0xffff0000
++ CONFIG_ARM_PATCH_PHYS_VIRT=y
++ CONFIG_NEED_MACH_IO_H=y
++ CONFIG_PGTABLE_LEVELS=2
++ CONFIG_MMU=y
++ CONFIG_ARCH_S3C24XX=y
++ CONFIG_MULTI_IRQ_HANDLER=y
++ CONFIG_VMSPLIT_3G=y
++ CONFIG_PAGE_OFFSET=0xC0000000
++ CONFIG_ARCH_NR_GPIO=512
++ CONFIG_HZ_FIXED=200
++ CONFIG_HZ=200
++ CONFIG_HAVE_ARCH_PFN_VALID=y
++ CONFIG_CPU_SW_DOMAIN_PAN=y
++ CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
++ CONFIG_FORCE_MAX_ZONEORDER=11
++ CONFIG_SWIOTLB=y
++ CONFIG_IOMMU_HELPER=y
++ CONFIG_USE_OF=y
++ CONFIG_ATAGS=y
++ CONFIG_ZBOOT_ROM_TEXT=0x0
++ CONFIG_ZBOOT_ROM_BSS=0x0
++ CONFIG_CMDLINE=
++ CONFIG_AUTO_ZRELADDR=y
+ info LD vmlinux.o
+ '[' '' '!=' silent_ ']'
+ printf '  %-7s %s\n' LD vmlinux.o
  LD      vmlinux.o
+ modpost_link vmlinux.o
+ arm-rtems-ld -EL -r -o vmlinux.o arch/arm/kernel/head.o --start-group c/src/lib/libcpu/arm/s3c24xx/ --end-group
arm-rtems-ld: cannot find arch/arm/kernel/head.o: No such file or directory
c/src/lib/libcpu/arm/s3c24xx/: file not recognized: Is a directory
+ on_exit
+ '[' 1 -ne 0 ']'
+ cleanup
+ rm -f .old_version
+ rm -f .tmp_System.map
+ rm -f '.tmp_kallsyms*'
+ rm -f .tmp_version
+ rm -f '.tmp_vmlinux*'
+ rm -f System.map
+ rm -f vmlinux
+ rm -f vmlinux.o
Makefile:970: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1


...
duhuanpeng.

...
duhuanpeng.



More information about the devel mailing list