Blog | Tom Ward
For the past year I’ve been working on porting
modo to Linux, which involved me having
to do lots of fun filled tests on both OSX and Windows, as well as having to
haul a machine to/from America in order to work with the dev team out in
Mountain View. After much messing about this week, I finally got my 2011 MBP
triple-booting all three platforms correctly! So that I can remember how to do
it again, here’s what I did
The key to all of this is partition management, followed by MBR magic. A lot of
what follows was what I could piece together from various blogs and posts, or
some good old fashioned trial-and-error
Firstly, this is completely from scratch with a fresh 1TB drive, and using a
Macbook Pro from late 2011. The three distros I’ve gone for are OSX Mountain
Lion, RHEL 6.4 and Windows 7. YMMV with newer macbooks and different distros…
So with perforce running on my Raspberry Pi, I now wanted to setup a service to
deal with starting, stopping and backing up my perforce server. Although I
could’ve just created an init.d script myself, I decided to use the open source
p4dctl to do most of the
work. The problem was that this wasn’t compiled for ARM, especially not for a
hard-float ARM distro that I’m using. Here I explain how I got it built, but if
you’re lazy like me I’ve also uploaded a copy
here that you can unzip and
copy to your device.
Getting setup to build p4dctl
First and foremost, currently perforce is only supported on ARMv4 architecture,
which means all the libraries are built for a soft-float ABI (see
soft-float vs hard-float).
Because soft-float is forward compatible this makes sense, however you also need
to compile as soft-float. For simplicity, I had a spare SD card knocking about
so put
Debian Wheezy soft-float version
on it.
Although I’ve used SVN and to a lesser extent CVS before, my fave source control
tool has to be perforce. I used it heavily at EA and have started to use it at
The Foundry for one of the products I’m working on, and frankly I think it’s
great.
I also recently bought a Raspberry Pi, and thought I’d give it a go trying to
migrate my Perforce server from an Amazon EC2 server to my Pi, and save the $10
or so it costs a year to store things in the cloud.
First things first, I had to find out if Perforce was supported on ARM chips.
Luckily I found that although unofficial, they do seem to have LinuxARM builds
on their FTP!
ftp://ftp.perforce.com/perforce/r12.1/bin.linux26armel/
So I uploaded the p4 binary I found to my pi, made it executable
(chmod a+x p4d
) only to get the following error when running:
pi@raspbmc:~$ ./p4
-bash: ./p4: No such file or directory
Not the most useful error message in the world, but with a bit of googling I
managed to figure out that basically the binary was trying to load a library
that it couldn’t find. By running the following command:
eu-readelf --program-headers p4
on the binary (I got this program by installing elfutils using sudo apt-get
install elfutils) I found it needed /lib/ld-linux.so.3. I fixed this by
simply creating a symlink to the one on my system with the following command:
sudo ln -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3
Once I’d done that I could happily run not only the client but also the server,
which was pretty neat!
Hope this helps
Not done any posting on here for a while now, mainly because I’ve been
state-side doing some rather exciting VFX work, all very hush hush though….
Anyway, one tool I’ve found immensely useful (especially in my current
project…) is unmangling those rather ‘orrible C++ symbols that the linker
spits out. With g++ on linux comes c++filt, which you can pass it the mangled
function and out it comes all readable. Delightful.
For example:
c++filt _ZZ12TestFunctionEN4TestC1Ev
Will produce:
TestFunction::Test::Test()
Much better!
Last month whilst searching for a VC++ compiler flag (the -Isystem equivalent
for VS, which I never did find) I stumbled across this hidden flag, which allows
you to print out what the compiler generates for your class structure. Very
cool!
To print out the class structure for all classes in your compilation, you can
use /d1reportAllClassLayout. If you want to /d1reportSingleClassLayoutxxx, where
xxx is the name to search for