Ask / Submit
4

64-bit platform

asked 2019-06-15 23:22:58 +0300

meolic gravatar image

In the C part of my project I use the following macro to check, that the target supports 64-bit pointers. This works on Linux and Windows, but fails on Sailfish. Does this mean that I am not on a 64-bit platform or the check is simply not correct?

#if UINTPTR_MAX == 0xffffffffffffffff
...
#endif
edit retag flag offensive close delete

Comments

2

Depends on which processor you have. For example, ARMv7 is 32-bit processor Please post output of: uname -a

useretail ( 2019-06-16 00:22:58 +0300 )edit
5

IIRC even though modern hardware Sailfish OS runs on, such as Xperia X/XA2 is internally 64-bit, all the sailfish OS binaries are still 32 bit and the whole system is running in 32-bit mode.

This is likely due to not having to ship two sets of ARM binaries (one for the 32-bit ARMv7 and one for the 64-bit native aarch64).

I'm not exactly sure how this works on the XA2 plus, which has 6 GB of RAM. It could be that the kernel is compiled for 64-bit mode and runs in native 64-bit mode, while individual processes run in 32-bit mode (this is possible and done regularly for modern Linux distros - If you have ever run Steam on Linux, which is 32-bit, you have done just that). That way each process can allocate only up to ~4GB of RAM for itself, but as there are usually many processes active at any one time, the 6 GB of RAM can all be adequately used.

MartinK ( 2019-06-16 03:29:17 +0300 )edit
4

On my Xperia X I get

$ uname -a
Linux Sailfish 3.10.84 #1 SMP PREEMPT Wed Sep 12 06:15:36 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

However, that just tells the architecture of the kernel. There is also

$ zcat /proc/config.gz | grep CONFIG_COMPAT=
CONFIG_COMPAT=y

That means the 64 bit kernel can also run 32 bit processes. And that's what it does:

$ tail -3 /proc/self/maps
f7265000-f7266000 rw-p 0001a000 fd:00 2709                               /lib/ld-2.25.so
ffc55000-ffc76000 rw-p 00000000 00:00 0                                  [stack]
ffff0000-ffff1000 r-xp 00000000 00:00 0                                  [vectors]

As has been commented before I have never heard either about 64 bit builds of SailfishOS.

ugeuder ( 2019-06-16 21:13:48 +0300 )edit

1 Answer

Sort by » oldest newest most voted
5

answered 2019-06-17 02:43:56 +0300

r0kk3rz gravatar image

There is currently no fully 64bit Sailfish OS, and on 64bit hardware you will see a 64bit kernel with a 32bit userspace.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2019-06-15 23:22:58 +0300

Seen: 459 times

Last updated: Jun 17