native_client/src/native_client.git
6 hours agoRe-enable x86-64 -translate-fast archived-pexe-translator test. master
jvoung@google.com [Tue, 21 May 2013 00:17:32 +0000 (00:17 +0000)]
Re-enable x86-64 -translate-fast archived-pexe-translator test.

Unclear what changed exactly, but we used to run
"llc -O2 -fast-isel", and now we run llc -O0.  It works
now with just -O0, which is what we advertise.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3247
TEST=buildbot/buildbot_pnacl_toolchain_tests.sh archived-pexe-translator-test x86-64
R=stichnot@chromium.org

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

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

8 hours agoPNaCl driver: be less verbose about being unable to wipe a file (by not blindly wiping).
jvoung@google.com [Mon, 20 May 2013 21:43:44 +0000 (21:43 +0000)]
PNaCl driver: be less verbose about being unable to wipe a file (by not blindly wiping).

Currently, it prints a warning that it's unable to wipe a
file, at the default verbosity.  However, this happens
everytime there is an error, because the driver registers a
temp file for all scratch files ahead of time, and if there
is an error, it never got to actually generate the temp file.

Check if the file exists first, instead of blindly trying
to wipe a non-existent file and spamming users.

The warning was added to debug a failure to wipe files on
windows (because it was missing the pathtools.tosys stuff).
Add a test to catch this, instead of logging stuff and
catching problems manually.

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

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

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

8 hours agoBump archived bitcode test revs to 11284.
jvoung@google.com [Mon, 20 May 2013 21:42:27 +0000 (21:42 +0000)]
Bump archived bitcode test revs to 11284.

Version 11284 is the version we currently assume for the
Examples App, and for the browser translator.  If the bot
goes red, that is *sort of* a sign to update them.

Bot can still go red because of superfluous driver changes
(such as commandline flags).  Also doesn't reflect the
current bitcode ABI, since it is the frontend that does
verification right now.  Bot can miss stuff like calling
convention changes, since it only tests against irt_core.

Bump both the archived frontend test and archived pexe test,
since both are broken right now.

One of the current errors:

__PNACL_GENERATED:<SRPC stream>:function __unnamed_1692: error: undefined reference to '_Unwind_Resume'

BUG=none
R=dschuff@chromium.org

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

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

9 hours agoPNaCl: Update LLVM revision in pnacl/DEPS
mseaborn@chromium.org [Mon, 20 May 2013 21:00:27 +0000 (21:00 +0000)]
PNaCl: Update LLVM revision in pnacl/DEPS

This pulls in the following LLVM changes:

6aea8b4: (mseaborn@chromium.org) PNaCl: Fix FlattenGlobals to correctly handle implicitly-aligned variables

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

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

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

9 hours agopread/pwrite implementation. NaClHostDesc level, plus NaClDesc plumbing.
bsy@google.com [Mon, 20 May 2013 20:57:36 +0000 (20:57 +0000)]
pread/pwrite implementation.  NaClHostDesc level, plus NaClDesc plumbing.

Since FileRead / FileWrite OVERLAPPED is used in Windows, and contrary to MSDN documentation, the offset update occurs to the implicit offset rather than the explicit offset in the OVERLAPPED structure, the NaClHostDescRead and NaClHostDescWrite functions were converted over to use FileRead / FileWrite as well, instead of using the Posix emulation layer.  We still use Posix emulation for _fstat64.  Seek becomes just updating the offsets in the explicit OVERLAPPED structure.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3423
TEST= run_nacl_host_desc_pread_pwrite_test
R=mcgrathr@chromium.org

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

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

13 hours agoMove PNaCl driver tests from trusted env to untrusted env
dschuff@chromium.org [Mon, 20 May 2013 17:05:04 +0000 (17:05 +0000)]
Move PNaCl driver tests from trusted env to untrusted env
This will prevent them from being skipped on the toolchain bots.
Also bail if not a bitcode env so they only get run on pnacl bots.
R=jvoung@chromium.org
BUG=none

Review URL: https://chromiumcodereview.appspot.com/15268006

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

3 days agoFix driver test of default translate options on ARM: temporarily not using default
jvoung@chromium.org [Sat, 18 May 2013 04:33:36 +0000 (04:33 +0000)]
Fix driver test of default translate options on ARM: temporarily not using default

The default options are not used in the default case,
because we override the default with -global-merge=0, for now.

TEST=./scons bitcode=1 run_pnacl_driver_tests --verbose platform=arm
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3437

Review URL: https://chromiumcodereview.appspot.com/15393003

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

3 days agoUpdate LLVM deps for PNaCl.
jvoung@google.com [Sat, 18 May 2013 00:38:46 +0000 (00:38 +0000)]
Update LLVM deps for PNaCl.

2357705: (jvoung@chromium.org) Re-allow an x86-32 fast-isel optimization for NaCl / use shorter insts.
4284726: (mseaborn@chromium.org) Cherry-pick r181922: Fix miscompile due to StackColoring incorrectly merging stack slots (PR15707)

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3359
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3374
R=dschuff@chromium.org

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

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

3 days agoDisable ARM GlobalMerge pass in the translator
dschuff@chromium.org [Fri, 17 May 2013 21:18:34 +0000 (21:18 +0000)]
Disable ARM GlobalMerge pass in the translator

GlobalMerge doesn't properly handle alignment of global accesses when the
type information is stripped.
Add the flag to LLC_FLAGS_EXTRA to cause the sandboxed translator's default command line to also be overridden.
(note however that this does not affect the translator when run in the browser; it will remain broken in this way until the bug is fixed, which should be soon.)

R=mseaborn@chromium.org
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3437
TEST=spec2k 176.gcc on hardware bot

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

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

3 days agoRevert "Update TOOL_REVISIONS for PNaCl 11346->11352"
dschuff@chromium.org [Fri, 17 May 2013 16:39:00 +0000 (16:39 +0000)]
Revert "Update TOOL_REVISIONS for PNaCl 11346->11352"

This reverts r11359.
SPEC gcc is failing reliably on ARM hardware.
TBR=ncbray@chromium.org
CC=mseaborn@chromium.org
BUG=red spec bot

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

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

3 days agoPNaCl: Allow "--build-id" to be passed through to the native linker
mseaborn@chromium.org [Fri, 17 May 2013 16:07:32 +0000 (16:07 +0000)]
PNaCl: Allow "--build-id" to be passed through to the native linker

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=requires TOOL_REVISIONS roll to test via run_minidump_test

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

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

4 days agoPNaCl: Update LLVM revision in pnacl/DEPS
dschuff@chromium.org [Fri, 17 May 2013 00:34:00 +0000 (00:34 +0000)]
PNaCl: Update LLVM revision in pnacl/DEPS

This pulls in the following LLVM changes:

