Don't warn if seccomp can't be enabled.

I can now provide a statically linked binary with the seccomp-filter
accelerator built in, and users with old kernels will not be confused
by an unexpected warning.
Delete .check_* files on "make clean".
Don't assume the memory page size is always 0x1000 (4KiB).

Just in case...
Ensure the minimum heap size is at least 1MiB.

The kernel might put non-fixed regular mmap pages right after the
emulated heap, making impossible to make this latter grow anymore.
This issue was revealed on Ubuntu/ARM 10.10.

This commit has exposed a limitation in the current heap emulation: on
Linux, it is possible to make the heap non-homogeneous (fixed mmap
PROT_NONE against some heap pages) and fragmented (munmap against some
heap pages).  As a consequence, any mmap/munmap calls performed
against the emulated or reserved heap pages might make the heap
emulation confused (unexpected "brk -> munmap" failure for instance).
This not a big threat as this limitation can be exposed only if fixed
heap addresses are explicitly used.
Update link to the user-manual.
Use modified output parameters instead of current ones in kompat sysexit.

This bug was exposed on Ubuntu/ARM 10.10:

    $ env PROOT_FORCE_KOMPAT=1 ./src/proot -v 5 -k 2.6.35-903-omap4 ./tests/test-1ffc8309
    proot warning: ptrace(PEEKDATA): Input/output error
Build with _GNU_SOURCE defined by default.

    Defining this macro (with any value) is equivalent to defining
    _BSD_SOURCE, _SVID_SOURCE, _ATFILE_SOURCE, _LARGEFILE64_SOURCE,
    _ISOC99_SOURCE, _XOPEN_SOURCE_EXTENDED, _POSIX_SOURCE,
    _POSIX_C_SOURCE with the value 200809L (200112L in glibc versions
    before 2.10; 199506L in glibc versions before 2.5; 199309L in
    glibc versions before 2.1) and _XOPEN_SOURCE with the value 700
    (600 in glibc versions before 2.10; 500 in glibc versions before
    2.2).  In addition, various GNU-specific extensions are also
    exposed.  Where standards conflict, BSD definitions are
    disfavored.

    -- man feature_test_macros

The default availability of some features may vary from one glibc
version to the other.  Defining _GNU_SOURCE by default should avoid
build failures due to this asymmetry.
Remove an empty statement.

Reported-by: Antoine MOYNAULT <antoine.moynault@st.com>
Fix a redefinition error when building against glibc v2.18.

When building PRoot against glibc v2.18, the following error appears:

    CC  tracee/event.o
    In file included from ./tracee/event.c:27:0:
    /usr/include/linux/ptrace.h:58:8: error: redefinition of ‘struct ptrace_peeksiginfo_args’
     struct ptrace_peeksiginfo_args {
            ^

    In file included from ./tracee/event.c:26:0:
    /usr/include/sys/ptrace.h:191:8: note: originally defined here
     struct ptrace_peeksiginfo_args
            ^

Reported-by: Nicolas CORNU <ncornu@aldebaran-robotics.com>
Ref: https://github.com/cedric-vincent/PRoot/issues/27
Fix heap size reservation support, it was really broken.

List of failures:

* the "old_size" parameter passed to mremap(2) was wrong, it didn't
  take "reserved_heap_size" into account.

* the released memory from the reserved space was not correctly
  cleared if the "old_heap_size" was bigger than the
  "reserved_heap_size".
Make build flags (CFLAGS, CPPFLAGS and LDFLAGS) extendable.

For instance, to extend CFLAGS:

    $ env CFLAGS=-g make -C src/ V=1
    [...]
    gcc -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I./ -g -Wall -Wextra -O2 -MD -c ./cli/cli.c -o cli/cli.o
    [...]

It is still possible to override build flags. For instance:

    $ make -C src/ CFLAGS=-g V=1
    [...]
    gcc -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I./ -g -MD -c ./cli/cli.c -o cli/cli.o
    [...]
Fix build compatibility with older distros.
Fix merge_filtered_sysnums(): dereference before null check.

src/syscall/seccomp.c:

  >>> deref_ptr: Directly dereferencing pointer "sysnums".

  427        if (*sysnums == NULL) {
  428                /* Start with no sysnums but the terminator.  */
  429                *sysnums = talloc_array(context, FilteredSysnum, 1);

  >>> CID 1057474 (#1 of 1): Dereference before null check (REVERSE_INULL)

  >>> check_after_deref: Null-checking "sysnums" suggests that it may
  >>> be null, but it has already been dereferenced on all paths
  >>> leading to the check.

  430                if (sysnums == NULL)
  431                        return -ENOMEM;
Disable heap emulation on x86 because of a bug that appears on AMD CPUs only.

This bug was exposed by the OBS validation, it could be avoided if the
environment variable "LD_HWCAP_MASK" is set to 0.  I have no ideas
where this bug comes from yet (PRoot, glibc, virtualization, ...).  By
the way, the heap emulation is not required on x86/32-bit.

Thanks to Christophe MONAT <christophe.monat@st.com> for the hint.
Deny access to the pre-allocated heap space + increase it to 8MB.

The LTP test-suite assumes "brk + an offset" is not memory mapped, so
PRoot has to return -EFAULT when a pointer to the pre-allocated heap
space is used.  Some LTP test-cases are still failing because they
[try to] access this supposedly invalid memory space with syscalls not
tracked by PRoot.  However, the assumption made by the LTP test-suite
could be wrong if the memory layout is changed for any reasons other
than PRoot.

The default pre-allocated heap size has been increased to 8MB to
ensure big shell scripts can be executed by Bash.
Port commit d5780a06 on x86: 2nd argument of socketcall(SYS_ACCEPT) can be NULL.
Minor cosmetic changes.
Prepare release v3.2.