why use 64bit Ubuntu but 32bit lib to build android

290 views
Skip to first unread message

tonypig

unread,
Sep 3, 2011, 11:25:06 PM9/3/11
to Android Building
Hi all,
I don't understand why Google recommend to use 64bit Ubuntu but 32bit
libs for compiling android, anyone know this answer?
Thank you in advance

Jean-Baptiste Queru

unread,
Sep 7, 2011, 5:31:03 PM9/7/11
to android-...@googlegroups.com
64-bit Ubuntu is recommended in order to use the 64-bit version of
Java 6, so that we can use the same version of Java 6 on all platforms
(there is/was a version of MacOS where Java 6 is/was only available as
64-bit). In addition, some parts of the build barely run in 32-bit
(they come close to running out of address space), and standardizing
on 64-bit avoids risks of running into such issues.

We use 32-bit libraries because there's a fair amount of Android code
that is compiled both for the target device and for the host at build
time, and building the host variants as 32-bit allows to have closer
behaviors between the host and the device. In addition, some host
tools are known to only work in 32-bit, e.g. the emulator itself.

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Jimen Ching

unread,
Sep 7, 2011, 7:27:59 PM9/7/11
to android-...@googlegroups.com
On Wednesday, September 7, 2011 11:31:03 AM UTC-10, JBQ wrote:

We use 32-bit libraries because there's a fair amount of Android code
that is compiled both for the target device and for the host at build
time, and building the host variants as 32-bit allows to have closer
behaviors between the host and the device. In addition, some host
tools are known to only work in 32-bit, e.g. the emulator itself.


 Perhaps I don't understand the low level details, but these reasons don't seem to make sense.

Android is an OS in its own right.  Why does it matter what the bit length of the host environment is, for building an embedded target platform?  The build is basically doing a bootstrap.  That is done all of the time with other embedded devices.  What you're saying is equivalent to saying I can't or shouldn't use a 64bit Ubuntu to build a 32bit Ubuntu to put in a router.  The target and the host environment are totally independent.

As for the emulator, lots of emulators are 32bit that emulate a target that is either 16bit or 8bit.  So why can't the Android emulator be 64bit and emulate a 32bit ARM?

--jc

Jean-Baptiste Queru

unread,
Sep 8, 2011, 12:54:53 PM9/8/11
to android-...@googlegroups.com
Using a 64-bit host matters when not all tools exist as 32-bit, and
when some tools are too big to run in a 32-bit environment.

As for the emulator, it's fundamentally a JIT, and running it as
64-bit would require having a JIT that can output 64-bit code.

JBQ

Reply all
Reply to author
Forward
0 new messages