33da0d9: (jvoung@chromium.org) Start to disallow llvm.frameaddress and llvm.returnaddress in ABI checker.
442f311: (jvoung@chromium.org) Update PNaCl intrinsic whitelist test for moving {frame,return}address to blacklist.
4a71e62: (eliben@chromium.org) Adding a pass - RewritePNaClLibraryCalls, that replaces known library calls with stable bitcode intrinsics.
1ab5bcc: (eliben@chromium.org) Fix some build warnings in Nacl-specific code
8fe6f1f: (eliben@chromium.org) The customary LLVM way of obtaining intrinsics is with     Intrinsic::getDeclaration and use the definition in     include/llvm/Intrinsics.td
c5d1983: (eliben@chromium.org) Update tests to use FileCheck instead of grep (which is deprecated in the LLVM regression suite)
28aeda4: (eliben@chromium.org) Separate the PNaCl llc into a tool named pnacl-llc (how original!)
b7be947: (eliben@chromium.org) Temporarily remove test that fails on Mac

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3429
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3378
TEST=PNaCl toolchain trybots
R=ncbray@chromium.org

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

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

4 days agoUpdate TOOL_REVISIONS for PNaCl 11346->11352
dschuff@chromium.org [Thu, 16 May 2013 21:17:29 +0000 (21:17 +0000)]
Update TOOL_REVISIONS for PNaCl 11346->11352
This update points at 11352 because that revision fixed the translator build, but its real purpose is to bring in 11351:

Command-line specified PNaCl change:
  git svn id:       11351
  hash:             af3e617939059683a1de5f43e76572939543eb12
  author:           mseaborn@chromium.org
  date:             2013-05-15 19:46:23 +0000
  subject:          PNaCl: Enable FlattenGlobals pass for removing struct types from global vars
  bug:              https://code.google.com/p/nativeclient/issues/detail?id=3113
  test:             PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k
  review url:       https://codereview.chromium.org/14329009

TOOL_REVISIONS update points at PNaCl version:
  git svn id:       11346
  hash:             563dc313f65d7d936c3961268f084b0910528036
  date:             2013-05-14 19:43:06 +0000
  subject:          Subdivide LOAD_NO_MEMORY into additional categories.
  commits since:    11

Most recent TOOL_REVISIONS update:
  hash:             9cb7f73dac787e5a56a600dd90b522e8661657f0
  author:           dschuff@chromium.org
  date:             2013-05-14 23:25:55 +0000
  subject:          Update TOOL_REVISIONS for PNaCl 11322->11346
  commits since:    9

R=jvoung@google.com, mseaborn@chromium.org

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

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

4 days agoEliminate a speedy-reload induced deadlock.
bsy@google.com [Thu, 16 May 2013 20:35:20 +0000 (20:35 +0000)]
Eliminate a speedy-reload induced deadlock.

Forcible termination after reporting synthetic exit status to
eliminate a startup/shutdown race that causes a tab to become wedged /
unresponsive.  See the BUG entry for the details of the race
condition.

TEST= Manual, via nfullagar's speedy fingers.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3436
R=nfullagar@chromium.org

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

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

4 days agoFix run.py to work on pexes (broken by r11178)
mseaborn@chromium.org [Thu, 16 May 2013 18:46:13 +0000 (18:46 +0000)]
Fix run.py to work on pexes (broken by r11178)

Before this change, run.py fails with an error in the "pnacl-meta" tool:

  TypeError: GetBitcodeMetadata() takes exactly 2 arguments (1 given)

Fix this by removing use of pexe metadata from run.py.  This feature
was part of PNaCl+glibc dynamic linking support, which we are
gradually removing.

Also remove the pnacl-meta tool, since it doesn't work and isn't
tested.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3348
TEST=run run.py on a pexe

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

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

4 days agoPNaCl: Remove unused #include
mseaborn@chromium.org [Thu, 16 May 2013 17:23:12 +0000 (17:23 +0000)]
PNaCl: Remove unused #include

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3069
TEST=compile

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

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

4 days agoPNaCl: Add missing newline to _Unwind_*() abort messages
mseaborn@chromium.org [Thu, 16 May 2013 17:00:31 +0000 (17:00 +0000)]
PNaCl: Add missing newline to _Unwind_*() abort messages

The "- 1" is for using sizeof(), not strlen().

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3069
TEST=none

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

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

4 days agoDefault to new linker for PNaCl and update binutils and LLVM.
dschuff@chromium.org [Thu, 16 May 2013 16:55:27 +0000 (16:55 +0000)]
Default to new linker for PNaCl and update binutils and LLVM.

This pulls in a merge to the tip of upstream Binutils 2.23 branch, which includes the --rosegment-gap option, and the
following LLVM revisions:
42ac59f: (eliben@chromium.org) Support @llvm.nacl.{set|long}jmp intrinsics by translating them to library calls
52daf9d: (dschuff@chromium.org) LLVM: Add ELF Note section to NaCl object files identifying them as such to gold
a0efa09: (dschuff@chromium.org) PNaCl ABI: Promote illegal integer types

Combining the rolls with flipping the default gets around
some corner cases with bad interaction between the compiler's generation of the note section, the linker using the old layout, and strip tool from the new binutils.

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

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

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

4 days ago[MIPS] Fix regressions after the change to default bitcode to 0
petarj@mips.com [Thu, 16 May 2013 15:34:56 +0000 (15:34 +0000)]
[MIPS] Fix regressions after the change to default bitcode to 0

Recent set of changes that gives precedence to NaCl-GCC rather than PNaCl
toolchain broke builds for MIPS architecture. This change defaults bitcode
to 1 for MIPS and let us use PNaCl toolchain for everything for MIPS.

The changes that caused regressions are:

commit a06a205a3d98cf9452ae67c9d9bf6f6d4654b736
Remove more cruft for pnacl ARM IRT build.

commit 33bc07c00e625ec14868bd7e0e1b879767d45e1a
Get rid of native_code SCons argument, never default to bitcode=1

commit cdc8be9f02024464fdf7b0878efa8c7f362354a5
Never use PNaCl toolchain to build the IRT

BUG= https://code.google.com/p/chromium/issues/detail?id=130022
TEST= pnacl/build.sh misc-tools
NOTRY=true
(because the panda bot upload is broken. -ds)

Review URL: https://chromiumcodereview.appspot.com/14993008

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

5 days agoPNaCl build: Move build of libsrpc et al. into sdk-private-libs
dschuff@chromium.org [Wed, 15 May 2013 23:45:19 +0000 (23:45 +0000)]
PNaCl build: Move build of libsrpc et al. into sdk-private-libs
They were recently removed from the SCons "SDK" and are no longer
installed via the install_libs target, so we can build them along
with the other private libs used by the translator.

R=jvoung@google.com
BUG=broken translator build

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

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

5 days agoPNaCl: Enable FlattenGlobals pass for removing struct types from global vars
mseaborn@chromium.org [Wed, 15 May 2013 19:46:23 +0000 (19:46 +0000)]
PNaCl: Enable FlattenGlobals pass for removing struct types from global vars

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3113
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k

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

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

5 days agoRemove installation of internal libraries.
sbc@chromium.org [Wed, 15 May 2013 17:49:17 +0000 (17:49 +0000)]
Remove installation of internal libraries.

These libraries do not belong in the SDK and should
not be installed by the install_lib target.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/14619035

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

