This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Building ti.drivers.*: Library *_tivaware.a already exists

Having difficulty rebuilding the ti.drivers.* modules. The build scripts appear to be adding the libraries to the build list more than once for some reason. Any tips on debugging XDC build system: how does one print output from .bld, .xs, .cfg (other than throwing an exception)? Also, the answer to this related question [1] would help here.

Host: Linux x86, toolchain: arm-non-eabi-gcc [2]
Target in config.bld: gnu.targets.arm.M4
Hardware: Tiva C Launchpad TM4C123GXL
Note: other XDC modules build just fine

[1] http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/299200.aspx
[2] https://launchpad.net/gcc-arm-embedded


$ xs xdc.tools.repoman -c -p .../tirtos_1_10_00_23/packages -r ../repo ti.drivers
$ cd ../repo/ti/drivers/
$ cp .../config.bld .
$ xdc XDCOPTIONS=-v XDCPATH=.../tirtos_1_10_00_23/packages/
#
# making package.mak (because of package.bld) ...
.../xdctools_3_25_03_72/xs  -Dxdc.path=".../tirtos_1_10_00_23/packages/;.../xdctools_3_25_03_72/packages;../.." -Dxdc.root=.../xdctools_3_25_03_72 -Dxdc.hostOS=Linux -Dconfig.importPath=".;.../tirtos_1_10_00_23/packages/;..../xdctools_3_25_03_72/packages;../..;..../xdctools_3_25_03_72;.../xdctools_3_25_03_72/etc" -Dxdc.bld.targets="" -DTOOLS=   -f .../xdctools_3_25_03_72/packages/xdc/bld/bld.js ./config.bld package.bld package.mak
js: ".../tirtos_1_10_00_23/packages/ti/tirtos/build/common.bld", line 138: xdc.services.global.XDCException: xdc.bld.LIBRARY_EXISTS: Library 'lib/instrumented/usbmschfatfs_tivaware.am4g' already exists.
    "./package.bld", line 176
gmake: *** Deleting file `package.mak'
gmake: *** No rule to make target `package.mak', needed by `.interfaces'.  Stop.

  • The LIBRARY_EXISTS error happened because it was building for two profiles at once: debug and release. The error went away by specifying XDCARGS=profile=debug along with the other env vars to passed to xdc (see above).

    The print() statements works nice from the build scripts.


    The remaining two obstacles before ti.drivers.* could be built by gcc:
    (1) stdint.h had to be included to get the uint32_t type names (I put it into gnu/targets/arm/std.h)
    UPDATE: with TI RTOS v1.21.00.09 and XDC Tools v3.25.05.94 (and using the tirtos.mak, which I was not before), the ti.drivers package builds without any stdint.h issues, however the application fails with same error upon inclusion of ti/drivers headers, so placed an include <stdint.h> before every ti/driver header include in the app.

    (2) the hardcoded (!) target-based suffixes ("em4f") in ti/drivers/package.xs had to be changed to correspond to the suffix for the target specified in the .cfg ("m4g", in my case). FIXED in XDC Tools v3.25.05.94.

    UPDATE:
    (3) In XDC Tools v3.25.05.94 some syscall definitions were removed, so to link the application with arm-none-eabi-, had to define _kill and _getpid in the app source by copying them from the old syscall.c.,