Hello,
first: sorry if this is the wrong forum. I didn't find any better one and here are the most xdc related questions....
Following the "xdctools getting started guide", I tried to implement my own minimal example. After a bit of work, it's almost working, but I get an undefined reference to `atexit`. It seems that this was a known bug in elder xdctools and this post suggests that it should be fixed in my version (3.22.01.21).
What's wrong and how can I fix it? For now, I'm not allowed to update xdc...
That's the output with the error:
----------------------------8<------------------------------------
gru@pc-cm-gru-virtlinux1 % make clean hello
rm -f hello
rm -f hello.o
rm -Rf mycfg
xs xdc.tools.configuro -t gnu.targets.arm.GCArmv7A -b ./config.bld mycfg.cfg
making package.mak (because of package.bld) ...
generating interfaces for package mycfg (because package/package.xdc.inc is older than package.xdc) ...
configuring mycfg.pv7A from package/cfg/mycfg_pv7A.cfg ...
clv7A package/cfg/mycfg_pv7A.c ...
/opt/blafasel/toolchain-arm/opt/ext-toolchain/bin/arm-none-linux-gnueabi-gcc -march=armv7-a -I"/opt/ti/xdctools_3_22_01_21/packages" -I"/opt/ti/xdctools_3_22_01_21/packages" -I"/home/gru/projects/tests/mycfg/.." -Dxdc_target_types__="gnu/targets/arm/std.h" -Dxdc_target_name__=GCArmv7A -Dxdc_cfg__header__="/home/gru/projects/tests/mycfg/package/cfg/mycfg_pv7A.h" -c hello.c
/opt/blafasel/toolchain-arm/opt/ext-toolchain/bin/arm-none-linux-gnueabi-ld -o hello hello.o -T mycfg/linker.cmd -lstdc++
/opt/blafasel/toolchain-arm/opt/ext-toolchain/bin/arm-none-linux-gnueabi-ld: warning: cannot find entry symbol _start; defaulting to 00009860
/opt/ti/xdctools_3_22_01_21/packages/gnu/targets/arm/rtsv7A/lib/gnu.targets.arm.rtsv7A.av7A(System.ov7A): In function `xdc_runtime_System_Module_startup(void)':
System.c:(.text.xdc_runtime_System_Module_startup__F+0x14): undefined reference to `atexit'
make: *** [hello] Error 1
---------------------------->8------------------------------------
My makefile:
----------------------------8<------------------------------------
CGTOOLS = /opt/blafasel/toolchain-arm/opt/ext-toolchain
CC = $(CGTOOLS)/bin/arm-none-linux-gnueabi-gcc
LNK = $(CGTOOLS)/bin/arm-none-linux-gnueabi-ld
RTS = -lstdc++
CONFIG = mycfg
XDCTARGET = gnu.targets.arm.GCArmv7A
%/linker.cmd %/compiler.opt : %.cfg
xs xdc.tools.configuro -t $(XDCTARGET) -b ./config.bld $<
all: hello
.PHONY: clean
.SECONDARY: $(CONFIG)/compiler.opt
%.o : %.c # forget built-in rule
%.o : %.c $(CONFIG)/compiler.opt
$(CC) $(shell cat $(CONFIG)/compiler.opt) -c $<
hello : hello.o $(CONFIG)/linker.cmd
$(LNK) -o $@ hello.o -T $(CONFIG)/linker.cmd $(RTS)
clean:
rm -f hello
rm -f hello.o
rm -Rf $(CONFIG)
---------------------------->8------------------------------------
My config.bld:
----------------------------8<------------------------------------
var GCArmv7A = xdc.useModule('gnu.targets.arm.GCArmv7A');
GCArmv7A.rootDir="/opt/blafasel/toolchain-arm/opt/ext-toolchain";
GCArmv7A.LONGNAME="/bin/arm-none-linux-gnueabi-gcc"
---------------------------->8------------------------------------