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.

Compiler: GNU Linker makefile error

Tool/software: TI C/C++ Compiler

Hi All,

  I would greatly appreciate any help on this.  As a caveat I am quite inexperienced with coding development suites, formal coding, etc.  I have some experience (not at university level) in C programming but am working  to learn assembly language and microprocessor design.  I am having trouble linking a simple program to multiply two arrays and placing products in a third array.  I have attached the error log and I am interested more than anything the first of 7 errors I get.

Please refer to attached .txt file but essentially it is:

makefile:139: recipe for target 'multiply-array.out' failed

The hardware/software I am using are:

host system Apple OX10.14.6 (Mojave) with Oracle VirtualBox 6.1 (with extension pack added) hosting Ubuntu 18.04 LTS (updated recently)

TI CCS version 8.1.3.00004

Microprocessor: BeagleBone Black rev C

Emulator: Blackhawk XDS100V2-D

The program syntax is ok I think (I can provide a copy of this as well if helpful)

I had trouble finding the GNU linker under Project Explorer so entered under 'GNU Build' the name of  object code file as multiply-array.out and map file as as multiply-array.map.  I don't see a way to NOT use standard system startup files when linking (-nostartfiles).

Basically I am trying to debug this program hoping that correctly the first error may help "downstream".

I read through this forum and may have missed it but didn't see anything I could figure out how to apply to this situation. 

I attempted to install updates as I read that this can resolve makefile issue but got error:

***

An error occurred while configuring the installed items
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Configure, operand=null --> [R]com.ti.targetcontent.zipselector.notmac 1.0.0.201811251509, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CopyAction).
I/O Error while copying /home/dojo/ccsv8/eclipse/features/com.ti.targetcontent_1.0.0.201811251509/com.ti.targetcontent.properties - see details.
Error while copying:/home/dojo/ccsv8/eclipse/features/com.ti.targetcontent_1.0.0.201811251509/com.ti.targetcontent.properties

***

Thank you very much in advance, I appreciate in help.

Regards,

Rick

**** Build Finished ****

**** Build of configuration Debug for project multiply-array ****

/home/dojo/ccsv8/utils/bin/gmake -k -j 2 all -O 
 
Building target: "multiply-array.out"
Invoking: GNU Linker
"/home/dojo/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc" -mtune=cortex-a8 -marm -Dam3359 -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mcpu=cortex-a8 -Wl,-Map,"multiply-array.map" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"multiply-array.out" "./multiply-array.o" "./startup_ARMCA8.o" -Wl,-T"../AM335x.lds"  
makefile:139: recipe for target 'multiply-array.out' failed
./multiply-array.o: In function `_start':
/home/dojo/workspace_v8/multiply-array/Debug/../multiply-array.s:12: multiple definition of `_start'
/home/dojo/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-ar/crt0.o:(.text+0x0): first defined here
/home/dojo/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-ar/crt0.o: In function `_start':
(.text+0x4a): undefined reference to `main'
collect2: error: ld returned 1 exit status
gmake[1]: *** [multiply-array.out] Error 1
gmake: *** [all] Error 2
makefile:135: recipe for target 'all' failed

**** Build Finished ****

  • When you link a program with the GCC ARM toolchain, it automatically links in an object file named crt0.o.  In your attached build log file, the full path to this file is ...

    /home/dojo/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7-ar/crt0.o

    This object file contains the code that runs at system start, then calls main. There are two global symbols defined at the beginning of the code in this object file: _start and _mainCRTStartup.  Therefore, your program cannot provide an implementation of a function with either of those names.

    Thanks and regards,

    -George

  • Thank you for this George, I will work to fix this.  This makes sense.  Appreciate your time.

    Rick

  • Follow-up and to anyone not as much a n00b as I am but who may have run into a similar issue--based on the advice above helped (it links and compiles without error now):

    1. I tried removing reference to '_start' in my program though I couldn't see any reference to _main in my program

    * re-built but continued to get errors

    2. put _start back in my program, and ticked '-nostartfiles' under the Show Build Settings option (which is where it seems GNU Linker drop-down may live in this version of CCS)

    * re-build and continued to get errors

    3. then closed the 2 other open projects with the original project "Main_sample" that I had started in attempt to successfully compile; also entered correct name for this project in creation of the list file.

    I had not realized that the "MainSample_array" project was actually under the rubric of the Sample project (provided in CCS as example structure, so changed list name/option to -a=Sample/Main_sample.lst

    * then re-linked and re-compiled and it worked fine.

    Thanks again to George.

    R