Compiling errors with gcc-5.2.0 from 4.1.15

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiling errors with gcc-5.2.0 from 4.1.15

Jump to solution
8,023 Views
ivyliu
Contributor IV

Hi,

I have downloaded and built Freescale release L4.1.15_1.0.0_ga  yocto project.

Everything works well for building kernel and uboot with gcc-5.2.0.

But it always reported link errors when I tried to compile a static library.

~/fsl-release-bsp/build-xwayland/tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/ld: cannot find crti.o: No such file or directory

~/fsl-release-bsp/build-xwayland/tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/ld: cannot find crtbeginS.o: No such file or directory

The cross-compile tools path is ~/fsl-release-bsp/build-xwayland/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/

Can someone help me?

Is this arm-poky-linux-gnueabi-gcc 5.2.0 OK to use?

Thank you very much!!

Best Regards,

Ivy

0 Kudos
Reply
1 Solution
4,144 Views
BiyongSUN
NXP Employee
NXP Employee

use SDKIMAGE_FEATURES_append also can work fine.

IMAGE_INSTALL_append = " eglibc-staticdev"

SDKIMAGE_FEATURES_append = " staticdev-pkgs"

View solution in original post

0 Kudos
Reply
14 Replies
4,144 Views
ivyliu
Contributor IV

Hi Biyong,

Sorry for the late reply.

It did work!

Thank you very much!

Best Regards,

Ivy

0 Kudos
Reply
4,144 Views
senthilkumar_s1
Contributor II

Hi Ivy,

I am also facing same issue with arm-poky-linux-gnueabi-gcc(5.2.0)

I tried the above mention procedure. Still I am facing same problem,but i am not getting this issue with arm-poky-linux-gnueabi-gcc 4.8.2

/opt/sysroots/x86_64-oesdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crt1.o: No such file or directory
/opt/sysroots/x86_64-oesdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crti.o: No such file or directory
/opt/sysroots/x86_64-oesdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crtbegin.o: No such file or directory

Please provide the exact procedure that you have followed, Thanks in advance.

0 Kudos
Reply
4,144 Views
ivyliu
Contributor IV

Hi Biyong,

I tried both.

But neither works.

Does this version's gcc have any problem?

Thanks and Best Regards,

Ivy

0 Kudos
Reply
4,144 Views
BiyongSUN
NXP Employee
NXP Employee

I have comfirmed the changes are working with 4.1.15 and gcc 5.2.0  before I replied to you.


source  sdk_4_1_15/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

$CC -v
Configured with:.......
...........

gcc version 5.2.0 (GCC)

$CC -static -o hello hello.c
file hello
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=d9982f01435751f7e5a5ef1a9109a4d2559932f1, not stripped

0 Kudos
Reply
4,144 Views
ivyliu
Contributor IV

Hi Biyong,

Thanks for your step by step instructions.

But it still does not work.

I followed exactly what you did.

1. Building build folder

     #DISTRO=fsl-imx-x11 MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-x11

2. Adding IMAGE_INSTALL_append = " glibc-staticdev" to local.conf

3. Build the image

     #bitbake metal-toolchain

4. Install toolchain sdk after it is done,

     # ls -l ~/IMX6-L4.1.15/fsl-release-bsp/build-x11/tmp/deploy/sdk

     total 110544

     -rw-r--r-- 1 ivyl ivyl      9242 May  9 11:38 fsl-imx-x11-glibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain- 4.1.15-1.1.0.host.manifest

     -rwxr-xr-x 1 ivyl ivyl 113178725 May  9 11:38 fsl-imx-x11-glibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain-4.1.15-1.1.0.sh

     -rw-r--r-- 1 ivyl ivyl      1745 May  9 11:37 fsl-imx-x11-glibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain-4.1.15-1.1.0.target.manifest

    #cd tmp/deploy/sdk

    #./fsl-imx-x11-glibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain-4.1.15-1.1.0.sh

