diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-09-25 18:56:58 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-09-25 18:56:58 -0700 |
commit | 80e2f0333d58b56fb33f91f17574158f3a39e04c (patch) | |
tree | 5bcda082e2650b71278675a26d279f8276d8b372 | |
parent | 39b93880df73cb06c33d7eb393b150a7c961f4bd (diff) |
fix header parsing bug and unistd.h header; fixes unistd_confstr
-rwxr-xr-x | emscripten.py | 8 | ||||
-rw-r--r-- | system/include/libc/sys/unistd.h | 8 | ||||
-rw-r--r-- | tests/runner.py | 1 |
3 files changed, 10 insertions, 7 deletions
diff --git a/emscripten.py b/emscripten.py index e316e806..8a1fb03e 100755 --- a/emscripten.py +++ b/emscripten.py @@ -169,23 +169,25 @@ def main(args): defines = {} include_root = path_from_root('system', 'include') headers = args.headers[0].split(',') if len(args.headers) > 0 else [] + seen_headers = set() while len(headers) > 0: header = headers.pop(0) if not os.path.isabs(header): header = os.path.join(include_root, header) + seen_headers.add(header) for line in open(header, 'r'): line = line.replace('\t', ' ') - m = re.match('^ *#define +(?P<name>[-\w_.]+) +\(?(?P<value>[-\w_.|]+)\)?.*', line) + m = re.match('^ *# *define +(?P<name>[-\w_.]+) +\(?(?P<value>[-\w_.|]+)\)?.*', line) if m: defines[m.group('name')] = m.group('value') - m = re.match('^ *#include *["<](?P<name>[\w_.-/]+)[">].*', line) + m = re.match('^ *# *include *["<](?P<name>[\w_.-/]+)[">].*', line) if m: # Find this file found = False for w in [w for w in os.walk(include_root)]: for f in w[2]: curr = os.path.join(w[0], f) - if curr.endswith(m.group('name')): + if curr.endswith(m.group('name')) and curr not in seen_headers: headers.append(curr) found = True break diff --git a/system/include/libc/sys/unistd.h b/system/include/libc/sys/unistd.h index 8a1aa686..952568a9 100644 --- a/system/include/libc/sys/unistd.h +++ b/system/include/libc/sys/unistd.h @@ -490,11 +490,11 @@ int _EXFUN(unlinkat, (int, const char *, int)); #define _CS_POSIX_V7_THREADS_CFLAGS 18 #define _CS_POSIX_V7_THREADS_LDFLAGS 19 #define _CS_V7_ENV 20 -#define _CS_V6_ENV _CS_V6_ENV -/* XXX Emscripten: two additional ones */ -#define _CS_GNU_LIBC_VERSION 42 -#define _CS_GNU_LIBPTHREAD_VERSION 42 +/* XXX Emscripten: remove self-ref, and add two additional ones */ +/* #define _CS_V6_ENV _CS_V6_ENV */ +#define _CS_GNU_LIBC_VERSION 42 +#define _CS_GNU_LIBPTHREAD_VERSION 43 #endif diff --git a/tests/runner.py b/tests/runner.py index 610f1e14..2c0b3e72 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -189,6 +189,7 @@ class RunnerCore(unittest.TestCase): except OSError: os.chdir(self.get_dir()) # ensure the current working directory is valid compiler_output = timeout_run(Popen([EMSCRIPTEN, filename + ('.o.ll' if append_ext else ''), '-o', filename + '.o.js'] + settings + extra_args, stdout=PIPE, stderr=STDOUT), TIMEOUT, 'Compiling') + #print compiler_output # Detect compilation crashes and errors if compiler_output is not None and 'Traceback' in compiler_output and 'in test_' in compiler_output: print compiler_output; assert 0 |