Remove PAM dependency code.
The libpam dependency was brought 3.5 years due to c-client.  As of today,
there's no need neither in HHVM or c-client to link against libpam.
HHVM itself does not depend on boost_regex.
Only third-party/folly depends on libboost_regex, but HHVM has a
dependency that causes a bogus linkage in the final binary.

Sync with Debian patch 09_remove_boost_regex_hhvm.patch from 2.4.1-1.
Disable bogus code for finding and linking against ncurses.
For some very old reason lost in the dawn of time, HHVM imported the
CMake file of Readline from KDE, which had an ncurses dependency. Remove it
from everywhere.

Sync with Debian patch 08_disable_libncurses.patch from 2.4.1-1.
Use PATH_SUFFIXES for imagemagick

This is a better solution than the hack I added before
Fixed fwrite() error behaviour.

Closes #1909
Closes #1910
Github Author: Camillus Gerard Cai <cgcaiqxcg.net>

Reviewed By: @fredemmott

Differential Revision: D1210786
add could_include to Hack

I was going to kill this function, but @markw65 said it will be useful to the community if they don't have an autoloader. Lets open source it then.

Reviewed By: @elgenie

Differential Revision: D1218801
Enable ExtraOptPass when BytecodeControlFlow is on

This works as of D1233662.

Reviewed By: @ottoni

Differential Revision: D1234803
Dont use rAsm implicitly in x64Assembler

This removes the implicit uses of rAsm from X64Assembler,
and moves the definition to abi-x64.h.  Some mentions of
rAsm were hoisted, but most involved doing stores, so those
were converted to store two 32-bit immediates (without
using a scratch register) when possible.

The Immed wrapper class now only allows 32-bit immediates,
and a new Immed64 wrapper is available for immediates whose
compile-time-type (vm-compile time) is 64 bits.

Reviewed By: @ottoni

Differential Revision: D1224706
Fix a couple bugs with large immediates.

In one case we simply wrongly assumed that a TC address would
be in low memory, which is not guaranteed.

The other bug is when we have a CG function for an opcode, *and*
that opcode is in the native call table.  Typically the CG function
is emitting an inline fast path and falling back to a call.

mayUseConst was eagerly whitelisting such opcodes too soon; we
should get through the switch block for special cases before
whitelisting native call operands.

Reviewed By: @markw65

Differential Revision: D1241128
Fix return types for HNI functions

Using Type::Any for a return type meant that assigning the result
of a function to a variable had no effect on the type of that variable.
It needed to be Type::Variant. I would dig deeper and try to sort it out,
but hopefully we're just moving to hhbbc, and can drop it.

Reviewed By: @edwinsmith

Differential Revision: D1241620
Change method of running oss tests without jit

Adding it to the command line args put it in PHP_BINARY, which broke phpunit.

Given it's only used to disable the jit, remove the first arg from the function.

Reviewed By: @JoelMarcey

Differential Revision: D1242275
Increase JitPGOThreshold to 10

I was never happy with such a low threshold, but that's what made
perflab happiest at the time.  However, I've seen a couple of cases
where the profile-guided region selector was making a bad decision
because of limited profiling information, so I decided to try to
increase this again. I tried a few values, and 10 seems to show a
small improvement.

Reviewed By: @bertmaher

Differential Revision: D1241344
Fix a slew of bugs in the systemlibs

Reported in CodeError.js while I was working on D1241620

Reviewed By: @edwinsmith

Differential Revision: D1242050
Fix behavior of AttrDynamicInvoke on persistent functions

Solve it the way we do for fb_rename_function, although it
also seems fairly unfortunate that FuncEmitter::create has actual
logic in it instead of just deserializing data from the repo.

The problem was this: if you have a 'dynamic invoke' function (means
it can be used with fb_intercept and fb_rename_function) that is also
persistent, it would get allocated a persistent RDS handle.  After its
unit is merged, the information about how to define the func is
removed from the UnitMergeInfo in compactUnitMergeInfo, because we
expect it to be defined forever now.  Then if any thread uses
fb_rename_function on it, it will null out the persistent RDS handle.
Since it was AttrDynamicInvoke, calls to the function are compiled
with LdFuncCached, which checks if the RDS handle is null, and if so,
invokes autoload.  However, autoloading won't define the Func anymore
because it was removed from the unit merge info.

Reviewed By: @edwinsmith

Differential Revision: D1242770
Correctly support the cache File::m_buffer in UserFile::getc() and UserFile::seek()

This fixes `getimagesize()` when applied to user streams.
Closes #2140

Reviewed By: @fredemmott

Differential Revision: D1235554

Pulled By: @ptarjan
fix calling session_set_save_handler multiple times

Matches php5, brings slim back up to 100%

Reviewed By: @ptarjan

Differential Revision: D1242541
Partially implement PharFileInfo, implement Phar iterator behavior

Turns some composer test fatals into failures.

Reviewed By: @ptarjan

Differential Revision: D1239646
fix trait constructors

It looks like we implemented something that didn't end up in the final version. All tests were recorded from php5

Reviewed By: @elgenie

Differential Revision: D1227544
Make the gdb python tools Python 3 compatible

Fixes #2062
Closes #2119

Reviewed By: @markw65

Differential Revision: D1233593
Support auto_prepend_file and auto_append_file

Closes #2171

Reviewed By: @fredemmott

Differential Revision: D1238390

Pulled By: @ptarjan