summaryrefslogtreecommitdiffstats
path: root/libc/kernel/tools
diff options
context:
space:
mode:
Diffstat (limited to 'libc/kernel/tools')
-rwxr-xr-xlibc/kernel/tools/clean_header.py5
-rw-r--r--libc/kernel/tools/defaults.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index 22e62aa..01569fc 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -62,8 +62,11 @@ def cleanupFile( path, original_path):
sys.stderr.write( "error: can't parse '%s'" % path )
sys.exit(1)
+ macros = kernel_known_macros.copy()
+ if arch and arch in kernel_default_arch_macros:
+ macros.update(kernel_default_arch_macros[arch])
- blocks.optimizeMacros( kernel_known_macros )
+ blocks.optimizeMacros( macros )
blocks.optimizeIf01()
blocks.removeVarsAndFuncs( statics )
blocks.replaceTokens( kernel_token_replacements )
diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py
index aa68e7c..7fbed46 100644
--- a/libc/kernel/tools/defaults.py
+++ b/libc/kernel/tools/defaults.py
@@ -44,7 +44,7 @@ kernel_remove_config_macros = True
# toolchain preprocessor
kernel_default_arch_macros = {
"arm": {},
- "x86": {"__i386__": "1"},
+ "x86": {"__i386__": "1", "CONFIG_X86_32": "1"},
}
# Replace tokens in the output according to this mapping