• 嵌入式Linux之编译错误


    A问题:

    WARNING: drivers/spi/hi_spi.o(.data+0x0): Section mismatch in reference from the variable hi_spi_platform_driver to the function .init.text:hi_spi_probe()
    The variable hi_spi_platform_driver references
    the function __init hi_spi_probe()
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

    A解决:

      __init同一个c文件用了两处。

      去掉hi_spi_probe()前的__init

    B错误:

    drivers/net/ethernet/hieth-gmac/bcm53101.c:249:13: warning: ‘bcm53101_dump’ defined but not used [-Wunused-function]
    static void bcm53101_dump(void)

    B解决:

      函数写了 没用到。

      屏蔽掉函数

    C错误:

      1 swapper: page allocation failure: order:5, mode:0xd0
      2 CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.20 #27
      3 [<c001324c>] (unwind_backtrace) from [<c0011564>] (show_stack+0x10/0x14)
      4 [<c0011564>] (show_stack) from [<c00756a4>] (warn_alloc_failed+0xc8/0x120)
      5 [<c00756a4>] (warn_alloc_failed) from [<c0077ca4>] (__alloc_pages_nodemask+0x5c0/0x8b0)
      6 [<c0077ca4>] (__alloc_pages_nodemask) from [<c00142e4>] (__dma_alloc_buffer+0x2c/0x84)
      7 [<c00142e4>] (__dma_alloc_buffer) from [<c0014350>] (__alloc_remap_buffer+0x14/0x68)
      8 [<c0014350>] (__alloc_remap_buffer) from [<c0014484>] (__dma_alloc+0xe0/0x1a4)
      9 [<c0014484>] (__dma_alloc) from [<c0014684>] (arm_dma_alloc+0x94/0xa0)
     10 [<c0014684>] (arm_dma_alloc) from [<c04a2804>] (himci_probe+0x250/0x544)
     11 [<c04a2804>] (himci_probe) from [<c01cd3cc>] (platform_drv_probe+0x44/0xa4)
     12 [<c01cd3cc>] (platform_drv_probe) from [<c01cbab4>] (really_probe+0x7c/0x214)
     13 [<c01cbab4>] (really_probe) from [<c01cbd38>] (__driver_attach+0x98/0x9c)
     14 [<c01cbd38>] (__driver_attach) from [<c01ca2b0>] (bus_for_each_dev+0x6c/0x9c)
     15 [<c01ca2b0>] (bus_for_each_dev) from [<c01cb3b4>] (bus_add_driver+0x140/0x1ec)
     16 [<c01cb3b4>] (bus_add_driver) from [<c01cc34c>] (driver_register+0x78/0xf8)
     17 [<c01cc34c>] (driver_register) from [<c04a2b38>] (himci_init+0x40/0xe8)
     18 [<c04a2b38>] (himci_init) from [<c00088fc>] (do_one_initcall+0x80/0x1d4)
     19 [<c00088fc>] (do_one_initcall) from [<c0491cd8>] (kernel_init_freeable+0xf0/0x1b0)
     20 [<c0491cd8>] (kernel_init_freeable) from [<c037b878>] (kernel_init+0x8/0xec)
     21 [<c037b878>] (kernel_init) from [<c000e3a8>] (ret_from_fork+0x14/0x2c)
     22 Mem-info:
     23 Normal per-cpu:
     24 CPU    0: hi:    0, btch:   1 usd:   0
     25 active_anon:0 inactive_anon:0 isolated_anon:0
     26  active_file:0 inactive_file:0 isolated_file:0
     27  unevictable:0 dirty:0 writeback:0 unstable:0
     28  free:64 slab_reclaimable:10 slab_unreclaimable:346
     29  mapped:0 shmem:0 pagetables:0 bounce:0
     30  free_cma:0
     31 Normal free:256kB min:212kB low:264kB high:316kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:8192kB managed:2812kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:40kB slab_unreclaimable:1384kB kernel_stack:168kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes cma_watermark:0kB
     32 lowmem_reserve[]: 0 0 0
     33 Normal: 0*4kB 0*8kB 2*16kB (UM) 1*32kB (U) 1*64kB (U) 1*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 256kB
     34 0 total pagecache pages
     35 0 pages in swap cache
     36 Swap cache stats: add 0, delete 0, find 0/0
     37 Free swap  = 0kB
     38 Total swap = 0kB
     39 2048 pages of RAM
     40 88 free pages
     41 1345 reserved pages
     42 282 slab pages
     43 0 pages shared
     44 0 pages swap cached
     45 himci:himci_probe:1980: no mem for himci dma!
     46 
     47 himci: probe of 100d0000.himciv200.SD failed with error -12
     48 usbcore: registered new interface driver usbhid
     49 usbhid: USB HID core driver
     50 TCP: cubic registered
     51 NET: Registered protocol family 17
     52 lib80211: common routines for IEEE802.11 drivers
     53 swapper invoked oom-killer: gfp_mask=0x2d2, order=0, oom_score_adj=0
     54 CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.20 #27
     55 [<c001324c>] (unwind_backtrace) from [<c0011564>] (show_stack+0x10/0x14)
     56 [<c0011564>] (show_stack) from [<c037c274>] (dump_header+0x44/0x174)
     57 [<c037c274>] (dump_header) from [<c007411c>] (out_of_memory+0x304/0x32c)
     58 [<c007411c>] (out_of_memory) from [<c0077f50>] (__alloc_pages_nodemask+0x86c/0x8b0)
     59 [<c0077f50>] (__alloc_pages_nodemask) from [<c009c0fc>] (__vmalloc_node_range+0xd8/0x228)
     60 [<c009c0fc>] (__vmalloc_node_range) from [<c009c4c8>] (vmalloc+0x44/0x54)
     61 [<c009c4c8>] (vmalloc) from [<c01ac40c>] (n_tty_open+0x10/0x110)
     62 [<c01ac40c>] (n_tty_open) from [<c01b011c>] (tty_ldisc_open+0x48/0x90)
     63 [<c01b011c>] (tty_ldisc_open) from [<c01b09b4>] (tty_ldisc_setup+0x18/0x58)
     64 [<c01b09b4>] (tty_ldisc_setup) from [<c01a9370>] (tty_init_dev+0x88/0x184)
     65 [<c01a9370>] (tty_init_dev) from [<c01a9f08>] (tty_open+0x2e0/0x5f0)
     66 [<c01a9f08>] (tty_open) from [<c00afe84>] (chrdev_open+0xa4/0x14c)
     67 [<c00afe84>] (chrdev_open) from [<c00aa574>] (do_dentry_open+0x1b8/0x2f8)
     68 [<c00aa574>] (do_dentry_open) from [<c00b80e0>] (do_last+0x6bc/0xc74)
     69 [<c00b80e0>] (do_last) from [<c00b8750>] (path_openat+0xb8/0x5ac)
     70 [<c00b8750>] (path_openat) from [<c00b9adc>] (do_filp_open+0x2c/0x88)
     71 [<c00b9adc>] (do_filp_open) from [<c00ab9d4>] (do_sys_open+0xf8/0x1c8)
     72 [<c00ab9d4>] (do_sys_open) from [<c0491cfc>] (kernel_init_freeable+0x114/0x1b0)
     73 [<c0491cfc>] (kernel_init_freeable) from [<c037b878>] (kernel_init+0x8/0xec)
     74 [<c037b878>] (kernel_init) from [<c000e3a8>] (ret_from_fork+0x14/0x2c)
     75 Mem-info:
     76 Normal per-cpu:
     77 CPU    0: hi:    0, btch:   1 usd:   0
     78 active_anon:0 inactive_anon:0 isolated_anon:0
     79  active_file:0 inactive_file:0 isolated_file:0
     80  unevictable:0 dirty:0 writeback:0 unstable:0
     81  free:53 slab_reclaimable:10 slab_unreclaimable:352
     82  mapped:0 shmem:0 pagetables:0 bounce:0
     83  free_cma:0
     84 Normal free:212kB min:212kB low:264kB high:316kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:8192kB managed:2812kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:40kB slab_unreclaimable:1408kB kernel_stack:184kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes cma_watermark:0kB
     85 lowmem_reserve[]: 0 0 0
     86 Normal: 1*4kB (U) 0*8kB 1*16kB (M) 0*32kB 1*64kB (U) 1*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 212kB
     87 0 total pagecache pages
     88 0 pages in swap cache
     89 Swap cache stats: add 0, delete 0, find 0/0
     90 Free swap  = 0kB
     91 Total swap = 0kB
     92 2048 pages of RAM
     93 79 free pages
     94 1345 reserved pages
     95 288 slab pages
     96 0 pages shared
     97 0 pages swap cached
     98 [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
     99 Kernel panic - not syncing: Out of memory and no killable processes...
    100 
    101 CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.20 #27
    102 [<c001324c>] (unwind_backtrace) from [<c0011564>] (show_stack+0x10/0x14)
    103 [<c0011564>] (show_stack) from [<c037bf0c>] (panic+0x80/0x1dc)
    104 [<c037bf0c>] (panic) from [<c0074124>] (out_of_memory+0x30c/0x32c)
    105 [<c0074124>] (out_of_memory) from [<c0077f50>] (__alloc_pages_nodemask+0x86c/0x8b0)
    106 [<c0077f50>] (__alloc_pages_nodemask) from [<c009c0fc>] (__vmalloc_node_range+0xd8/0x228)
    107 [<c009c0fc>] (__vmalloc_node_range) from [<c009c4c8>] (vmalloc+0x44/0x54)
    108 [<c009c4c8>] (vmalloc) from [<c01ac40c>] (n_tty_open+0x10/0x110)
    109 [<c01ac40c>] (n_tty_open) from [<c01b011c>] (tty_ldisc_open+0x48/0x90)
    110 [<c01b011c>] (tty_ldisc_open) from [<c01b09b4>] (tty_ldisc_setup+0x18/0x58)
    111 [<c01b09b4>] (tty_ldisc_setup) from [<c01a9370>] (tty_init_dev+0x88/0x184)
    112 [<c01a9370>] (tty_init_dev) from [<c01a9f08>] (tty_open+0x2e0/0x5f0)
    113 [<c01a9f08>] (tty_open) from [<c00afe84>] (chrdev_open+0xa4/0x14c)
    114 [<c00afe84>] (chrdev_open) from [<c00aa574>] (do_dentry_open+0x1b8/0x2f8)
    115 [<c00aa574>] (do_dentry_open) from [<c00b80e0>] (do_last+0x6bc/0xc74)
    116 [<c00b80e0>] (do_last) from [<c00b8750>] (path_openat+0xb8/0x5ac)
    117 [<c00b8750>] (path_openat) from [<c00b9adc>] (do_filp_open+0x2c/0x88)
    118 [<c00b9adc>] (do_filp_open) from [<c00ab9d4>] (do_sys_open+0xf8/0x1c8)
    119 [<c00ab9d4>] (do_sys_open) from [<c0491cfc>] (kernel_init_freeable+0x114/0x1b0)
    120 [<c0491cfc>] (kernel_init_freeable) from [<c037b878>] (kernel_init+0x8/0xec)
    121 [<c037b878>] (kernel_init) from [<c000e3a8>] (ret_from_fork+0x14/0x2c)
    122 ---[ end Kernel panic - not syncing: Out of memory and no killable processes...

    C解决:

      uboot传参bootargs的mem值太小。

  • 相关阅读:
    JSON数据的解析
    【预测】腾讯后台开发明天面试会被虐死
    c++中对const的总结
    关于需求
    SQLServer 2K 安装重复出现挂起问题解决办法
    通用.Net平台系统框架剖析与设计(简单概括)
    .NET经典资源站点汇总
    petshop4.0研究
    白唬刘备第一
    SQLServer 2K 安装重复出现挂起问题解决办法
  • 原文地址:https://www.cnblogs.com/pokerface/p/6849754.html
Copyright © 2020-2023  润新知