Skip building stack_frame.cc and eh_return.c with PNaCl sjlj.

They use __builtin_dwarf_cfa, which turns into
llvm.eh.dwarf.cfa, which is disallowed in stable bitcode.

Also, the way the SJLJ environment was constructed is
different from the rest of the EH testing environments.
Namely, it does not do AddBiasForPNaCl and does not filter
out -pedantic so things fail even earlier while building:

http://build.chromium.org/p/tryserver.nacl/builders/nacl-precise_64-newlib-x86_32-pnacl/builds/422/steps/build_all/logs/stdio

tests/toolchain/stack_frame.cc:52:2: error: "unknown arch"
 ^
 1 error generated.
scons: *** [scons-out/nacl-x86-32-pnacl-pexe-clang/obj/tests/toolchain/stack_frame_sjlj.o] Error 1

That blocks a TOOL_REVISIONS roll:
https://codereview.chromium.org/68993002/

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
R=mseaborn@chromium.org

Review URL: https://codereview.chromium.org/68633004

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12373 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
toolchain_build: Update gcc revision

This brings in:

a50e063 Use appropriate DWARF2 EH pointer encoding for PIC

BUG= none
TEST= toolchain trybots
R=sehr@chromium.org, mseaborn@chromium.org

Review URL: https://codereview.chromium.org/69263002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12374 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Remove scons-related stuff from gyp.

Gyp hasn't had a scons generator for a while now. ("variants" was a scons-only
thing too.)

Review URL: https://codereview.chromium.org/66603008

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12375 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Update PNaCl in TOOL_REVISIONS from 12331 -> 12372

r12372 | PNaCl: Update LLVM revision in pnacl/COMPONENT_REVISIONS
    46d366a: (jvoung@chromium.org) Add some temporary diagnostics to GetCurrentDirectory to diagnose mac failures

r12371 | Add pnaclmm.a to support gccmm's __atomic_* functions.
r12370 | pnacl-translate: Remove some parsing code related to dynamic linking support
r12369 | PNaCl: Update Clang revision in pnacl/COMPONENT_REVISIONS
    a963b80: (jfb@chromium.org) Cherrypick upstream r183033: Add support for optimized (non-generic) atomic libcalls.

r12366 | Update pnacl llvm revisions.
    2796c5b Factor out bitcode parser from pnacl-bcanalyzer.
    64ad0b1 Move global FlagSfi variables to common module

r12364 | PNaCl: Add support for SJLJ-based (setjmp/longjmp) C++ exception handling
r12362 | pnacl-driver: Remove TODO that appears to be done
r12357 | Allow run.py to figure out the pexe architecture from the environment (PNACL_RUN_ARCH), or from the current architecture.
r12354 | PNaCl driver scripts: Rename ALLOW_CXX_EXCEPTIONS internal variable
r12353 | PNaCl: Remove unused dynamic linking code from bitcode/crtbegin.c
r12352 | pnacl-clang: Remove "-shared" and "-dynamic" options
r12351 | PNaCl: Remove unused file, pnacl/scripts/libgcc-glibc.mvars
r12350 | pnacl-ld: Remove "-shared" option and make "-rpath-link" a no-op
r12347 | Fix pnacl COMPONENT_REVISIONS to match what was in DEPS in r12337
r12346 | PNaCl: Add script for updating the Git revisions in pnacl/COMPONENT_REVISIONS
r12343 | pnacl-translate: Remove "-shared" and "-static" options
r12341 | Remove two ARM known failures.
r12339 | PNaCl FYI bot script: explicitly setup newlib nacl headers
r12338 | Use new format for PNaCl component revisions.
r12332 | Update llvm_test_suite DEPS to get improved testsuite.

BUG=none
R=dschuff@chromium.org

Review URL: https://codereview.chromium.org/68993002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12376 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Update ARM toolchain in TOOL_REVISIONS

This brings in the fix for PIC C++ EH tables.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3725
TEST= trybots
R=mseaborn@chromium.org, noelallen@chromium.org

