From 012c04aa2b2080a5e32dec14b5049ceb8af2a38d Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 26 Oct 2017 19:19:48 -0700 Subject: [PATCH] [WebAssembly] Remove existing library before creating it with 'ar' --- libc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc.py b/libc.py index 20b55f54..d8a10666 100755 --- a/libc.py +++ b/libc.py @@ -160,6 +160,8 @@ class ObjCompiler(Compiler): return os.path.basename(src)[:-1] + 'o' # .c -> .o def binary(self): + if os.path.exists(self.out): + os.remove(self.out) check_output([os.path.join(self.clang_dir, 'llvm-ar'), 'rcs', self.out] + self.compiled, cwd=self.tmpdir)