@@ -488,7 +488,7 @@ def check_sanity(force=False):
488
488
logging .critical ('Node.js (%s) does not seem to work, check the paths in %s' % (NODE_JS , EM_CONFIG ))
489
489
sys .exit (1 )
490
490
491
- for cmd in [CLANG , LINK_CMD [ 0 ] , LLVM_AR , LLVM_OPT , LLVM_AS , LLVM_DIS , LLVM_NM , LLVM_INTERPRETER ]:
491
+ for cmd in [CLANG , LLVM_LINK , LLVM_AR , LLVM_OPT , LLVM_AS , LLVM_DIS , LLVM_NM , LLVM_INTERPRETER ]:
492
492
if not os .path .exists (cmd ) and not os .path .exists (cmd + '.exe' ): # .exe extension required for Windows
493
493
logging .critical ('Cannot find %s, check the paths in %s' % (cmd , EM_CONFIG ))
494
494
sys .exit (1 )
@@ -529,21 +529,9 @@ def check_sanity(force=False):
529
529
except NameError :
530
530
CLANG_ADD_VERSION = os .getenv ('CLANG_ADD_VERSION' )
531
531
532
- USING_PNACL_TOOLCHAIN = os .path .exists (os .path .join (LLVM_ROOT , 'pnacl-clang' ))
533
-
534
- def modify_prefix (tool ):
535
- if USING_PNACL_TOOLCHAIN :
536
- if tool .startswith ('llvm-' ):
537
- tool = tool [5 :]
538
- tool = 'pnacl-' + tool
539
- if WINDOWS :
540
- tool += '.bat'
541
- return tool
542
-
543
532
# Some distributions ship with multiple llvm versions so they add
544
533
# the version to the binaries, cope with that
545
534
def build_llvm_tool_path (tool ):
546
- tool = modify_prefix (tool )
547
535
if LLVM_ADD_VERSION :
548
536
return os .path .join (LLVM_ROOT , tool + "-" + LLVM_ADD_VERSION )
549
537
else :
@@ -552,7 +540,6 @@ def build_llvm_tool_path(tool):
552
540
# Some distributions ship with multiple clang versions so they add
553
541
# the version to the binaries, cope with that
554
542
def build_clang_tool_path (tool ):
555
- tool = modify_prefix (tool )
556
543
if CLANG_ADD_VERSION :
557
544
return os .path .join (LLVM_ROOT , tool + "-" + CLANG_ADD_VERSION )
558
545
else :
@@ -588,11 +575,7 @@ def get_clang_native_args():
588
575
CLANG_CC = os .path .expanduser (build_clang_tool_path ('clang' ))
589
576
CLANG_CPP = os .path .expanduser (build_clang_tool_path ('clang++' ))
590
577
CLANG = CLANG_CPP
591
- if USING_PNACL_TOOLCHAIN :
592
- # The PNaCl toolchain doesn't have llvm-link, but we can fake it
593
- LINK_CMD = [build_llvm_tool_path ('llvm-ld' ), '-nostdlib' , '-r' ]
594
- else :
595
- LINK_CMD = [build_llvm_tool_path ('llvm-link' )]
578
+ LLVM_LINK = build_llvm_tool_path ('llvm-link' )
596
579
LLVM_AR = build_llvm_tool_path ('llvm-ar' )
597
580
LLVM_OPT = os .path .expanduser (build_llvm_tool_path ('opt' ))
598
581
LLVM_AS = os .path .expanduser (build_llvm_tool_path ('llvm-as' ))
@@ -1365,15 +1348,15 @@ def consider_archive(f):
1365
1348
logging .debug ('emcc: llvm-linking: %s to %s' , actual_files , target )
1366
1349
1367
1350
# check for too-long command line
1368
- link_cmd = LINK_CMD + actual_files + ['-o' , target ]
1351
+ link_cmd = [ LLVM_LINK ] + actual_files + ['-o' , target ]
1369
1352
# 8k is a bit of an arbitrary limit, but a reasonable one
1370
- # for max command line size before we use a respose file
1353
+ # for max command line size before we use a response file
1371
1354
response_file = None
1372
1355
if len (' ' .join (link_cmd )) > 8192 :
1373
1356
logging .debug ('using response file for llvm-link' )
1374
1357
[response_fd , response_file ] = mkstemp (suffix = '.response' , dir = TEMP_DIR )
1375
1358
1376
- link_cmd = LINK_CMD + ["@" + response_file ]
1359
+ link_cmd = [ LLVM_LINK ] + ["@" + response_file ]
1377
1360
1378
1361
response_fh = os .fdopen (response_fd , 'w' )
1379
1362
for arg in actual_files :
0 commit comments