QorIQ SDK2.0 compile float

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

QorIQ SDK2.0 compile float

1,243 Views
shunpinglin
Contributor III

Now, I use the SDK2.0 to compile my program which had float variable, but gcc display:

MPFR: Can't allocate memory (size=4294967288)
hello.c: In function 'main':
hello.c:5:5: internal compiler error: Aborted
float a=1.0;

The program:

#include <stdio.h>

int main()
{
   float a=1.0;
   a += 2;
   printf("a:%f \n",a);
    return 0;
}

compile the program with the flowing command:

arm-fsl-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/opt/fsl-qoriq/2.0/sysroots/cortexa7hf-vfp-neon-fsl-linux-gnueabi hello.c -o hello
MPFR: Can't allocate memory (size=4294967288)
hello.c: In function 'main':
hello.c:5:5: internal compiler error: Aborted
float a=1.0;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

It seems that gcc MPFR's bug, then I how to fix it?

Labels (1)
9 Replies

954 Views
Pavel
NXP Employee
NXP Employee

There are no problems if this toolchain is used for float operations.


Have a great day,
Pavel Chubakov

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

0 Kudos

954 Views
haohouhao
Contributor I

I have found this issue.Have you solved the issue?

0 Kudos

954 Views
Pavel
NXP Employee
NXP Employee

It looks like that toolchain on your Linux host PC is not correctly installed.

Use the following command sequence for toolchain installing and GCC using.

We use ls012atwr as example.

  1. bitbake fsl-toolchain

 

  1. Run ./fsl-qoriq-glibc-x86_64-cortexa7hf-vfp-neon-toolchain-2.0.sh

from the following folder:

/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/deploy/sdk$

 

  1. source ./environment-setup-cortexa7hf-vfp-neon-fsl-linux-gnueabi

 

  1. $CC test_float.c -o test_float.elf


Have a great day,
Pavel Chubakov

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

0 Kudos

954 Views
shunpinglin
Contributor III

hello,

   my sh is:  fsl-qoriq-glibc-i686-cortexa7hf-vfp-neon-toolchain-2.0.sh (32bit ubuntu)

I exec the up commands,but it still fail.

0 Kudos

954 Views
Pavel
NXP Employee
NXP Employee

What error messages do you see?

Perhaps there is a problem for permission for toolshain installing.


Have a great day,
Pavel Chubakov

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

0 Kudos

954 Views
2838219522
Contributor III

Pavel,I have this issue,too.

I compile simple code with arm-fsl-linux-gnueabi-gcc ,it works.

But I compile libmodbus and iproute2 with  arm-fsl-linux-gnueabi-gcc,It will print MPFR: Can't allocate memory (size=4294967288).

Is something wrong here?

0 Kudos

954 Views
shunpinglin
Contributor III

hello,

My pc is Virtualbox ubuntu14.

Those error messages:

arm-fsl-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/opt/fsl-qoriq/2.0/sysroots/cortexa7hf-vfp-neon-fsl-linux-gnueabi hello.c -o hello
MPFR: Can't allocate memory (size=4294967288)
hello.c: In function 'main':
hello.c:5:5: internal compiler error: Aborted
float a=1.0;
^

0 Kudos

954 Views
shunpinglin
Contributor III

hello,

Those error messages:

arm-fsl-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/opt/fsl-qoriq/2.0/sysroots/cortexa7hf-vfp-neon-fsl-linux-gnueabi hello.c -o hello
MPFR: Can't allocate memory (size=4294967288)
hello.c: In function 'main':
hello.c:5:5: internal compiler error: Aborted
float a=1.0;
^

0 Kudos

954 Views
涛尹1
Contributor I

Have you solved the issue?

0 Kudos