Merge to upstream r324534.

Test: make checkbuild
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Bug: None
Change-Id: I0913bfcee6cebafae3f1f663bb442d1ad4682006