5. Setup the enviroment

    # ls -l /opt/fsl-imx-x11/4.1.15-1.1.0/

     total 60

     -rw-r--r-- 1 root root  3305 May  9 13:31 environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

     -rw-r--r-- 1 root root 47343 May  9 13:31 site-config-cortexa9hf-vfp-neon-poky-linux-gnueabi

     drwxr-xr-x 4 root root  4096 May  9 11:25 sysroots

     -rw-r--r-- 1 root root   135 May  9 13:31 version-cortexa9hf-vfp-neon-poky-linux-gnueabi

     # source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

     # echo $PATH

     /opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/bin:/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/../i686-pokysdk-linux/bin:/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-musl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

And there are 3 groups cross-compile tools added

          arm-poky-linux-gnueabi-

          arm-poky-linux-musl-

          arm-poky-linux-uclibc-

I tried to each of them to compile a helloworld file, all failed.

# arm-poky-linux-gnueabi-gcc -static -o hello hello.c -I/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/  -mfloat-abi=hard

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crt1.o: No such file or directory

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crti.o: No such file or directory

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crtbeginT.o: No such file or directory

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc_eh

/opt/fsl-imx-x11/4.1.15-1.1.0/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lc

collect2: error: ld returned 1 exit status

I have tried gcc-4.8.2 with IMX6 3.14.28 release, that one works fine.

Could you please help me to check what is wrong with this gcc-5.2.0?

Thank you very much!!

Best Regards,

Ivy

0 Kudos
Reply
4,145 Views
BiyongSUN
NXP Employee
NXP Employee

use SDKIMAGE_FEATURES_append also can work fine.

IMAGE_INSTALL_append = " eglibc-staticdev"

SDKIMAGE_FEATURES_append = " staticdev-pkgs"

0 Kudos
Reply
3,924 Views
pooja_todakar
Contributor I

Hiii,

I followed same procedure still i am facing error like,

/opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.8.2/ld: cannot find crtbegin.o: No such file or directory
/opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/usr/lib/libpthread.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

can anyone help me out this

with Regards

pooja

0 Kudos
Reply
4,144 Views
BiyongSUN
NXP Employee
NXP Employee

If you want it in SDK you popuated, please add the following line in the local.conf

SDKIMAGE_FEATURES += "staticdev-pkgs dev-pkgs"

0 Kudos
Reply
4,144 Views
BiyongSUN
NXP Employee
NXP Employee

If you have read the Yocto document, you willl find

Yocto Project Mega-Manual

Untitled.png

4,144 Views
ivyliu
Contributor IV

Hi Biyong,

Thank you for your reply.

I have tried as the document mentioned.

But it did not work.

meta-toolchain does not have populate_sdk_ext.

Thanks and Best Regards,

Ivy

0 Kudos
Reply
4,144 Views
BiyongSUN
NXP Employee
NXP Employee

Please check the following ticket

$CC Statically compiled applications

0 Kudos
Reply
4,144 Views
Yuri
NXP Employee
NXP Employee

Hello,

  please try the following (as an example) :

1. Create the Toolchain.

   Build the tool chain image. It generates the toolchain that will be installed on your host

machine and used to build any source code:

$ cd workspace/yocto/imx-4.1.15-1.0.0_ga

$ source setup-environment build-x11

$ bitbake meta-toolchain

$ cd tmp/deploy/sdk

$./fsl-imx-x11-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-4.1.15-1.1.0.sh

2. Hello World.

$ source /opt/fsl-imx-x11/4.1.15-1.1.0/environment-setup-cortexa9hf-vfp-neonpoky-linux-gnueabi

$ cd ~/test/

$ arm-poky-linux-gnueabi-gcc helloworld.c

$ ls

a.out helloworld.c

$ ./a.out

-bash: ./a.out: cannot execute binary file

$ file a.out

a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked

(uses shared libs), for GNU/Linux 2.6.16, not stripped

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
4,144 Views
ivyliu
Contributor IV

hi Yuri,

Thanks for your reply.

I have tried your way, it is same.

The tool chain can compile one file, but it can not link more than 2 objective files together, always have link problem.

/opt/poky/2.0.1/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crti.o: No such file or directory

/opt/poky/2.0.1/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crtbeginS.o: No such file or directory

Thanks and Best Regards,

Ivy

0 Kudos
Reply
4,144 Views
ivyliu
Contributor IV

I have used gcc 4.8.2 to build same library, it works fine.

Does gcc 5.2.0 support compiling userspace application?

Thanks and Best Regards,

Ivy

0 Kudos
Reply