Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
e8b404b4
Commit
e8b404b4
authored
Sep 16, 2014
by
Jim Stichnoth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subzero: Make python clean up after itself by removing its /tmp subdir.
BUG= none R=jvoung@chromium.org Review URL:
https://codereview.chromium.org/551723003
parent
0fb613f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
build-pnacl-ir.py
pydir/build-pnacl-ir.py
+22
-13
No files found.
pydir/build-pnacl-ir.py
View file @
e8b404b4
#!/usr/bin/env python2
#!/usr/bin/env python2
import
argparse
import
argparse
import
errno
import
os
import
os
import
shutil
import
tempfile
import
tempfile
from
utils
import
shellcmd
from
utils
import
shellcmd
from
utils
import
FindBaseNaCl
from
utils
import
FindBaseNaCl
...
@@ -21,18 +23,25 @@ if __name__ == '__main__':
...
@@ -21,18 +23,25 @@ if __name__ == '__main__':
nacl_root
+
'/toolchain/linux_x86/pnacl_newlib/bin'
+
os
.
pathsep
+
nacl_root
+
'/toolchain/linux_x86/pnacl_newlib/bin'
+
os
.
pathsep
+
os
.
pathsep
+
os
.
environ
[
'PATH'
])
os
.
pathsep
+
os
.
environ
[
'PATH'
])
tempdir
=
tempfile
.
mkdtemp
()
try
:
tempdir
=
tempfile
.
mkdtemp
()
for
cname
in
args
.
cfile
:
for
cname
in
args
.
cfile
:
basename
=
os
.
path
.
splitext
(
cname
)[
0
]
basename
=
os
.
path
.
splitext
(
cname
)[
0
]
llname
=
os
.
path
.
join
(
tempdir
,
basename
+
'.ll'
)
llname
=
os
.
path
.
join
(
tempdir
,
basename
+
'.ll'
)
pnaclname
=
basename
+
'.pnacl.ll'
pnaclname
=
basename
+
'.pnacl.ll'
pnaclname
=
os
.
path
.
join
(
args
.
dir
,
pnaclname
)
pnaclname
=
os
.
path
.
join
(
args
.
dir
,
pnaclname
)
shellcmd
(
'pnacl-clang -O2 -c {0} -o {1}'
.
format
(
cname
,
llname
))
shellcmd
(
'pnacl-clang -O2 -c {0} -o {1}'
.
format
(
cname
,
llname
))
shellcmd
(
'pnacl-opt '
+
shellcmd
(
'pnacl-opt '
+
'-pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt'
+
'-pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt'
+
(
''
if
args
.
disable_verify
else
(
''
if
args
.
disable_verify
else
' -verify-pnaclabi-module -verify-pnaclabi-functions'
)
+
' -verify-pnaclabi-module -verify-pnaclabi-functions'
)
+
' -pnaclabi-allow-debug-metadata'
' -pnaclabi-allow-debug-metadata'
' {0} -S -o {1}'
.
format
(
llname
,
pnaclname
))
' {0} -S -o {1}'
.
format
(
llname
,
pnaclname
))
finally
:
try
:
shutil
.
rmtree
(
tempdir
)
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
ENOENT
:
# ENOENT - no such file or directory
raise
# re-raise exception
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment