codeblocks中自己做的向导,在链接的时候出错。怎么办。

发布于 2021-11-17 14:32:42 字数 3183 浏览 928 评论 2

是从一个makefile

如下:

# Blacksun Empire g++ MakeFile generator
# This is a machine generated file-do not edit
# 2012/9/14 13:21:55


TOOLROOT = C:/Cygnus/arm-tools/i686-pc-cygwin/bin
CC = $(TOOLROOT)/arm-elf-gcc
CXX = $(TOOLROOT)/arm-elf-g++
OBJCOPY = $(TOOLROOT)/arm-elf-objcopy
AR = $(TOOLROOT)/arm-elf-ar
LD = $(TOOLROOT)/arm-elf-ld
OUTPUT_DIR = ./
OUTPUT_NAME = ./qiping.elf
OUTPUT_BIN   = ./qiping.bin
LIB = C:/Cygnus/arm-tools/i686-pc-cygwin/arm-elf/lib
GCCLIB = C:/Cygnus/arm-tools/i686-pc-cygwin/lib/gcc-lib/arm-elf/3.0.3


TEXT = 1280000
DATA = 0003000
BSS = 0020000


INC_PATH = -I"C:/Cygnus/arm-tools/i686-pc-cygwin/arm-elf/include" -I"C:/Cygnus/arm-tools/i686-pc-cygwin/lib/gcc-lib/arm-elf/3.0.3/include" -I"./Include"
DEFINE = 
CPPFLAGS = $(INC_PATH) $(DEFINE)
ENDIAN_AS = -Wa,-EL
ENDIANFLAG = -mlittle-endian  -A 'endian(little)'
CFLAGS += $(INC_PATH) $(DEFINE) $(ENDIANFLAG) -fno-rtti -DMACHINE_TYPE_ARM  -w -O0 -g -gdwarf-2
ASFLAGS = -x assembler-with-cpp -Wa,--gstabs -Wa,-mall $(ENDIAN_AS)
LDFLAGS = -n -N -nostartupfiles -static -EL -e_start -g
LINK_DIR = ./
LINK_SCRIPT := "C:CygnusGMakerGMaker.LD"
LIBS = ./lib/p130.a ./lib/p130-flash.a $(LIB)/libm.a $(LIB)/libc.a $(GCCLIB)/libgcc.a


SOURCES =  cstartup_flash.s main.c function.c
OBJECTS :=  cstartup_flash.o main.o function.o


all: $(OBJECTS) $(OUTPUT_NAME) $(OUTPUT_BIN)
cstartup_flash.o: cstartup_flash.s
$(CC) -c $(CFLAGS) $(ASFLAGS) cstartup_flash.s
main.o: main.c
$(CC) -c $(CFLAGS) main.c
function.o: function.c
$(CC) -c $(CFLAGS) function.c


$(OUTPUT_NAME): $(OBJECTS)
$(LD) -Ttext $(TEXT) -Tdata $(DATA) -Tbss $(BSS) $(LDFLAGS) -L"$(LINK_DIR)" -T$(LINK_SCRIPT) -o $@ $^ $(LIBS)


$(OUTPUT_BIN): $(OUTPUT_NAME)
$(OBJCOPY) -R .data -R .rdata -R .sbss -R .bss  -O binary $(OUTPUT_NAME) tempbin.1
$(OBJCOPY) -R .text -R .rodata --change-section-address .data=0 -O binary $(OUTPUT_NAME) tempbin.2
cat -B tempbin.1 tempbin.2 > $(OUTPUT_BIN)
rm tempbin.1 tempbin.2
rm -f $(OBJECTS)


做了一个向导,但是在编译时出错,怎么办

[100.0%] arm-elf-ld.exe -Ldefaultsrc  -o defaultP130.elf defaultsrccstartup_flash.o defaultsrcmain.o   -T ld/target.ld -v -Ttext 1280000 -Tdata 0008000 -Tbss  0003000 -n -N -nostartupfiles -static -EL -e_start -g  libfile_sys.a libP130.a C:/Cygnus/arm-tools/i686-pc-cygwin/arm-elf/lib/libm.a C:/Cygnus/arm-tools/i686-pc-cygwin/arm-elf/lib/libc.a C:/Cygnus/arm-tools/i686-pc-cygwin/lib/gcc-lib/arm-elf/3.0.3/libgcc.a 
arm-elf-ld: Error: highbios.o uses hard floating point, whereas startupfiles uses soft floating point
File format not recognized: failed to merge target specific data of file libP130.a(highbios.o)


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

疑心病 2021-11-19 12:17:43

自己顶

少女情怀诗 2021-11-17 17:35:32

没有吗

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文