Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created January 13, 2014 01:33
Show Gist options
  • Save springmeyer/8393268 to your computer and use it in GitHub Desktop.
Save springmeyer/8393268 to your computer and use it in GitHub Desktop.
Testing 32 bit code on 64 bit systems

This commit contains some logic to be able to:

  • compile node-srs to 32 bit code
  • test it using a 32 bit version of node
  • all from a 64 bit operating system (either Ubuntu Linux or OS X)

Why 32 bit?

32 bit operating systems are becoming more and more rare as the days pass. All of us increasingly work with applications (like web browsers) or code (like node.js) where cpu architecture does not matter. Both browsers and node.js are written in C++ and the complexities of process architecture are hidden from us with the exception of the ability to ask node which architecture it was built for:

$ node -e "console.log(process.arch)"
x64

However, for supporting TileMill and some specialized node c++ modules we still need to pay attention to 32 bit systems and limitations. For example 17% of node-sqlite3 linux downloads are still for 32 bit systems. And http://www.ubuntu.com/download/, for example, still recommends 32 bit ubuntu for older machines: screen shot 2013-10-24 at 4 49 53 pm

Finally, another good reason to support 32 bit for compiled code like C/C++ is that it may surface important bugs that should be fixed no matter the architecture. This is the side of software where extreme elbow grease is needed to push through the complexity, but in the long run it pays off in faster and more predicable code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment