If your concern is only about having access to 4GB of RAM, then go for the 32bit + PAE version of Ubuntu. It's the easiest way :-) But read further in order to understand limitations and advantages of each architecture.
I guess your hardware is pretty recent, so Ubuntu will just pick up the 4GB of memory even in 32bit as it's using a kernel feature called PAE (some release of Ubuntu have a separate kernel for that, check in Synaptic Package Manager
for PAE). It's really stable and you won't regret it, especially for Flash which needs (if you install it the easy way from the repository) a 32bit stack. In my experience, a 64bit OS with Flash 32bit is unstable.
But they are a few limitations on the 32bit version, a process (a program) cannot access more than 2GB or sometimes 3GB of memory (depends on kernel and application own memory management such as Java Virtual Machine). This is obviously not a problem for most application. However, I've been using a few GPS tools to build maps. They sometimes (for big maps) need more than 2GB addressable memory. But it's really not common. In addition, 32bit+PAE can be incompatible with some proprietary drivers. They do work perfectly with open source ones, but some times the proprietary/binary drivers can not handle this architecture.
On the other side, you can go 64bit and with Ubuntu Software Centre
you can be happy as you have access to a huge library of 64bit applications. However, if you want to use proprietary software on Linux, you need to hope that they support also 64bit. Products like: Adobe Flash, Adobe AIR, Google Talk Plugin, Skype, Amazon MP3 are 32bits only. Some do work if you install the 32bit stack on your 64bit system, but some won't (Amazon MP3) or badly (Adobe Flash). Another drawback of 64bit system is that they use more memory. So a same application will use more memory for doing the same thing in a 32bit environment. Sometimes it's a problem.
Conclusion is:
- 32bit is more compatible regarding application (especially proprietary ones like Skype or Flash). PAE does not have impact on applications usually.
- 32bit+PAE/64bit you might have problem on both platform with certain binary drivers (usually for WiFi)
- If you don't need an application that uses more than 2GB of RAM (create your own map for your GPS), then you don't need 64bit. This is the case for the vast majority of users in today computing.
- 64bit tend to use more memory for the same workload.
- Some users and benchmarks (see phoronix.com) report 64bit systems are slightly faster. But the margin is small enough that I don't feel the differences.
Best Answer
While the kernel can be cross-compiled, the easiest way is to create a 32bit (i386) chroot and build it in there.
Install
ubuntu-dev-tools
:Create an i386 chroot:
(You will probably have to run that twice. The first time, it installs
schroot
etc. and sets upmk-sbuild
)Then enter the chroot:
And build the kernel, as you would, normally.