5 days agoDon't pass the -metadata-text argument to llc, since it's not being used any longer.
eliben@chromium.org [Wed, 15 May 2013 17:29:50 +0000 (17:29 +0000)]
Don't pass the -metadata-text argument to llc, since it's not being used any longer.

BUG=None
R=jvoung@chromium.org

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

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

6 days agoUpdate TOOL_REVISIONS for PNaCl 11322->11346
dschuff@chromium.org [Tue, 14 May 2013 23:25:55 +0000 (23:25 +0000)]
Update TOOL_REVISIONS for PNaCl 11322->11346

This brings in the following PNaCl changes:
NaCl:
11343: PNaCl: Compile newlib and libstdc++ with debugging info
11342: Driver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed native linker

LLVM:
4d0b8cd Move llvm.eh.frame.cfa to the blacklist of intrinsics.
4fbe1a0 Add a llvm lit test for NaCl ARM/X86 support for bswap i16, i32, i64.
0e6d484 PNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes

TOOL_REVISIONS update points at PNaCl version:
  git svn id:       11322
  hash:             577caf860395ac4ca241163680459872d3f502f1
  date:             2013-05-09 14:54:44 +0000
  subject:          Update pnacl LLVM deps.
  commits since:    24

Most recent TOOL_REVISIONS update:
  hash:             0c89a85c79fde2421b880491cce29c1aca3de992
  author:           jfb@chromium.org
  date:             2013-05-10 02:20:28 +0000
  subject:          Update TOOL_REVISIONS for PNaCl 11284->11322
  commits since:    19
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2775
R=mseaborn@chromium.org

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

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

6 days agoMinidumper: Add minidump_generator library to the untrusted-code Gyp build
mseaborn@chromium.org [Tue, 14 May 2013 22:25:13 +0000 (22:25 +0000)]
Minidumper: Add minidump_generator library to the untrusted-code Gyp build

This requires fixing some header install paths, otherwise we get the
old version of pthread.h from the toolchain tarball (from before a
recent libpthread change) and the newer version is installed in the
wrong place.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=gyp build

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

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

6 days agoSubdivide LOAD_NO_MEMORY into additional categories.
bradnelson@google.com [Tue, 14 May 2013 19:43:06 +0000 (19:43 +0000)]
Subdivide LOAD_NO_MEMORY into additional categories.

We currently have a high LOAD_NO_MEMORY failure rate on Windows.
This is probably due to failure to allocate the dynamic text region
as on Windows it is backed by the system page file.
To confirm this is the cause, separating out the dynamic text case
and the address reservation for good measure.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3432
TEST=None
R=bsy@google.com, ncbray@chromium.org

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

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

6 days agoAdd wrapper library for the nacl_irt_exception_handling IRT interface
mseaborn@chromium.org [Tue, 14 May 2013 18:29:44 +0000 (18:29 +0000)]
Add wrapper library for the nacl_irt_exception_handling IRT interface

Switch src/untrusted/minidump_generator and src/untrusted/crash_dump
over to using the new wrapper library.

Add the wrapper library to the Gyp build.

Minor cleanup to use perror() to report errno status in
minidump_generator.cc.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2401
TEST=run_minidump_test_irt run_untrusted_crash_dump_test_irt

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

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

6 days agoTest change to trigger a build
dschuff@chromium.org [Tue, 14 May 2013 15:48:42 +0000 (15:48 +0000)]
Test change to trigger a build
TBR=jvoung@chromium.org
BUG=none

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

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

7 days agoPNaCl: Compile newlib and libstdc++ with debugging info
mseaborn@chromium.org [Mon, 13 May 2013 23:50:06 +0000 (23:50 +0000)]
PNaCl: Compile newlib and libstdc++ with debugging info

This makes it easier to debug non-stripped (non-finalised) pexes when
there are failures in libc code.  This change will increase the size
of the PNaCl toolchain tarball but it won't affect stripped
(finalised) pexes.

BUG=none
TEST=PNaCl toolchain trybots
  + check pnacl-translate'd hello_world.nonfinal.pexe with "objdump -dl"
  (e.g. look for source code line number info in exit())

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

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

7 days agoDriver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed...
dschuff@chromium.org [Mon, 13 May 2013 23:23:05 +0000 (23:23 +0000)]
Driver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed native linker
Also remove support for shared objects and dynamic executables.

The native linker can be specified using --pnacl-nativeld=old or --pnacl-nativeld=new

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

Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=11339
Reverted:https://src.chromium.org/viewvc/native_client?view=rev&revision=11341

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

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

7 days agoRevert "Driver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandb...
dschuff@chromium.org [Mon, 13 May 2013 22:25:02 +0000 (22:25 +0000)]
Revert "Driver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed native linker"

This reverts r11339; it was the wrong upload and had a typo.
TBR=jvoung@chromium.org
BUG=

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

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

7 days agoEnable meta-based validation for shared libraries.
ncbray@chromium.org [Mon, 13 May 2013 22:12:28 +0000 (22:12 +0000)]
Enable meta-based validation for shared libraries.

BUG= https://code.google.com/p/chromium/issues/detail?id=224434
R=bsy@google.com

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

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

7 days agoDriver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed...
dschuff@chromium.org [Mon, 13 May 2013 22:10:24 +0000 (22:10 +0000)]
Driver changes for using git binutils (pnacl/2.23/master aka ng) as non-sandboxed native linker
Also remove support for shared objects and dynamic executables.

The native linker can be specified using --pnacl-nativeld=old or --pnacl-nativeld=ng

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

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

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

7 days agoAdd a way to specialize flags to append in gcc torture tests.
jvoung@google.com [Mon, 13 May 2013 17:07:08 +0000 (17:07 +0000)]
Add a way to specialize flags to append in gcc torture tests.

A file will list a bunch of tests in the form:

<test1>,CFLAGS:<flag1a>,CFLAGS:<flag1b>...
<test2>,CFLAGS:<flag2>
<test3>,CFLAGS:<flag3>

Each of the flags only append (like the current commandline
option --append).  Use this listing to specify
--pnacl-disable-abi-check, instead of simply not running
the tests when they don't match the stable ABI.
That way we can be more aggressive at disallowing
certain intrinsics that are currently being used,
while still getting code-gen coverage.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
TEST=tools/toolchain_tester/torture_test.py pnacl x86-64 --verbose --concurrency=8
tools/toolchain_tester/torture_test.py pnacl x86-32 --verbose --concurrency=8
tools/toolchain_tester/torture_test.py pnacl arm --verbose --concurrency=8

R=dschuff@chromium.org, mseaborn@chromium.org

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

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

10 days agoDisable sel_ldr halt sled tests under pnacl
dschuff@chromium.org [Sat, 11 May 2013 00:53:49 +0000 (00:53 +0000)]
Disable sel_ldr halt sled tests under pnacl
Adding ELF note sections breaks this test with the current pnacl
linker (which uses old-style layout), and there might still be some
outstanding issues with new-style layout in gold.

R=bsy@google.com, jvoung@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2775

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

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

