我在編譯內核的時候也不知道是個人編譯方式有問題仍是其餘的緣由(使用的是天嵌E8的開發板附帶的源碼,cpu是三星的s5pv210,內核版本3.0.8),遇到了不少的問題,下面就是我遇到的一些問題和解決方案,有些方案是我在網上找,有些是我本身想的,若是有什麼不對的,請告知,謝謝!linux
問題1:
drivers/gpio/janz-ttl.c
implicit declaration of function 'iowrite16be'
解決方案:
添加宏定義:#define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr))函數
問題2:
drivers/char/s3c_mem.c中沒有mach/map.h
解決方案:
去掉該文件中#include <mach/map.h>orm
問題3:
drivers/input/touchscreen/eeti_ts.c:65: error: implicit declaration of function 'irq_to_gpio'
解決方案:
a、raumfeld.c
static struct eeti_ts_platform_data eeti_ts_pdata = {
.irq_active_high = 1,
.gpio = GPIO_TOUCH_IRQ,//添加
};
b、/drivers/input/touchscreen/eeti_ts.c
struct eeti_ts_priv {
struct input_dev *input;
struct work_struct work;
struct mutex mutex;
int irq, irq_active_high;//刪除
int irq, gpio, irq_active_high;//添加
};
static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
{
return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;//刪除
return gpio_get_value(priv->gpio) == priv->irq_active_high;//添加
}ci
if (pdata)
priv->irq_active_high = pdata->irq_active_high;
替換爲
if (pdata) {
priv->gpio = pdata->gpio;
priv->irq_active_high = pdata->irq_active_high;
}
c、/include/linux/input/eeti_ts.h
struct eeti_ts_platform_data {
unsigned int irq_active_high;
unsigned int gpio;//添加
};開發
問題4:
drivers/mfd/ezx-pcap.c:205: error: implicit declaration of function 'irq_to_gpio'
解決方案:
這個由於沒有找到解決的辦法,因此就本身定義了這個變量get
問題5:
drivers/mmc/core/mmc_ops.c:20:22: error: plat/cpu.h: No such file or directory
解決方案:
將頭文件去掉input
問題6:
drivers/mmc/host/sdhci.c中:S3C64XX_SDHCI_CONTROL4,S3C64XX_SDHCI_CONTROL4_BUSY未定義
解決方案:
頭文件所在arch/arm/plat-samsung/include/plat/regs-sdhci.h中
實在不行就將定義拷過去編譯器
問題7:
drivers/scsi/osd/osd_initiator.c:67: error: size of array 'type name' is negative
解決方案:
註釋掉報錯的行,該內容定義之後並未被使用源碼
問題8:
drivers/scsi/advansys.c:8376: error: implicit declaration of function 'dma_cache_sync'
解決方案:
該函數已經被放棄了,直接註釋it
問題9:
EABI版本不一致,連接失敗
解決方案:
這個是由編譯器版本太高致使的,在內核編譯選項中選擇Kernel Features中的Use the ARM EABI to compile the kernel
問題10:
drivers/staging/dt3155v4l/dt3155v4l.c:434: error: implicit declaration of function 'kzalloc'
解決方案:
添加頭文件<linux/slab.h>
問題11:
drivers/staging/iio/accel/lis3l02dq_core.c:708: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/accel/lis3l02dq_ring.c:297: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/accel/sca3000_core.c:1169: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/imu/adis16400_core.c:822: error: implicit declaration of function 'irq_to_gpio'
解決方案:
這幾個文件中的引用頭文件中<linux/gpio.h>包含了該函數的定義
問題12:
drivers/staging/solo6x10/core.c:140: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/p2m.c:52: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/enc.c:101: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/g723.c:139: error: implicit declaration of function 'kzalloc'
解決方案:
添加頭文件#include <linux/slab.h>
問題13:drivers/staging/vme/bridges/vme_tsi148.c:130: error: implicit declaration of function 'ioread32be'drivers/staging/vme/bridges/vme_tsi148.c:133: error: implicit declaration of function 'ioread32be'drivers/tty/serial/uartlite.c:79: error: implicit declaration of function 'ioread32be'drivers/tty/serial/uartlite.c:125: error: implicit declaration of function 'iowrite32be'解決方案:#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr))#define ioread32be(addr) be32_to_cpu(ioread32(addr))