Skip to content

Commit 5d91799

Browse files
committed
Be more careful reflecting the wrapped compiler's return code.
1 parent 9f03580 commit 5d91799

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

wllvm/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,9 @@ def buildObject(builder):
659659
objCompiler.extend(builder.cmd)
660660
proc = Popen(objCompiler)
661661
rc = proc.wait()
662-
if rc != 0:
663-
sys.exit(rc)
662+
_logger.debug('buildObject rc = {0}'.format(rc))
663+
return rc
664+
664665

665666
# This command does not have the executable with it
666667
def buildAndAttachBitcode(builder):

wllvm/wllvm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919

2020
def main():
2121
try:
22+
rc = 1
2223
cmd = list(sys.argv)
2324
cmd = cmd[1:]
24-
2525
builder = getBuilder(cmd, False)
26-
buildObject(builder)
27-
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
26+
rc = buildObject(builder)
27+
if rc == 0 and not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
2828
buildAndAttachBitcode(builder)
2929
except:
3030
pass
31-
return 0
31+
return rc
3232

3333

3434
if __name__ == '__main__':

wllvm/wllvmpp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515

1616
def main():
1717
try:
18+
rc = 1
1819
cmd = list(sys.argv)
1920
cmd = cmd[1:]
20-
2121
builder = getBuilder(cmd, True)
22-
buildObject(builder)
23-
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
22+
rc = buildObject(builder)
23+
if rc == 0 and not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
2424
buildAndAttachBitcode(builder)
2525
except:
2626
pass
27-
return 0
27+
return rc
2828

2929

3030
if __name__ == '__main__':

0 commit comments

Comments
 (0)