10 days agoExpect worse of runtime_ammp on the panda board (after r11293).
jvoung@google.com [Fri, 10 May 2013 23:58:37 +0000 (23:58 +0000)]
Expect worse of runtime_ammp on the panda board (after r11293).

r11293 was "Update PNaCl in TOOLS_REVISION from 11261 -> 11284"

This included:
(a) forking bitcode reader / writer
(b) removing calling conv rewrite pass localmods
(c) using unique'ed LLVM types instead of non-unique'ed types for varargs
(d) fixing cmake
(e) Conditional linking with libgcc_eh to allow stable bitcode pexes
not to expose symbols needed by it.

Don't know exactly why the perf regressed, but it seems
most likely that (e) shuffled some code around, which
affected ammp a lot (10s of seconds out of over 100
seconds). The benchmark ammp has a single ARM function that
is over 80KB of code, so that might be sensitive to code
layout (and (e) shuffled link-order code around).

BUG = red panda spec bot
R=dschuff@chromium.org

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

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

10 days agoMinidumper: Get the nexe's build ID from PT_NOTE when available
mseaborn@chromium.org [Fri, 10 May 2013 19:56:40 +0000 (19:56 +0000)]
Minidumper: Get the nexe's build ID from PT_NOTE when available

Get the build ID from PT_NOTE in the ELF Program Headers when these
are available at run time.  This currently only works in the NaCl ARM
GCC toolchain, which is the only NaCl toolchain using the new-style
linker layout where the ELF headers are mapped into memory and
accessible via __ehdr_start.

The minidumper will use this build ID by default if it's available,
but the build ID is still overridable by
nacl_minidump_set_module_build_id().

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=run_minidump_test + manual testing of *.dmp files

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

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

10 days agoRemove presubmit errors about #ifs in src/untrusted
mseaborn@chromium.org [Fri, 10 May 2013 18:26:37 +0000 (18:26 +0000)]
Remove presubmit errors about #ifs in src/untrusted

We have a bunch of #ifs in 'src/untrusted' (as well as in 'tests'),
e.g. to test for glibc and IRT builds, and they aren't unreasonable.
The checks just mean I have to pass --bypass-hooks to 'git cl' often.

If we want to enforce that code is portable and PNaCl friendly we
should avoid architecture-specific #defines instead.

BUG=http://code.google.com/p/nativeclient/issues/detail?id=2788
TEST=it removed a warning from http://codereview.chromium.org/10412018/

Review URL: https://chromiumcodereview.appspot.com/10413063

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

10 days agoCheck that dup and imc operations that result in duplicated descriptors maintain...
bsy@google.com [Fri, 10 May 2013 18:17:15 +0000 (18:17 +0000)]
Check that dup and imc operations that result in duplicated descriptors maintain synchronization

This is a test.  We ensure that when we obtain duplicated descriptors
-- whether via the dup syscall or via imc_sendmsg/recvmsg pair -- the
original and duplicated descriptors share the same file I/O pointer.

TEST= run_filepos_test
BUG= None
R=mcgrathr@chromium.org

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

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

10 days agotoolchain_build: Update gcc revision
mcgrathr@chromium.org [Fri, 10 May 2013 18:08:40 +0000 (18:08 +0000)]
toolchain_build: Update gcc revision

This brings in recent upstream fixes on the 4.8 release branch.
Those include fixing the mingw --disable-nls build, so we are
now back on verbatim ng/4.8/master branch with no local patches
that aren't part of the nacl target support.

BUG= none
TEST= toolchain trybots
R=bradnelson@google.com

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

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

10 days agoAdd an option to the llvm-configure-ninja command to set the build type explicitly...
eliben@chromium.org [Fri, 10 May 2013 16:33:17 +0000 (16:33 +0000)]
Add an option to the llvm-configure-ninja command to set the build type explicitly (Release or Debug). The default is Release so current behavior remains unchanged

BUG=None
R=dschuff@chromium.org

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

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

10 days agoBump llvm deps for:
jvoung@google.com [Fri, 10 May 2013 15:24:35 +0000 (15:24 +0000)]
Bump llvm deps for:

4d0b8cd Move llvm.eh.frame.cfa to the blacklist of intrinsics.
4fbe1a0 Add a llvm lit test for NaCl ARM/X86 support for bswap i16, i32, i64.
0e6d484 PNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
R=dschuff@chromium.org

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

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

10 days agoSkip ABI verification for tests of __builtin_{frame,return}_address.
jvoung@google.com [Fri, 10 May 2013 15:23:13 +0000 (15:23 +0000)]
Skip ABI verification for tests of __builtin_{frame,return}_address.

Skip in scons and the gcc torture test suite.

Also skip ABI verification for the LLVM math intrinsics,
bitmanip intrinsics, and atomic intrinsics in scons for now.
Haven't hunted those down in gcc torture test suite yet.

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

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

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

11 days agoUpdate TOOL_REVISIONS for PNaCl 11284->11322
jfb@chromium.org [Fri, 10 May 2013 02:20:28 +0000 (02:20 +0000)]
Update TOOL_REVISIONS for PNaCl 11284->11322

Command-line specified PNaCl change:
  git svn id:       11322
  hash:             577caf860395ac4ca241163680459872d3f502f1
  author:           jvoung@google.com
  date:             2013-05-09 14:54:44 +0000
  subject:          Update pnacl LLVM deps.
  bug:              https://code.google.com/p/nativeclient/issues/detail?id=2833
  test:             <none>
  review url:       https://codereview.chromium.org/15067007
  reviewers:        dschuff@chromium.org
  body:
  ============================================================================
  dda2662 Add dependency on NaClTransforms to lib/Target/ARM.
  e6d4584 Put llvm.powi in the dev list of intrinsics.
  BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
  ============================================================================

TOOL_REVISIONS update points at PNaCl version:
  git svn id:       11284
  hash:             add82317f7889a41506fc3720eab32c9b1796797
  date:             2013-05-02 18:40:08 +0000
  subject:          Punch the --pnacl-allow-exceptions through from pnacl-driver/ld to translate.
  commits since:    43

Most recent TOOL_REVISIONS update:
  hash:             c6c64d5aaed0df86df237776f3140acd716d63ea
  author:           mcgrathr@chromium.org
  date:             2013-05-03 20:43:09 +0000
  subject:          Revert last two TOOL_REVISIONS updates
  commits since:    29

R=jvoung@google.com

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

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

11 days agoMinidumper: Extend to dump the stack contents
mseaborn@chromium.org [Thu, 9 May 2013 21:38:33 +0000 (21:38 +0000)]
Minidumper: Extend to dump the stack contents

This allows a stack backtrace to be extracted from the minidump.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=run_minidump_test + manual testing of *.dmp files

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

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

11 days agoScript to auto-update PNaCl tool revisions
jfb@chromium.org [Thu, 9 May 2013 21:29:56 +0000 (21:29 +0000)]
Script to auto-update PNaCl tool revisions

I'm not done automating the entire thing so that it can run as a dumb
cron job, but I think it's at a good enough point to share and let other
people run while I'm on vacation.

