facebook/hiphop-php — Issue #447: problem building libhphp_runtime.a on vm branch
Author: bkoehm
Created: 2011-12-15 18:46:49+00:00
State: open

On the vm branch at commit e20a731e11c225b1cbd623850ab41841e819c7fd, I've had a problem linking with libhphp_runtime.a.

The symptom is that libhphp_runtime.a doesn't end up with all the symbols that it should and I get undefined errors later in the build when executables try to link with the library.

I'm not a cmake expert, but I've tracked it down to src/CMakeFiles/hphp_runtime_static.dir/link.txt.

After running cmake in a clean directory, my (Ubuntu 11.10) link.txt looks like:
/usr/bin/ar cr ../bin/libhphp_runtime.a
/usr/bin/ar r ../bin/libhphp_runtime.a
/usr/bin/ranlib ../bin/libhphp_runtime.a

I can fix it by merging the two ar lines into one so that it now looks like:
/usr/bin/ar cr ../bin/libhphp_runtime.a
/usr/bin/ranlib ../bin/libhphp_runtime.a

After that the build finishes.