Files
rk35xx-android14/external/clang/compiler_wrapper
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

32 lines
587 B
Python
Executable File

#!/usr/bin/python
import os
import sys
flags_to_append = []
flags_to_insert = []
myargs = sys.argv[1:]
myargs = flags_to_insert + myargs + flags_to_append
real_compiler = sys.argv[0] + '.real'
argv0 = real_compiler
def get_gomacc_command():
"""Return the gomacc command if it is found in $GOMACC_PATH."""
gomacc = os.environ.get('GOMACC_PATH')
if gomacc and os.path.isfile(gomacc):
return gomacc
return None
execargs = []
gomacc = get_gomacc_command()
if gomacc:
argv0 = gomacc
execargs += [gomacc]
execargs += [real_compiler] + myargs
os.execv(argv0, execargs)