I doubt that this will make it through code review before the end of the
week, but I'm CC'ing Pythonistas to comment on how horrible my Python
is, as well as likely users of this script.

You can just run the script from your nacl/native_client directory as:
  ./build/update_pnacl_tool_revisions.py

There's also an option to update to a particular git svn id. The script
uses you repo's local git branches as a form of state, so you might need
to delete branches when it gets unhappy, and it won't care if someone
else has a similar CL in flight.

BUG= none
TESTS= none
R=eliben@chromium.org, jvoung@chromium.org

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

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

11 days agoUpdate .DEPS.git
chrome-admin@google.com [Thu, 9 May 2013 16:42:55 +0000 (16:42 +0000)]
Update .DEPS.git

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

11 days agoUpdate third_party DEPS to pull bloat and webtreemap.
jfb@chromium.org [Thu, 9 May 2013 16:40:56 +0000 (16:40 +0000)]
Update third_party DEPS to pull bloat and webtreemap.

They were added in:
  https://codereview.chromium.org/14746016/

These will be used in our infrastructure to track the filesize of the llc.nexe that's shipped with Chrome (it's currently way too big at ~11MB). The goal is to track it, know when we're wasting space, and identify regressions (especially when we do upstream merges).

It will only be used by the bots, and the html+css+json files will be archived.

R=dschuff@chromium.org
BUG= none
TESTS= none

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

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

11 days agoUpdate pnacl LLVM deps.
jvoung@google.com [Thu, 9 May 2013 14:54:44 +0000 (14:54 +0000)]
Update pnacl LLVM deps.

dda2662 Add dependency on NaClTransforms to lib/Target/ARM.
e6d4584 Put llvm.powi in the dev list of intrinsics.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2833
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=dschuff@chromium.org

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

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

12 days agoUpdate GDB revision in tools/REVISIONS to get core dump fix
mseaborn@chromium.org [Thu, 9 May 2013 05:13:14 +0000 (05:13 +0000)]
Update GDB revision in tools/REVISIONS to get core dump fix

This pulls in:
9e993e01 (mseaborn): Fix nacl-gdb so that it can read ELF core dump files

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

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

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

12 days agolibpthread: Add pthread_get_stack_end_np() API for use by crash dumper
mseaborn@chromium.org [Thu, 9 May 2013 04:26:43 +0000 (04:26 +0000)]
libpthread: Add pthread_get_stack_end_np() API for use by crash dumper

The minidump generator will need to get the address from which the
stack grows so that it can dump the stack contents.

I considered implementing glibc's pthread_getattr_np() API for newlib.
On Linux, this can be used with pthread_attr_getstack() to find the
full range of the stack (minimum address and size).  However:

 * Under NaCl, there's no way to find the minimum address of the
   initial thread's stack.  The initial stack is currently 16MB
   (NACL_DEFAULT_STACK_MAX) but this isn't guaranteed by the ABI.

 * Consequently, glibc's pthread_getattr_np() does not work under NaCl
   on the initial thread.  It tries to open /proc/self/maps and fails.

 * If we implemented pthread_getattr_np(), it would need to return
   other attributes correctly too (e.g.
   pthread_attr_getdetachstate()), so it is more burdensome to
   implement.

I've added the function in a separate .c file so that the IRT doesn't
have to define __nacl_initial_thread_stack_end, so:

 * Moved NODE_TO_PAYLOAD() to a header and cleaned it up a little.
 * Made __nc_initial_thread_id non-static.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=run_stack_end_test

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

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

12 days agofixes bug in mmap failures not being propagated
bsy@google.com [Thu, 9 May 2013 00:11:22 +0000 (00:11 +0000)]
fixes bug in mmap failures not being propagated

Mapping in a file opened with O_RDONLY, with PROT_READ | PROT_WRITE
and MAP_SHARED instead of MAP_PRIVATE should fail, but it should
return MAP_FAILED with errno set to EACCES.  Currently, it aborts the
process.  This fixes the errno propagation, and adds a test (to the
prot_exec test framework) to verify the fix / prevent re-introduction.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3430
TEST= mmap_prot_exec
R=mcgrathr@chromium.org

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

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

12 days agoDisable ABI check for stack alignment test that uses __builtin_dwarf_cfa.
jvoung@google.com [Wed, 8 May 2013 20:38:55 +0000 (20:38 +0000)]
Disable ABI check for stack alignment test that uses __builtin_dwarf_cfa.

The intrinsic is normally used for the implementation of libgcc_eh.

TEST=run_barebones_stack_alignment16_test
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=dschuff@chromium.org, mseaborn@chromium.org

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

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

12 days agoPull in divide-by-zero test change for ARM.
sehr@google.com [Wed, 8 May 2013 20:22:57 +0000 (20:22 +0000)]
Pull in divide-by-zero test change for ARM.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2833
TEST= all ARM tests
R=jfb@chromium.org

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

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

12 days agoUse -march=armv7-a on Android/ARM
mcgrathr@chromium.org [Wed, 8 May 2013 18:24:45 +0000 (18:24 +0000)]
Use -march=armv7-a on Android/ARM

The Android NDK compilers do not default to an ARMv7-A target,
but NaCl requires one.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3032
TEST= none
R=bradnelson@google.com

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

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

12 days agoRemove _Unwind_* stubs from pnacl_abi.bc
eliben@chromium.org [Wed, 8 May 2013 15:22:56 +0000 (15:22 +0000)]
Remove _Unwind_* stubs from pnacl_abi.bc

For stable builds, they are provided by unwind_stubs.bc
Also, when doing the final bitcode link, gold accepts flags that
tell it to allow these symbols to remain undefined, which makes
the unstable-with-exceptions builds work.

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

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

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

12 days agoReplace dfacheckdecoder with dfacheckvalidator in PRESUBMIT.py
khim@google.com [Wed, 8 May 2013 12:57:18 +0000 (12:57 +0000)]
Replace dfacheckdecoder with dfacheckvalidator in PRESUBMIT.py

dfacheckdecoder is not part of regular testing plan, it's the
forensic tool for .def files debugging.

dfacheckvalidator is what guarantees validator changes safety.

BUG = NONE
TEST = NONE
R=shcherbina@google.com

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

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

13 days agoFix checkdeps failure introduced by r11312
mseaborn@chromium.org [Tue, 7 May 2013 22:43:21 +0000 (22:43 +0000)]
Fix checkdeps failure introduced by r11312

checkdeps complained about #including a Breakpad header:

ERROR in .../native_client/src/untrusted/minidump_generator/minidump_generator.cc
Illegal include: "breakpad/src/google_breakpad/common/minidump_format.h"
    Because of no rule applying

For some unknown reason, checkdeps on the trybots didn't report this
error.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=run "tools/checkdeps/checkdeps.py" locally

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

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

13 days agoAdd a minimal Breakpad-compatible minidump generator for crash reporting
mseaborn@chromium.org [Tue, 7 May 2013 22:07:37 +0000 (22:07 +0000)]
Add a minimal Breakpad-compatible minidump generator for crash reporting

