cannot find crt1.o

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

cannot find crt1.o

Jump to solution
21,296 Views
BrilliantovKiri
Senior Contributor I

Hello!

I build toolchain for iMX6 from GitHub - Freescale/fsl-community-bsp-platform: BSP platform manifest

Follow my steps:

- mkdir /yocto && cd /yocto

- repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b jethro && repo sync

- ./setup-environment /yocto/build

- cd /yocto/build

- bitbake meta-toolchain

- cd tmp/deploy/sdk && ./poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-2.0.1.sh -y

Tollchain install in /opt/poky/2.0.1, after this I export variables from /opt/poky/2.0.1/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi, file attached.

Now I try compile iperf3:

- cd iperf3

- CC=$(CROSS_COMPILE)gcc ./configure --prefix=/usr --host=arm-poky-linux-gnueabi

Unfortunately configuration failed, follow part configure.log file:

configure:3253: arm-poky-linux-gnueabi-gcc -qversion >&5

arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '-qversion'

arm-poky-linux-gnueabi-gcc: fatal error: no input files

compilation terminated.

configure:3264: $? = 1

configure:3284: checking whether the C compiler works

configure:3306: arm-poky-linux-gnueabi-gcc  -O2 -pipe -g -feliminate-unused-debu

g-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c  >&5

/opt/poky/2.0.1/sysroots/x86_64-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 d

irectory

/opt/poky/2.0.1/sysroots/x86_64-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 d

irectory

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-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

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc_s

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lc

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find -lgcc_s

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crtend.o: No such file or

directory

/opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi

/gcc/arm-poky-linux-gnueabi/5.2.0/real-ld: cannot find crtn.o: No such file or d

irectory

collect2: error: ld returned 1 exit status

I check file system and found crt1.o:

$ find /opt/poky/2.0.1 -name crt1.o

/opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/crt1.o

Why ld can't found crt1.o and how can I solve this problem?

Thank you and excuse my bad english.

Original Attachment has been moved to: environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi.zip

Labels (2)
Tags (1)
1 Solution
10,950 Views
BrilliantovKiri
Senior Contributor I

Problem solved!

I add CFLAGS=""--sysroot=${SDKTARGETSYSROOT} -mfloat-abi=hard".

Where SDKTARGETSYSROOT is/ toolchain/install/directory/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi.

Simple example:

#include <stdio.h>

int main(int argc, char *argv[]) {

        return 0;

}

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

test.c:1:19: fatal error: stdio.h: No such file or directory

$ arm-poky-linux-gnueabi-gcc --sysroot=$SDKTARGETSYSROOT test.c

In file included from /opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/features.h:389:0,

                 from /opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:27,

                 from test.c:1:

/opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory

$ arm-poky-linux-gnueabi-gcc --sysroot=$SDKTARGETSYSROOT -mfloat-abi=hard test.c

$ file a.out

a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=fab88286767c018a15ba14dff125070fef88f1a4, not stripped

View solution in original post

3 Replies
10,951 Views
Yuri
NXP Employee
NXP Employee

Hello,

 

   perhaps the following example helps :

• 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

• 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
10,951 Views
BrilliantovKiri
Senior Contributor I

Hello, Yuri!

I not see any different between your and my actions, why result will be different if steps identical?

0 Kudos
10,951 Views
BrilliantovKiri
Senior Contributor I

Problem solved!

I add CFLAGS=""--sysroot=${SDKTARGETSYSROOT} -mfloat-abi=hard".

Where SDKTARGETSYSROOT is/ toolchain/install/directory/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi.

Simple example:

#include <stdio.h>

int main(int argc, char *argv[]) {

        return 0;

}

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

test.c:1:19: fatal error: stdio.h: No such file or directory

$ arm-poky-linux-gnueabi-gcc --sysroot=$SDKTARGETSYSROOT test.c

In file included from /opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/features.h:389:0,

                 from /opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:27,

                 from test.c:1:

/opt/imx6_toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory

$ arm-poky-linux-gnueabi-gcc --sysroot=$SDKTARGETSYSROOT -mfloat-abi=hard test.c

$ file a.out

a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=fab88286767c018a15ba14dff125070fef88f1a4, not stripped