Review URL: https://codereview.chromium.org/68803003

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12377 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
libpnaclmm: fix the compare-exchange implementation.

It differs from the __sync_* implementation, my previous commit was
therefore wrong because it didn't update the location properly, and it
didn't return the right boolean value.

R=dschuff@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3623
TEST= ./pnacl/scripts/llvm-test.py --libcxx-tests

Review URL: https://codereview.chromium.org/69763002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12378 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Run libc++ tests on FYI bots, add lit known failures

Failures are explained in the lit known failures file, I investigated
most. The biggest bucket is currently EH failures (which may be
shadowing other failures), and atomic tests (which AFAICT are fixed
upstream, but the patch doesn't apply cleanly).

I fixed other failures in the last few weeks (mostly newlib, libc++, and
missing PNaCl support libraries).

Note that the tests still only run with -std=gnu++11 and not the
stricter -std=c++11 (which we should strive for at some point, but more
bugs need to be fixed).

I ran the tests below for x86-64 and ARM and there are currently no
unexpected passes or failures.

R=dschuff@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3623
TEST= ./pnacl/scripts/llvm-test.py --libcxx-tests -arch x86-32
TEST= ./pnacl/scripts/llvm-test.py --libcxx-tests -arch x86-64
TEST= ./pnacl/scripts/llvm-test.py --libcxx-tests -arch arm

Review URL: https://codereview.chromium.org/69883002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12379 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Disable static build ID collection code for dynamic linking

The code for finding the module's own build ID by direct introspection
is unused and unnecessary in the dynamic linking configuration.

The reason to disable this code is that it is useless dead code.
The reason to prioritize cleaning that up now is that it tickles
a linker bug to have a weak reference to __ehdr_start in a link
where it cannot be defined due to file layout that does not make the
headers visible in the memory image; the nacl-glibc linker scripts
create such a layout.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3636
TEST= trybots
R=mseaborn@chromium.org, bradnelson@google.com

Review URL: https://codereview.chromium.org/69743002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12380 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Add stubs for tcgetattr/tcsetattr/etc to libnacl.

This allows newlib application that use these functions
to link even though in practice they would need to link
with nacl_io to get useful versions.

The motivation for this change is building vim with
the newlib toolchain.  It checks for these functions at
configure time (when nacl_io is not on the link line).

Review URL: https://codereview.chromium.org/63343002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12381 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Deploy new x86 binutils

This puts in place the x86 toolchain using the new 2.24-based binutils.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3636
TEST= trybots
R=bsy@google.com, sehr@chromium.org

Review URL: https://codereview.chromium.org/62643002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12382 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Fix nacl.scons test of coverage mode

Cursed lack of coverage trybots masked this trivial bug!

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3636
TEST= none
TBR=mseaborn@chromium.org

Review URL: https://codereview.chromium.org/70273004

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12383 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
PNaCl: Fix failure in archived-toolchain tests introduced by r12364

Adding tests for SJLJ EH support introduced this failure in the
archived-toolchain tests (which run on the PNaCl FYI bots):

scons-out/nacl-x86-32-pnacl-fast-sbtc-pexe-clang/obj/tests/toolchain/eh_virtual_dtor_sjlj.nexe failed: Error 255

This happens because these tests invoke Scons twice:

 * with old toolchain (for front-end), which causes building *_sjlj
   tests to be disabled;
 * with new toolchain (for translator), which causes using *_sjlj
   tests to be enabled.

Fix this by setting TOOLCHAIN_FEATURE_VERSION to the same version for
both runs.

I've added a toolchain_feature_version option to Scons.  An
alternative would be to save/restore the FEATURE_VERSION file, but
that's less robust: it might leave the toolchain in an odd state if we
failed to restore the file on error, which could cause odd problems in
later buildbot runs.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
TEST=run archived-toolchain tests via trybots

Review URL: https://codereview.chromium.org/69293003

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12384 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Revert 12382 "Deploy new x86 binutils"

> Deploy new x86 binutils
> 
> This puts in place the x86 toolchain using the new 2.24-based binutils.
> 
> BUG= https://code.google.com/p/nativeclient/issues/detail?id=3636
> TEST= trybots
> R=bsy@google.com, sehr@chromium.org
> 
> Review URL: https://codereview.chromium.org/62643002

TBR=mcgrathr@chromium.org

Review URL: https://codereview.chromium.org/71933002

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12385 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Mark Clang::CodeGen/atomics-inlining.c as broken.

R=dschuff@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3623
TEST= ./pnacl/scripts/llvm-test.py --llvm-regressions

Review URL: https://codereview.chromium.org/70623004

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12386 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Enables goma from GYP and GOMA_DIR env.

Currently goma is automatically used if gomacc is included in the PATH.
However, if the developers use goma in "gomacc <compiler name>" style, we
recommend not to include goma directory in the PATH.
This is usually the case with Android.

I expect this change works togather with following change:
https://codereview.chromium.org/69293004/
It adds gomadir GYP_DEFINES for ease of goma configuration.
If gomadir is set to GYP_DEFINES, this change catches it,
and automatically uses it for building untrusted code.

Review URL: https://codereview.chromium.org/66303010

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12387 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Add win8 to nacl trybots.
BUG=none
TEST=trybot run
TBR=bradnelson@google.com

Review URL: https://codereview.chromium.org/68503010

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12388 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Fix newlib build for iconv so that we support UTF-16LE and UCS-4LE.

R=dschuff@chromium.org
TEST= ./scons run_iconv_test -j32 bitcode=1

Review URL: https://codereview.chromium.org/70163008

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12389 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Fix 2 problems with parsing and checking of LLVM test results

First, fix the RunLitTest function of llvm-test.py which was always returning
0 rather than the result of parsing the lit output.
Second clean up the Report stage of parse_llvm_test_report to be more clear
about which functions apply to the testsuite vs the lit test, and allow
the verbose option to be used with the script, even though it is a no-op
for lit tests.

R=jfb@chromium.org
BUG=red FYI bot, green toolchain bot

Review URL: https://codereview.chromium.org/70183006

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12390 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
PNaCl: Update libcxxabi revision in pnacl/COMPONENT_REVISIONS

This pulls in the following libcxxabi change:

865117c: (mseaborn@chromium.org) Modify personality function to work with PNaCl's zero-cost exception handling

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3623
TEST= PNaCl toolchain trybots

Review URL: https://codereview.chromium.org/73503004

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12391 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
Update newlib revision to pull in 'Update newlib so that it passes libc++'s tests.'

    Most of these changes are inconsistencies with existing standards, lack of testing on LLVM, or lack of C99/C11/C++11 support. The fixes aren't thorough, b

    - limits.h: define LLONG_MIN, LLONG_MAX and ULLONG_MAX for C++11 too.
    - stdint.h: define WCHAR_MIN and WCHAR_MAX according to __WCHAR_UNSIGNED__ if it is provided, and correct the limit when unsigned (to 32 all-1 bits, not 3
    - stdint.h: similarly for WINT_MIN and WINT_MAX according to __WINT_UNSIGNED__.
    - stdlib.h: define struct lldiv_t, _Exit, atoll, llabs and lldiv for C99 and C++11.
    - stdlib.h: move wcstold to wchar.h.
    - wchar.h: define WCHAR_MIN and WCHAR_MAX according to __WCHAR_UNSIGNED__ if it is provided, and correct the limit when unsigned (to 32 all-1 bits, not 31
    - wchar.h: define file as in stdio.h.
    - stdlib.h: move wcstold from stdlib.h.

R=mcgrathr@chromium.org, dschuff@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3623
TEST= ./pnacl/scripts/llvm-test.py --libcxx-tests

Review URL: https://codereview.chromium.org/74013006

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@12392 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2