This implementation has the following caveats:

 * It dumps register state only.  Dumping the stack (to allow stack
   backtraces) requires some support from libpthread.

 * The minidumper can't automatically determine the nexe's name or its
   build ID yet.

 * There is no automated testing of the resulting minidump yet.  I
   have tested this manually (for x86-32, x86-64 and ARM), using
   Breakpad's dump_syms + minidump_stackwalk and checking that
   Breakpad reports the source code line number of the crash.

 * We might consider moving this implementation to the Breakpad repo
   later when it is more mature.  For now, it is faster to develop
   this in the NaCl repo.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=run_minidump_test + manual testing of *.dmp files

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

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

13 days agoUpdate .DEPS.git
chrome-admin@google.com [Tue, 7 May 2013 21:07:28 +0000 (21:07 +0000)]
Update .DEPS.git

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

13 days agoPull in Breakpad via DEPS in order to get the minidump format headers
mseaborn@chromium.org [Tue, 7 May 2013 21:05:28 +0000 (21:05 +0000)]
Pull in Breakpad via DEPS in order to get the minidump format headers

This is in preparation for using minidump_format.h etc. in a minidump
generator implementation, and possibly for testing Breakpad's stack
backtracing end-to-end.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=none

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

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

13 days agoDon't build arm-flavored bitcode components
dschuff@chromium.org [Tue, 7 May 2013 20:50:52 +0000 (20:50 +0000)]
Don't build arm-flavored bitcode components
Now that the IRT is built with nacl-gcc on all platforms, we no longer
need arm-flavored newlib, libstdcpp et al. and they are no longer being
tested.

R=jvoung@chromium.org
BUG=cleanup

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

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

13 days agoAdd -strip-dead-prototypes to PNaCl pass list to appease intrinsic verifier.
jvoung@google.com [Tue, 7 May 2013 18:43:42 +0000 (18:43 +0000)]
Add -strip-dead-prototypes to PNaCl pass list to appease intrinsic verifier.

Otherwise, when optimizations are turned off, va_args-related
intrinsic declarations are left around even though
-expand-varargs makes them unneeded.

Alternatively, the -expand-varargs pass could hunt down the
dead prototypes on its own.

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

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

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

13 days agoAdd presubmit script validator_ragel
khim@google.com [Tue, 7 May 2013 18:12:23 +0000 (18:12 +0000)]
Add presubmit script validator_ragel

...to make sure validator changes will not be commited with running dfacheckvalidator test.

R=shcherbina@google.com

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

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

13 days agoPNaCl: Run LowerInvoke when exceptions are disabled even for mixed-object linking
eliben@chromium.org [Tue, 7 May 2013 16:53:50 +0000 (16:53 +0000)]
PNaCl: Run LowerInvoke when exceptions are disabled even for mixed-object linking

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

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

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

13 days agoRoll binutils in pnacl/DEPS to include the addition of the --allow-unresolved flag...
eliben@chromium.org [Tue, 7 May 2013 16:37:18 +0000 (16:37 +0000)]
Roll binutils in pnacl/DEPS to include the addition of the --allow-unresolved flag to the bitcode linker.

BUG=None
R=jvoung@chromium.org

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

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

13 days agoUpdate PNaCL LLVM REV.
kschimpf@google.com [Tue, 7 May 2013 16:29:02 +0000 (16:29 +0000)]
Update PNaCL LLVM REV.

a4c38e6 Copy llvm-bcanalyzer to build pnacl-bcanalyzer.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
Review URL= https://codereview.chromium.org/15013003

R=jvoung@chromium.org

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

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

2 weeks agoPNaCl: Move ExpandByVal pass to run later, after link-time optimisations
mseaborn@chromium.org [Tue, 7 May 2013 06:27:27 +0000 (06:27 +0000)]
PNaCl: Move ExpandByVal pass to run later, after link-time optimisations

This will allow some byval arguments to be expanded away by LLVM's
ArgPromotion pass, and it allows some dead stores to be eliminated,
because "byval" is a stronger constraint than what ExpandByVal expands
it to.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3408
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k

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

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

2 weeks agoRemove pnacl/tc_component_packager.py, which was experimental and is unused.
jvoung@google.com [Mon, 6 May 2013 23:41:18 +0000 (23:41 +0000)]
Remove pnacl/tc_component_packager.py, which was experimental and is unused.

BUG=none
R=dschuff@chromium.org

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

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

2 weeks agoUpdate PNaCl LLVM REV.
kschimpf@google.com [Mon, 6 May 2013 21:24:02 +0000 (21:24 +0000)]
Update PNaCl LLVM REV.

e8e0569 Allow pnacl-freeze/thaw to redirect to stdin/stdout.
7b64d98 Fix build warnings/UB in LTOCodeGenerator.cpp

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@google.com

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

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

2 weeks agoRemove torture test shell script.
dschuff@chromium.org [Mon, 6 May 2013 18:13:13 +0000 (18:13 +0000)]
Remove torture test shell script.
The python script has its functionality, and is now used by the bots.

R=eliben@chromium.org
BUG=none

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

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

2 weeks agoUpdate toolchain tester to allow translation flags to be specified, and use them...
dschuff@chromium.org [Mon, 6 May 2013 16:31:39 +0000 (16:31 +0000)]
Update toolchain tester to allow translation flags to be specified, and use them to enable EH.
This should fix the torture test portion of the FYI bots

R=jvoung@chromium.org
BUG=

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

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

2 weeks agoRevert last two TOOL_REVISIONS updates
mcgrathr@chromium.org [Fri, 3 May 2013 20:43:09 +0000 (20:43 +0000)]
Revert last two TOOL_REVISIONS updates

This reverts r11294 and r11295.  The toolchain changes cause complications
for the chromium/DEPS update and we don't want to deal with that until
after next week's branch point.

BUG= none
TEST= trybots
R=bsy@google.com

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

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

2 weeks agotoolchain_build: Update gcc revision
mcgrathr@chromium.org [Fri, 3 May 2013 20:36:36 +0000 (20:36 +0000)]
toolchain_build: Update gcc revision

This brings in recent upstream fixes on the 4.8 branch, and reverts the
switch to -mfpu=neon, which is not yet ready for prime time.

BUG= none
TEST= toolchain trybots
R=bradnelson@google.com

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

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

2 weeks agoFix the linux_nacl_sdk
khim@google.com [Fri, 3 May 2013 15:51:10 +0000 (15:51 +0000)]
Fix the linux_nacl_sdk

PNaCl does not include objdump currently thus build of
pnacl_irt_shim for arm fails with
  pnacl-objcopy: not found
message.

Sadly this does not happen on NaCl waterfall, it only happens
on linux_nacl_sdk bot.

R=bradnelson@google.com

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

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

2 weeks agoBring automatic --build-id in the remaining toolchains
khim@google.com [Fri, 3 May 2013 11:44:34 +0000 (11:44 +0000)]
Bring automatic --build-id in the remaining toolchains

BUG = NONE
TEST = trybots

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

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

2 weeks agoMake RodataSwitch compatible with build id.
khim@google.com [Fri, 3 May 2013 07:26:48 +0000 (07:26 +0000)]
Make RodataSwitch compatible with build id.

