1

I'm cross compiling for imx28 cpu with arm-fsl-linux-gnueabi:

[vladimir@vladimir src]$ arm-fsl-linux-gnueabi-g++ -v
Using built-in specs.
Target: arm-fsl-linux-gnueabi
Configured with: /work/arm-toolchains/tmp/src/gcc-4.4.4/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-fsl-linux-gnueabi --prefix=/work/arm_fsl_gcc_4.4.4_multilib --with-sysroot=/work/arm_fsl_gcc_4.4.4_multilib/arm-fsl-linux-gnueabi/multi-libs --enable-languages=c,c++ --with-pkgversion=4.4.4_09.06.2010 --enable-__cxa_atexit --disable-libmudflap --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-gmp=/work/arm-toolchains/tmp/arm-fsl-linux-gnueabi/build/static --with-mpfr=/work/arm-toolchains/tmp/arm-fsl-linux-gnueabi/build/static --with-ppl=/work/arm-toolchains/tmp/arm-fsl-linux-gnueabi/build/static --with-cloog=/work/arm-toolchains/tmp/arm-fsl-linux-gnueabi/build/static --enable-threads=posix --enable-target-optspace --with-local-prefix=/work/arm_fsl_gcc_4.4.4_multilib/arm-fsl-linux-gnueabi/multi-libs --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long --enable-multilib --with-system-zlib --enable-lto
Thread model: posix
gcc version 4.4.4 (4.4.4_09.06.2010) 

The following code line:

info->mask = 0xffffffffffffffff;

gives me following error:

warning: integer constant is too large for 'long' type

I tried close to everything, made sure int64_t is defined to long long int, even tried to typedef it manually, still, it gives me the error.

I also tried different -mcpu options.

Is there even a way to use int64_t on imx28, or should I just give up?

  • 2
    what does sizeof() show (dont need to execute just compile a three line test program and disassemble), also what if you try -1 instead of that number and or force that number to be signed, maybe the compiler thinks it is unsigned and the error is correct. Try 0xFFFFFFFFFFFFFFFFLL – old_timer Oct 25 '19 at 14:34
  • is your host 32bit, it may be picking up the wrong stdint.h – old_timer Oct 25 '19 at 14:35
  • ahh it says long type yes long is 32 bits you need long long. so you probably have an stdint.h problem what if you declare it long long what happens? – old_timer Oct 25 '19 at 14:35
  • `made sure int64_t is defined to long long int,` - but what type is `info->mask`? – KamilCuk Oct 25 '19 at 15:54
  • Sorry, forgot to mention, info->mask is int64_t – Vladimir Pavluk Oct 25 '19 at 18:12
  • @old_timer if I declare it long long it still shows me exactly same error – Vladimir Pavluk Oct 25 '19 at 18:14
  • then you have a problem if you declare it long long and it interprets that as a long. are you looking at the right line of code? – old_timer Oct 25 '19 at 18:16
  • @old_timer I definitely am looking at the right line, also I nailed it down to a simple 2-liner, which also gives me same error no matter if I use stdint.h or typedef uint64_t manually as unsigned long long. – Vladimir Pavluk Oct 25 '19 at 18:31

1 Answers1

2

Based on your comment.

Try 0xFFFFFFFFFFFFFFFFLL or -1

old_timer
  • 69,149
  • 8
  • 89
  • 168
  • In the end of the day, I found a (essentially) duplicate question here: [integer constant is too large for “long” type](https://stackoverflow.com/questions/5541560/integer-constant-is-too-large-for-long-type) @old_timer is totally right, some targets need LL or ULL in the end of the constants, or they count them as just L/UL. – Vladimir Pavluk Oct 25 '19 at 18:43