Fix pointer casts incompatible with 64 bit architectures
Tizen toolchain team in Samsung company is planning to build Tizen
for new arm 64 bit architecture - Aarch64. But package
"ug-image-viewer-efl" cannot be built for this architecture
because of build errors of the following type:
error: cast from pointer to integer of different size
error: cast from 'void*' to 'int' loses precision
The reason that there are several casts from pointer type to type
(int) in the current implementation of package. These casts
are correct for 32-bit architectures, since on them both pointer
types and (int) have the same size - 32 bits. But on 64-bit
architectures pointer types have size 64 bit and (int) has size
32 bit, and cast from one to another can provide incorrect results.
This problem can be fixed just by simple replacement of (int)
variables with (size_t) variables, since it does not change the logic
of code and provide additional compatibility with 64-bit
architectures. This fix does not affect external API functions,
since only types of local variables and prototypes of static
functions are changed.
Also options "-mfpu=neon" and "-mfloat-abi=softfp" are not recognized
by GCC if aarch64 is the target architecture. The replacements of
these options are "simd" and "fp" suffixes for option "-march".
Also execstack command does not work for aarch64 binaries, since
aarch64 support is not included to version of execstack used in
Tizen. That's why we have disabled this command just for the case of
aarch64.
The patch has been checked for build compatibility under armv7l, i586
and aarch64 architectures and build results are available at
https://build.tizen.org/package/show?package=ug-image-viewer-efl&project=devel%3Aarm_toolchain%3AMobile%3AMain
Change-Id: Ia476533b6b8c45ffb655db96e09d0c7ea2cde912
Signed-off-by: Ilya Palachev <i.palachev@samsung.com>