BUG = NONE
TEST = trybots
R=mcgrathr@chromium.org

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

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

2 weeks agoUpdate PNaCl in TOOLS_REVISION from 11261 -> 11284
jvoung@google.com [Thu, 2 May 2013 23:56:52 +0000 (23:56 +0000)]
Update PNaCl in TOOLS_REVISION from 11261 -> 11284

Try to pull this so that we get the --pnacl-allow-exceptions
stuff a bit more consistent for M28 SDK (need it in both
driver and translate).

r11284 | Punch the --pnacl-allow-exceptions through from pnacl-driver/ld to translate.
r11280 | Update PNaCl LLVM DEPS.
  > 7ecb66d Copy BitCodes.h to NaCl/NaClBitCodes.h
  > b56422f Fix ifdef for NaClLLVMBitCodes.h
r11275 | Moving crt1*.x to pnacl/support/bitcode because it's part of the bitcode build process.
r11274 | Update PNaCl LLVM DEPS.
  > f42b26d Copy LLVM bitcode reader to generate a PNaCl wire format reader.
  > 595239b Remove a hanging LOCALMOD that was for the CC rewrite pass.
r11271 | Conditional linking with libgcc_eh to allow stable bitcode pexes not to expose symbols needed by it.
r11268 | Remove -cc-rewrite flags from PNaCl driver.
r11266 | Update pnacl_llvm_rev: Remove unnecessary includes from pnacl-freeze
r11264 | Update PNaCl LLVM DEPS.
  > 1174111 Use unique'ed types for varargs expansion instead of non-unique named types.
  > 9986176 Fix CMake build of bitcode wrapper header utility. It wasn't even attempting to build before.
  > fa3dba3 Fix CMake build of NaClBitWriter

BUG=(a bunch, but the individual CLs already specified BUG=...)

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

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

2 weeks agoRemove native pnacl arm nexe gyp target.
dschuff@chromium.org [Thu, 2 May 2013 22:52:28 +0000 (22:52 +0000)]
Remove native pnacl arm nexe gyp target.
Once the flavored bitcode newlib and libstdc++ is removed from pnacl, this target won't be usable.
(however, keep the library target for the pnacl IRT shims).

R=sbc@chromium.org
BUG=none

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

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

2 weeks agoException handling: Fix leak of NaClAppThread address (r9) to untrusted code
mseaborn@chromium.org [Thu, 2 May 2013 22:49:54 +0000 (22:49 +0000)]
Exception handling: Fix leak of NaClAppThread address (r9) to untrusted code

We don't want to leak trusted addresses to untrusted code, and the ARM
validator was previously changed not to allow instructions that read
r9.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3298
TEST=run_exception_test

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

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

2 weeks agoRetain the unstripped nexe at a predictable location.
bradnelson@google.com [Thu, 2 May 2013 22:48:22 +0000 (22:48 +0000)]
Retain the unstripped nexe at a predictable location.

Retaining the unstripped nexe at a predictable location in order to allow us to
archive a copy of the unstripped IRT, and to have it available locally.
Add a gnu_debuglink link to the stripped irt (and other nexes/so) to facilitate the debugger finding the debugging info.

Now that we have a process to retain debug info, strip fully for irt_core and tests.

BUG=http://code.google.com/p/chromium/issues/detail?id=117242
TEST=builds
R=jvoung@chromium.org

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

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

2 weeks agoPull binutils changes to make it compatible with --build-id
khim@google.com [Thu, 2 May 2013 22:17:34 +0000 (22:17 +0000)]
Pull binutils changes to make it compatible with --build-id

BUG = NONE
TEST = trybots & build with https://codereview.chromium.org/14605004/
R=mcgrathr@chromium.org

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

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

2 weeks agotoolchain_build: Enable build-id, update gcc revision
mcgrathr@chromium.org [Thu, 2 May 2013 21:30:50 +0000 (21:30 +0000)]
toolchain_build: Enable build-id, update gcc revision

This brings in recent upstream fixes on the 4.8 release branch, plus the
switch to default to -mfpu=neon.  It also enables --build-id by default.

BUG= none
TEST= toolchain trybot
R=bradnelson@google.com

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

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

2 weeks agoRemove old pnacl/unsupported/non_bitcode_symbols.txt list.
jvoung@google.com [Thu, 2 May 2013 21:25:35 +0000 (21:25 +0000)]
Remove old pnacl/unsupported/non_bitcode_symbols.txt list.

This is yet another list identifying things defined by native
code, that the bitcode depends on.  There shouldn't be any
that aren't intrinsics.  Remove the pexecheck tool that
uses this text file.

The llvm-ld util to help dump this and run the checks
doesn't exist anymore.

BUG=none (random cleanup)
R=eliben@chromium.org

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

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

2 weeks agoRemove hg-migrate code from when we moved the location of pnacl hg checkouts.
jvoung@google.com [Thu, 2 May 2013 21:10:00 +0000 (21:10 +0000)]
Remove hg-migrate code from when we moved the location of pnacl hg checkouts.

None of the bots and non-bots should have the old checkout anymore.

BUG=none
R=dschuff@chromium.org

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

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

2 weeks agoRemove more cruft for pnacl ARM IRT build.
dschuff@chromium.org [Thu, 2 May 2013 20:15:47 +0000 (20:15 +0000)]
Remove more cruft for pnacl ARM IRT build.
This is no longer needed, but was missed when we removed the
ability to build the IRT with pnacl from SConstruct.

R=mcgrathr@chromium.org
BUG=none

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

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

2 weeks agoPunch the --pnacl-allow-exceptions through from pnacl-driver/ld to translate.
jvoung@google.com [Thu, 2 May 2013 18:40:08 +0000 (18:40 +0000)]
Punch the --pnacl-allow-exceptions through from pnacl-driver/ld to translate.

This is for the all-the-way-to-native mode:
"pnacl-clang++ -arch x86-64 ... -o blah.nexe"
(instead of without -arch and -o blah.pexe).
Otherwise the native link step will fail because it was not
aware of --pnacl-allow-exceptions.

Also fix the behavior of -translate-fast if given to pnacl-ld w/
-arch ... -o blah.nexe.  Previously it was clobbering all of the
TRANSLATE_FLAGS with env.set(), when it should just env.append().

BUG=http://code.google.com/p/nativeclient/issues/detail?id=3069
TEST=./scons bitcode=1 pnacl_generate_pexe=0 toolchain_tests
R=eliben@chromium.org

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

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

2 weeks agoRollback --enable-linker-build-id change
khim@google.com [Thu, 2 May 2013 18:09:05 +0000 (18:09 +0000)]
Rollback --enable-linker-build-id change

More work needed (with linker scripts).

R=bradnelson@google.com

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

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

2 weeks agoEnable build ID by default
khim@google.com [Thu, 2 May 2013 16:59:08 +0000 (16:59 +0000)]
Enable build ID by default

Use --enable-linker-build-id to embed build ID in binaries
by default.

BUG = NONE
TEST = objdump -s -j .note.gnu.build-id libc.so

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

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

