Fix pointer casts incompatible with 64 bit architectures 69/19269/1
authorIlya Palachev <i.palachev@samsung.com>
Wed, 9 Apr 2014 17:17:51 +0000 (21:17 +0400)
committerIlya Palachev <i.palachev@samsung.com>
Wed, 9 Apr 2014 17:19:08 +0000 (21:19 +0400)
commit1d893c718a7ce4dc5abe5dc16dfcad524793aede
tree83a71d277fd7e6a541f0fb180d99c11869eea000
parent6ca9d5e80a7b426ca84ae33324b52e5d7a2e099d
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>
main/src/control/ivug-crop-ug.cpp
main/src/slider/ivug-slider-item.cpp
main/src/view/ivug-crop-view.cpp
main/src/view/ivug-main-view-menu.cpp
main/src/view/ivug-main-view.cpp
main/src/view/ivug-setas-view-callerid.cpp
main/src/view/ivug-setas-view-wallpaper.cpp
main/src/view/ivug-slideshow-view.cpp
packaging/ug-image-viewer-efl.spec
slideshow/src/control/ivug-slideshow.cpp
widget/src/scissorbox/ScissorBox.cpp