Tool/software: Code Composer Studio
Hi,
I've been trying to cross compile a simple hello world example in CCS v10 for execution on the OMAP-L138 LCDK dev board (program shown below)
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
I downloaded and installed the OMAP-L138 Linux SDK according to the documentation from TI, but I have compilation and linker errors I've been trying to sort out.
One of the compilation errors was that the compiler could not find the file stdio.h which was located at the top of the hello world program.
I thought I must have to reference the directory stdio.h resided in as an include path for my project.
I added the following include directory to my project "/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/usr/include" which resolved the file not being found issue (picture of it below too).
After compiling the project again I still got the linker errors (shown below the console output of the project)
Building target: HelloWorld2
Invoking: Cross GCC Linker
arm-oe-linux-gnueabi-gcc -o "HelloWorld2" ./HelloWorld2.o
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crt1.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crti.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crtbegin.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find -lgcc
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find -lgcc_s
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find -lc
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find -lgcc
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find -lgcc_s
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crtend.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
makefile:35: recipe for target 'HelloWorld2' failed
make: *** [HelloWorld2] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
I started looking around for the files and their locations and decided to add the below directories to the linker include paths (picture of project configuration shown below):
/home/ben/ti/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/lib
/home/ben/ti/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/usr/lib/arm-oe-linux-gnueabi/8.2.0
This solved some of the issues, but not all the linker file errors.
The new output the project output now was for 3 files it could not find (see below output)
Building target: HelloWorld2
Invoking: Cross GCC Linker
arm-oe-linux-gnueabi-gcc -L/home/ben/ti/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/lib -L/home/ben/ti/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/usr/lib/arm-oe-linux-gnueabi/8.2.0 -o "HelloWorld2" ./HelloWorld2.o
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crt1.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crti.o: No such file or directory
/home/ben/ti/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/8.2.0/real-ld: cannot find crtbegin.o: No such file or directory
collect2: error: ld returned 1 exit status
makefile:35: recipe for target 'HelloWorld2' failed
make: *** [HelloWorld2] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
Those files are present in the directories I added for the linker include section, but the linker does not see them for some reason.
After some research I found the below post on the TI forms:
This person had very similar problems to what I was experiencing. In an effort to see if I too had broken links I ran the cmd line search they did (for my CPU and environment path wise):
find /home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux -type l | xargs file | grep "broken\ symbolic\ link"
This generated output which stated some broken links:
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/var/lib/opkg/lists/oe-x86_64-nativesdk: broken symbolic link to /oe/bld/build-ARM9_1/arago-tmp-glibc/work/armv5e-oe-linux-gnueabi/meta-toolchain-arago-tisdk-server/1.0-r5.0/oe-sdk-repo/x86_64-nativesdk/Packages
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/var/lib/opkg/lists/oe-all: broken symbolic link to /oe/bld/build-ARM9_1/arago-tmp-glibc/work/armv5e-oe-linux-gnueabi/meta-toolchain-arago-tisdk-server/1.0-r5.0/oe-sdk-repo/all/Packages
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/var/lib/opkg/lists/oe-buildtools-dummy-nativesdk: broken symbolic link to /oe/bld/build-ARM9_1/arago-tmp-glibc/work/armv5e-oe-linux-gnueabi/meta-toolchain-arago-tisdk-server/1.0-r5.0/oe-sdk-repo/buildtools-dummy-nativesdk/Packages
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/var/lib/opkg/lists/oe: broken symbolic link to /oe/bld/build-ARM9_1/arago-tmp-glibc/work/armv5e-oe-linux-gnueabi/meta-toolchain-arago-tisdk-server/1.0-r5.0/oe-sdk-repo/Packages
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/arm-oe-linux-gnueabi/include: broken symbolic link to /home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/include
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/lib/ssl-1.1/private: broken symbolic link to ../../../etc/ssl/private
The only broken link (fifth one in above list) that I could make potential sense of was the link:
/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/arm-oe-linux-gnueabi/include
That path does not exist on my computer and I thought it was trying to point to the include files folder, perhaps the folder where stdio.h resided...?
I ran the below commands to resolve the link the way I thought it was intended to be (this was only from what I learned reading in the prior mentioned link for the TI forms issue):
rm /home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/arm-oe-linux-gnueabi/include
ln -s /home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/arm-oe-linux-gnueabi/include /home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/usr/include
I then went back to my hello world project in CCS and removed the include file directory I first mentioned (/home/ben/ti-processor-sdk-linux-omapl138-lcdk-06.03.00.106/linux-devkit/sysroots/armv5e-oe-linux-gnueabi/usr/include)
After cleaning and compiling the project the error stating that the compiler couldn't find the file stdio.h did not return.
I'm assuming that the link I corrected is what fixed the stdio.h not being found issue.
The following questions now come to mind.
1. Could there be an issue with the installation file for the OMAP-L138 Linux SDK, or the way that I am installing it where some links don't resolve properly?
2. Is there any documentation from TI on what the intended destination folder/functions the links have? (in an effort to resolve them post installation)
3. Could the remaining broken links found cause the linker errors I'm seeing?
Thanks,
Ben