2 weeks agoDon't copy various sys/ and bits/ headers into glibc toolchain
mcgrathr@chromium.org [Thu, 2 May 2013 16:37:11 +0000 (16:37 +0000)]
Don't copy various sys/ and bits/ headers into glibc toolchain

Nothing should need these.

BUG= http://code.google.com/p/nativeclient/issues/detail?id=2335
TEST= toolchain trybot

R=pasko@google.com

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

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

2 weeks agoUpdate PNaCl LLVM DEPS.
kschimpf@google.com [Thu, 2 May 2013 16:24:14 +0000 (16:24 +0000)]
Update PNaCl LLVM DEPS.

7ecb66d Copy BitCodes.h to NaCl/NaClBitCodes.h
b56422f Fix ifdef for NaClLLVMBitCodes.h

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

Review URL: https://chromiumcodereview.appspot.com/14682013
Review URL: https://chromiumcodereview.appspot.com/14569006

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

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

2 weeks agoHave gcc torture-test buildbot script print STEP_FAILURE on errors.
jvoung@google.com [Wed, 1 May 2013 22:32:42 +0000 (22:32 +0000)]
Have gcc torture-test buildbot script print STEP_FAILURE on errors.

BUG=Bots are failing to build eh-tests, but they are not printing STEP_FAILURE.
R=dschuff@chromium.org

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

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

2 weeks agoGet rid of native_code SCons argument, never default to bitcode=1
mcgrathr@chromium.org [Wed, 1 May 2013 22:29:25 +0000 (22:29 +0000)]
Get rid of native_code SCons argument, never default to bitcode=1

Having bitcode=1 be the default under platform=arm was done back when
there was no non-bitcode option for ARM.  Removing that special case
makes the SCons behavior consistent across all targets: you only get
bitcode if you pass bitcode=1 explicitly.  Places that care already
pass bitcode=1 along with platform=arm.

BUG= none
TEST= trybots
R=dschuff@chromium.org

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

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

2 weeks agoRelocating nacl_exceptions.h to src/include/nacl.
bradnelson@google.com [Wed, 1 May 2013 22:24:27 +0000 (22:24 +0000)]
Relocating nacl_exceptions.h to src/include/nacl.

We would like nacl_exceptions.h to be added to the sdk by the sdk build
scripts, rather than baked into the newlib toolchain.
Relocating it as all of service_runtime/include is current exported.

BUG=None
TEST=builds
R=bsy@google.com, mcgrathr@chromium.org

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

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

2 weeks agoDisable stub_out_mode if validator does not support it.
khim@google.com [Wed, 1 May 2013 22:21:25 +0000 (22:21 +0000)]
Disable stub_out_mode if validator does not support it.

Currently ARM validator and RDFA x86 validator don't support
stub_out_mode and if someone tries to use it sel_ldr prints
"File violates Native Client safety rules" sage ven if file
is in fact valid NaCl file.

Print warning if file is validateable and appropriate error
if not.

BUG = https://groups.google.com/d/msg/native-client-discuss/Hlj_05SxI0U/KZ-3DXgsM6kJ
TEST = trybots
R=ncbray@chromium.org

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

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

2 weeks agoMoving crt1*.x to pnacl/support/bitcode because it's part of the bitcode build process.
eliben@chromium.org [Wed, 1 May 2013 22:11:46 +0000 (22:11 +0000)]
Moving crt1*.x to pnacl/support/bitcode because it's part of the bitcode build process.

BUG=None

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

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

2 weeks agoUpdate PNaCl LLVM DEPS.
kschimpf@google.com [Wed, 1 May 2013 19:57:08 +0000 (19:57 +0000)]
Update PNaCl LLVM DEPS.

f42b26d Copy LLVM bitcode reader to generate a PNaCl wire format reader.
595239b Remove a hanging LOCALMOD that was for the CC rewrite pass.

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

Review URL: https://chromiumcodereview.appspot.com/14314016

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

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

2 weeks agoNever use PNaCl toolchain to build the IRT
mcgrathr@chromium.org [Wed, 1 May 2013 17:50:01 +0000 (17:50 +0000)]
Never use PNaCl toolchain to build the IRT

Since arm-nacl-gcc is capable of building the IRT and that's how the
Chromium/PPAPI IRT will be built from now on, build irt_core.nexe that
way too.  This will make it possible to drop various kinds of kludgery
from the PNaCl build that were done just to enable the IRT build.

BUG= none
TEST= trybots
R=dschuff@chromium.org

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

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

2 weeks agoAdded NaClDescIoDescFromHandleAllocCtor, deprecated NaClDescIoDescMakeFromHandle...
bsy@google.com [Wed, 1 May 2013 17:25:32 +0000 (17:25 +0000)]
Added NaClDescIoDescFromHandleAllocCtor, deprecated NaClDescIoDescMakeFromHandle.  Fixed error propagation bugs.

This CL deprecates NaClDescIoDescMakeFromHandle, introduced in https://chromiumcodereview.appspot.com/12929033/, which is a proximal cause of the problem described in chromium:183015, and adds replacement function NaClDescIoDescFromHandleAllocCtor which accepts a flags argument.

The introduced test, in nacl_desc_io_alloc_ctor_test.c, exercises the new interface with a variety of flag arguments and attempts to read, write, and mmap using the resultant NaClDesc object to check against expected results.

Fixed a bug found by this test where, in Windows, mmap with an O_WRONLY file, a CHECK was triggered when an error should have been detected.

Fixed a bug found by this test where errno returns from NaClHostDescMap was not being propagated properly.

TEST= run_nacl_desc_io_alloc_ctor_test
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3409 https://code.google.com/p/nativeclient/issues/detail?id=3416 https://code.google.com/p/nativeclient/issues/detail?id=3418
R=mcgrathr@chromium.org

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

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

2 weeks agoConditional linking with libgcc_eh to allow stable bitcode pexes not to expose symbol...
eliben@chromium.org [Wed, 1 May 2013 16:54:30 +0000 (16:54 +0000)]
Conditional linking with libgcc_eh to allow stable bitcode pexes not to expose symbols needed by it.

[see issue https://code.google.com/p/nativeclient/issues/detail?id=3069 for a
full discussion]

Some symbols (malloc, free, abort, strlen) are exposed by the pexe because
libgcc_eh references them. Since we don't support exceptions in the first
public stable ABI for PNaCl, there's no need to link the libgcc_eh library.

This CL makes the linking of libgcc_eh conditional. By default it is not
being linked, and the above symbols are not exposed by the pexe. This is done
by removing them from the crt1.x linker script that sets them to exported.

To make this work, some other dependencies on libgcc_eh have to be resolved.
crtbegin is compiled conditionally to have a version that doesn't depend on
libgcc_eh for stable ABI builds. In addition, a stub implementation of
_Unwind_* functions is provided for this case.

The driver scripts (pnacl-clang[++] and pnacl-translate) are adjusted to
support the stable (no EH) build by default, and provide a EH-supporting build
when the --pnacl-allow-exceptions flag is provided. pnacl-clang already had
that flag, but for pnacl-translate it's new.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3069

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

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