Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » 'atexit' error when upgrading to xdctools 3.16
'atexit' error when upgrading to xdctools 3.16 [message #630417] Sat, 02 October 2010 01:24 Go to next message
sgspecker is currently offline sgspeckerFriend
Messages: 8
Registered: July 2009
Junior Member
I'm having trouble building a simple hello world C program (app.x86U) that uses the System_printf() function from xdc.runtime.System. The program builds fine under xdctools 3.15.xx, but fails under 3.16.xx and 3.20.xx. (The host environment is Ubuntu 10.04.)

The error reads: System.c:(.text+0x8ec): undefined reference to `atexit'

There's also a warning about "linker.cmd contains output sections; did you forget -T?", but I'm not sure if this is the cause, or what it's really telling me to do.

This seems like a migration issue, but I can't seem to find any suggestions or warnings in the release notes.

The program is about as simple as it gets. A single call to System_printf(). It doesn't even use any arguments.

I dislike attaching long strings to emails, but I'm copying the full make listing in case it helps to decipher the problem.

Scott
-----
making package.mak (because of package.bld) ...
generating interfaces for package app_cfg (because package/package.xdc.inc is older than package.xdc) ...
configuring app_cfg.x86U from package/cfg/app_cfg_x86U.cfg ...
cl86U package/cfg/app_cfg_x86U.c ...
Configuro has completed; it's results are in app_cfg

/usr/bin/gcc -g -I" /home/user/ti-dvsdk_omap3530-evm_4_00_00_17/xdctools_3_16_03 _36/packages " -I" /home/user/ti-dvsdk_omap3530-evm_4_00_00_17/xdctools_3_16_03 _36/packages " -I"/home/user/omap/soln05c_x86_configuro/app/app_cfg/.." -isystem /usr/include -isystem /usr/lib/gcc/i486-linux-gnu/4.4.3/include -Dxdc_target_types__="gnu/targets/std.h" -Dxdc_target_name__=Linux86 -Dxdc_cfg__header__=" /home/user/omap/soln05c_x86_configuro/app/app_cfg/package/cf g/app_cfg_x86U.h " -c app.c -o app.o
/usr/bin/gcc -g -lstdc++ app.o app_cfg/linker.cmd -o app.x86U
/usr/bin/ld: warning: app_cfg/linker.cmd contains output sections; did you forget -T?
/home/user/ti-dvsdk_omap3530-evm_4_00_00_17/xdctools_3_16_03 _36/packages/gnu/targets/rts86U/lib/gnu.targets.rts86U.a86U( System.o86U): In function `xdc_runtime_System_Module_startup(void)':
System.c:(.text+0x8ec): undefined reference to `atexit'
collect2: ld returned 1 exit status
make: *** [app.x86U] Error 1
-----
Re: 'atexit' error when upgrading to xdctools 3.16 [message #630418 is a reply to message #630417] Sat, 02 October 2010 02:40 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Scott,
we know what the problem is. There was a change in binutils between 2.18 and 2.19, such that a SECTIONS directive in a linker command script is not accepted in 2.19 unless the script is passed with -T, and another directive is added to the linker script.

XDCtools generates a linker command script and adds it to the command line (app_cfg/linker.cmd in your case). The reason it all worked in 3.15 is that we did not have any SECTIONS directives in the generated linker command script.

The fix will be available in 3.21 and possibly in some 3.20 patch. There is a workaround, but for that you'll need to edit a file in your XDCtools installation.
In <xdctools>/packages/gnu/targets/linkcmd.xdt, you can remove everything from and including the line
var _utils = xdc.loadCapsule("gnu/targets/linkUtils.xs");
until the end of that file.






icon14.gif  Re: 'atexit' error when upgrading to xdctools 3.16 [message #630420 is a reply to message #630418] Sat, 02 October 2010 04:51 Go to previous messageGo to next message
sgspecker is currently offline sgspeckerFriend
Messages: 8
Registered: July 2009
Junior Member
The workaround did the trick.

Thanks for your help!

Scott
Re: 'atexit' error when upgrading to xdctools 3.16 [message #754690 is a reply to message #630420] Thu, 03 November 2011 20:52 Go to previous messageGo to next message
alan  is currently offline alan Friend
Messages: 2
Registered: November 2011
Junior Member
hello

i'm having the same problem as you, you mentioned that the workaround did the trick, but i don't have clear how you modify the file linkcmd.xdt i'm positng the way mi file looks, hopefully you can tell where to modify it, since i know this it's an old post, thanks in advance


%%{
/*
* Copyright (c) 2008 Texas Instruments and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* eclipse.org/legal/epl-v10.html
*
* Contributors:
* Texas Instruments - initial implementation
*
* */

/* Linker templates are passed the following arguments:
* $out - an open file stream for the generated linker
* command file
* $args[] - array of zero or more libraries that should be linked
* with (in the order they appear in the argument list)
*
* We can't add "'s around names; otherwise the GNU linker looks for names
* with "'s.
*
* The GNU linker accepts any text file as "command files", so there is no
* need to use a special option to identify them. In fact, if you use the
* -T option you must also include the default linker command file (which
* defines the memory map, sections, etc). By not using -T, this command
* file "accumulates" with the default.
*/

/* get the GNU compiler version from the version number returned by ITarget */
var VERSION = this.build.target.version.split(',')[2] - 0;

/* guess(!) the default leading prefix convention for this compiler */
var PREFIX = this.build.target.os == "Windows" ? "_" : "";
%%}
/* this file was generated by linkcmd.xdt from the gnu.targets package */

/* function aliases */
%if (prog.build.profile.match(/blas/) == null) {
% for (var keys = this.$$aliases.keys(); keys.hasMoreElements(); ) {
% var key = keys.nextElement();
`PREFIX + key` = `PREFIX + this.$$aliases.get(key)`;
% }
%}

%if ($args.length > 0) {
/* input libraries */
INPUT(
%for (var i = 0; i < $args.length; i++) {
"`$args[i]`"
%}
)
%}

%var _utils = xdc.loadCapsule("gnu/targets/linkUtils.xs");
%/* Mingw compilers do not work with the SECTIONS directive.
% */
%if (prog.build.target.$name != "gnu.targets.Mingw") {
SECTIONS {
`_utils.genSections(prog)`
}

%if (xdc.om['xdc.runtime.Text'].isLoaded != true) {
ASSERT(ADDR(xdc.noload) + SIZEOF(xdc.noload) < ADDR(.rodata)
|| ADDR(.rodata) + SIZEOF(.rodata) < ADDR(xdc.noload),
"Sections .rodata and xdc.noload overlap. See xdc.runtime.Text.isLoaded for more.")
%}
%} // end of the workaround for Mingw
%%{
/*
* @(#) gnu.targets; 1, 0, 1,370; 11-25-2009 10:23:05; /db/atree/library/trees/xdctargets/xdctargets-b28x/src/
*/

%%}
Re: 'atexit' error when upgrading to xdctools 3.16 [message #754879 is a reply to message #754690] Fri, 04 November 2011 17:55 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
If you upgrade to XDCtools 3.22, you will not need a workaround, but if you can't upgrade just remove the part of the file that begins with
%var _utils = xdc.loadCapsule("gnu/targets/linkUtils.xs");
all the way to the end of the file.
Re: 'atexit' error when upgrading to xdctools 3.16 [message #754903 is a reply to message #754879] Fri, 04 November 2011 20:35 Go to previous messageGo to next message
alan  is currently offline alan Friend
Messages: 2
Registered: November 2011
Junior Member
Thank you very much Sasha, that workaround did the trick, by the way, i also upgraded to the version 3.22, but that didn't work either, thank again
Re: 'atexit' error when upgrading to xdctools 3.16 [message #755291 is a reply to message #754903] Mon, 07 November 2011 23:11 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Which version of 3.22 failed? Is the error message the same one?
Re: 'atexit' error when upgrading to xdctools 3.16 [message #755878 is a reply to message #755291] Wed, 09 November 2011 23:01 Go to previous messageGo to next message
Kai  is currently offline Kai Friend
Messages: 1
Registered: November 2011
Junior Member
I just tried xdctools 3.22.01.21, I still failed to build ti-codec-engine apps.

| Engine.c:(.text+0x2b64): undefined reference to `__aeabi_uidiv'
| /home/tang/Projects/OE/build/tmp/work/beagleboard-angstrom-linux-gnueabi/ti-codec-engine-2_25_02_11-r102a/codec_engine_2_25_02_11/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(Global_noOS.ov5T): In function `Global_atexit':
| Global_noOS.c:(.text+0x238): undefined reference to `atexit'
| /home/tang/Projects/OE/build/tmp/sysroots/beagleboard-angstrom-linux-gnueabi/usr/share/ti/ti-dsplink-tree/packages/dsplink/gpp/export/BIN/Linux/OMAP3530/RELEASE/dsplink.lib: In function `_RingIO_writerAcquire':
| mplist.c:(.text+0x26c0): undefined reference to `__aeabi_uidivmod'
| mplist.c:(.text+0x27f4): undefined reference to `__aeabi_uidivmod'
| mplist.c:(.text+0x2830): undefined reference to `__aeabi_uidivmod'
| /home/tang/Projects/OE/build/tmp/sysroots/beagleboard-angstrom-linux-gnueabi/usr/share/ti/ti-dsplink-tree/packages/dsplink/gpp/export/BIN/Linux/OMAP3530/RELEASE/dsplink.lib: In function `_RingIO_readerAcquire':
| mplist.c:(.text+0x2a90): undefined reference to `__aeabi_uidivmod'
| mplist.c:(.text+0x2db8): undefined reference to `__aeabi_uidivmod'
| /home/tang/Projects/OE/build/tmp/sysroots/beagleboard-angstrom-linux-gnueabi/usr/share/ti/ti-dsplink-tree/packages/dsplink/gpp/export/BIN/Linux/OMAP3530/RELEASE/dsplink.lib:mplist.c:(.text+0x30ac): more undefined references to `__aeabi_uidivmod' follow
| /home/tang/Projects/OE/build/tmp/sysroots/beagleboard-angstrom-linux-gnueabi/usr/share/ti/ti-dsplink-tree/packages/dsplink/gpp/export/BIN/Linux/OMAP3530/RELEASE/dsplink.lib: In function `DRV_installCleanupRoutines':
| mplist.c:(.text+0xd3e0): undefined reference to `atexit'
| collect2: ld returned 1 exit status
| make[1]: *** [bin/ti_platforms_evm3530/app_remote.xv5T] Error 1
| gmake: *** [/home/tang/Projects/OE/build/tmp/work/beagleboard-angstrom-linux-gnueabi/ti-codec-engine-2_25_02_11-r102a/codec_engine_2_25_02_11/examples/ti/sdo/ce/examples/apps/speech,.executables] Error 2
| make[1]: *** [all] Error 2
| make[1]: Leaving directory `/home/tang/Projects/OE/build/tmp/work/beagleboard-angstrom-linux-gnueabi/ti-codec-engine-2_25_02_11-r102a/codec_engine_2_25_02_11/examples/ti/sdo/ce/examples/apps/speech'
| make: *** [all] Error 2
NOTE: package ti-codec-engine-2_25_02_11-r102a: task do_compile: Failed
Re: 'atexit' error when upgrading to xdctools 3.16 [message #949111 is a reply to message #755878] Thu, 18 October 2012 17:51 Go to previous messageGo to next message
Len White is currently offline Len WhiteFriend
Messages: 1
Registered: October 2012
Junior Member
Is there any known solution to this same problem?
I'm experiencing it as well and have searched and searched for clues to a solution.
So far I'm not coming up with much.
This is an old thread so I'm working with much newer versions of these components.
I'm on Ubuntu 12 building for a Beagleboard XM, kernel 3.8.x, Angstrom.

I bitbaked most of the components (like xdc) as dependencies from "bitbake ti-codec-engine".

Interestingly, the SECTION problem (as well as INSERT AFTER) in linker.cmd no longer is an issue (once adding the -T option into the linker.cmd file manually).

But those undefined reference errors persist. Clearly it's not seeing the necessary libraries.
Which libraries contain those functions? That might help me track down the problem.

If anyone has any ideas I'm all ears.
I'm obviously pretty new to embedded programming so I apologize for my ignorance, though I've been spending days and days researching like a professor trying to solve these issues.

Thanks.
-Len

PS: For what it's worth, I've been trying to rebuild the OpenCV DSP Acceleration google code project that is quite a bit outdated at this point.
Re: 'atexit' error when upgrading to xdctools 3.16 [message #954407 is a reply to message #949111] Tue, 23 October 2012 01:36 Go to previous message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Len,
the problem from Kai's post does not seem related to XDCtools, or at least I am not familiar enough with Codec Engine to trace the issue to XDCtools. You should post your problem to this forum http://e2e.ti.com/support/embedded/linux/f/354.aspx and you'll probably get a better response. I am following that forum too, and if it turns out that the problem is indeed related to XDCtools, I'll answer there.
Previous Topic:file name too long error (windows)
Next Topic:Additional information
Goto Forum:
  


Current Time: Wed Apr 24 23:48:40 GMT 2024

Powered by FUDForum. Page generated in 0.03191 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top