u-boot独立应用程序 [英] u-boot standalone application

查看:97
本文介绍了u-boot独立应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在编译u-boot独立应用程序时遇到了以下错误,我已经实现了独立应用程序,可以对连接的外围设备进行测试。下面是编译代码时显示的错误。请帮忙



Hi all,
I''m getting below error while compiling the u-boot standalone application, i have implemented the standalone app which does testing on the peripherals connected. below is the error displayed while compiling the code..Please help out

framework/diag/bit_main.o: In function `atoi':
diag/test/main.c:466: undefined reference to `strlen'
diag/test/main.c:296: undefined reference to `strtok'
diag/test/main.c:297: undefined reference to `strtok'

here is the  Makefile->

<pre lang="vb">include $(TOPDIR)/config.mk

ELF := test
#COBJS   := $(ELF:=.o)
COBJS += diag/test/main.o
COBJS += diag/test/display.o
COBJS += diag/test/menu.o
LIB    = $(obj)libbitstubs.a

LIBAOBJS-$(ARCH)     :=
LIBAOBJS-$(CPU)      :=

LIBCOBJS = stubs.o

LIBOBJS  = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))

SRCS    := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
OBJS    := $(addprefix $(obj),$(COBJS))

gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)

CPPFLAGS += -I..

all: $(obj) $(LIB) $(ELF)

$(ELF): $(OBJS) $(LIB)
        $(LD) -Ttext $(STANDALONE_LOAD_ADDR) -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $^ -L$(gcclibdir) -lgcc
#                       $(CC) -o $@ -t $(LIB) -L$(gcclibdir) -lgcc
#                       $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
                        -o $@ -e bit_main $< $(LIB)  \
                        -L$(gcclibdir) -lgcc
#                       $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
                        -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(OBJS) \
                        -L$(gcclibdir) -lgcc

$(LIB):                 $(obj).depend $(LIBOBJS)
                        $(AR) $(ARFLAGS) $@ $(LIBOBJS)



#########################################################################

# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend

#########################################################################

推荐答案

(TOPDIR)/config.mk

ELF:= test
#COBJS:=
(TOPDIR)/config.mk ELF := test #COBJS :=


(ELF:= .o)
COBJS + = diag / test / main.o
COBJS + = diag / test / display.o
COBJS + = diag / test / menu.o
< span class =code-keyword> LIB =
(ELF:=.o) COBJS += diag/test/main.o COBJS += diag/test/display.o COBJS += diag/test/menu.o LIB =


(obj)libbitstubs.a

LIBAOBJS -
(obj)libbitstubs.a LIBAOBJS-


这篇关于u-boot独立应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