目次: GCC
組み込み系CPU向けクロスコンパイラの定番といえばCodeSourceryですが、ダウンロードのページに行くためにはユーザー登録が必要で、面倒くさいよー、という方も居ると思います。
ARM向けに限りますが、別の選択肢としてLinaroが公開しているクロスコンパイラという手があります。CodeSourcery同様にお手軽に使えるPrebuild版も用意してくれていますので、使い方には困らないと思います。
# 取得する wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.15.tar.xz wget http://releases.linaro.org/14.07/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux.tar.xz # 展開する tar xJvf linux-3.14.15.tar.xz tar xJvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux.tar.xz # ビルドする export ARCH=arm export CROSS_COMPILE=/home/katsuhiro/share/arm_cross/gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux/bin/arm-linux-gnueabihf- cd linux-3.14.15 make KBUILD_DEFCONFIG=versatile_defconfig defconfig make -j4
ビルド成功したようなので、自作ARMv5エミュレータに放り込んでみました。
Connected to the target VM, address: '127.0.0.1:49748', transport: 'socket' Exception: Reset by 'Init.'. [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 3.14.15 (katsuhiro@falcon) (gcc version 4.9.1 20140710 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.07 - Linaro GCC 4.9-2014.07) ) #1 Fri Aug 8 15:38:54 JST 2014 [ 0.000000] CPU: ARM926EJ-S [41069260] revision 0 (ARMv5TEJ), cr=00003137 [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] Machine: ARM-Versatile PB [ 0.000000] Ignoring unrecognised tag 0x00000000 [ 0.000000] Memory policy: Data cache writeback [ 0.000000] On node 0 totalpages: 16384 [ 0.000000] free_area_init_node: node 0, pgdat c03c4ce8, node_mem_map c3f7a000 [ 0.000000] Normal zone: 128 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 16384 pages, LIFO batch:3 [ 0.003317] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns [ 0.029105] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.031450] pcpu-alloc: [0] 0 [ 0.042642] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 [ 0.045733] Kernel command line: console=ttyAMA0 mem=64M lpj=0 root=/dev/nfs debug printk.time=1 [ 0.093627] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.109772] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.173519] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.734098] Memory: 60952K/65536K available (2817K kernel code, 157K rwdata, 732K rodata, 115K init, 116K bss, 4584K reserved) [ 0.754145] Virtual kernel memory layout: [ 0.754145] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.754145] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) [ 0.754145] vmalloc : 0xc4800000 - 0xff000000 ( 936 MB) [ 0.754145] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) [ 0.754145] modules : 0xbf000000 - 0xc0000000 ( 16 MB) [ 0.754145] .text : 0xc0008000 - 0xc037f900 (3551 kB) [ 0.754145] .init : 0xc0380000 - 0xc039ccd4 ( 116 kB) [ 0.754145] .data : 0xc039e000 - 0xc03c5420 ( 158 kB) [ 0.754145] .bss : 0xc03c5420 - 0xc03e2774 ( 117 kB) [ 0.835624] NR_IRQS:224 [ 1.433660] VIC @f1140000: id 0x00041190, vendor 0x41 [ 1.480147] FPGA IRQ chip 0 "SIC" @ f1003000, 13 irqs, parent IRQ: 63 [ 1.600891] Console: colour dummy device 80x30 [ 1.608749] Calibrating delay loop... 6.52 BogoMIPS (lpj=32640) [ 2.220671] pid_max: default: 32768 minimum: 301 [ 2.257974] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 2.263175] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 2.424212] CPU: Testing write buffer coherency: ok [ 2.471352] Setting up static identity map for 0x802ae5b8 - 0x802ae610 [ 3.001781] VFP support v0.3: no double precision support [ 3.085927] NET: Registered protocol family 16 [ 3.237579] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 3.885257] Serial: AMBA PL011 UART driver [ 3.909160] dev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 44, base_baud = 0) is a PL011 rev1 [ 4.214325] console [ttyAMA0] enabled UARTIMSC: 0x00000000 UARTICR: 0x0000ffff [ 4.292449] dev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 45, base_baud = 0) is a PL011 rev1 UARTIMSC: 0x00000000 UARTICR: 0x0000ffff [ 4.371940] dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 46, base_baud = 0) is a PL011 rev1 UARTIMSC: 0x00000000 UARTICR: 0x0000ffff [ 4.454404] fpga:09: ttyAMA3 at MMIO 0x10009000 (irq = 70, base_baud = 0) is a PL011 rev1 [ 5.788310] bio: create slab <bio-0> at 0 SYS_LED: 0x000000ff SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 SYS_LED: read 0x00000000 [ 6.329351] Switched to clocksource timer3 [ 8.419343] NET: Registered protocol family 2 [ 8.592061] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 8.613714] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 8.632315] TCP: Hash tables configured (established 1024 bind 1024) [ 8.652642] TCP: reno registered [ 8.659583] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 8.675257] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 8.750198] NET: Registered protocol family 1 [ 8.820467] RPC: Registered named UNIX socket transport module. [ 8.827386] RPC: Registered udp transport module. [ 8.833482] RPC: Registered tcp transport module. [ 8.839809] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 8.932090] NetWinder Floating Point Emulator V0.97 (double precision) [ 9.113116] futex hash table entries: 256 (order: -1, 3072 bytes) Exception: Data abort by 'MMU trans sec, paL1:0x80004000, entryL1:0x00000000, va:0x00000000, dom:0, inst:dat, priv:user, read:rd.'. [ 9.275864] Installing knfsd (copyright (C) 1996 okir@monad.swb.de). [ 9.309731] jffs2: version 2.2. (NAND) Ac 2001-2006 Red Hat, Inc. [ 9.368658] ROMFS MTD (C) 2007 Red Hat, Inc. [ 9.378358] msgmni has been set to 119 [ 9.461972] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) [ 9.469946] io scheduler noop registered [ 9.475694] io scheduler deadline registered [ 9.485652] io scheduler cfq registered (default) Exception in thread "main" java.lang.IllegalArgumentException: Illegal address 0x00000410. at net.katsuster.semu.Controller64Reg32.isValidReg(Controller64Reg32.java:57) at net.katsuster.semu.GPIO.tryAccess(GPIO.java:79) at net.katsuster.semu.GPIO.tryWrite(GPIO.java:69) at net.katsuster.semu.Bus64.tryWrite(Bus64.java:168) at net.katsuster.semu.MasterCore64.tryWrite(MasterCore64.java:96) at net.katsuster.semu.ARMv5.executeStrb(ARMv5.java:3303) at net.katsuster.semu.ARMv5.executeSubLdrStr(ARMv5.java:4492) at net.katsuster.semu.ARMv5.executeInst(ARMv5.java:4074) at net.katsuster.semu.ARMv5.execute(ARMv5.java:4055) at net.katsuster.semu.ARMv5.step(ARMv5.java:5201) at net.katsuster.semu.CPU.run(CPU.java:158) at net.katsuster.semu.Main.main(Main.java:252) java.lang.IllegalArgumentException: Illegal address 0x00000410. pc:c0179db4 Disconnected from the target VM, address: '127.0.0.1:49748', transport: 'socket' Process finished with exit code 1
GPIOデバイスにアクセスに行くらしく途中で怒られました。GPIOなんて何に使っているんでしょう?他にもボードのLEDを光らせるみたいですが、何したいんだろう…これ。
< | 2014 | > | ||||
<< | < | 08 | > | >> | ||
日 | 月 | 火 | 水 | 木 | 金 | 土 |
- | - | - | - | - | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | - | - | - | - | - | - |
合計:
本日:
管理者: Katsuhiro Suzuki(katsuhiro( a t )katsuster.net)
This is Simple Diary 1.0
Copyright(C) Katsuhiro Suzuki 2006-2023.
Powered by PHP 8.2.20.
using GD 2.3.3(png support.)