def fix_compile(remove_flags):
import distutils.ccompiler<EOL>def _fix_compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=<NUM_LIT:0>,<EOL>extra_preargs=None, extra_postargs=None, depends=None):<EOL><INDENT>for flag in remove_flags:<EOL><INDENT>if flag in self.compiler_so:<EOL><INDENT>self.compiler_so.remove(flag)<EOL><DEDENT><DEDENT>macros, objects, extra_postargs, pp_opts, build = self._setup_compile(output_dir, macros,<EOL>include_dirs, sources, depends, extra_postargs)<EOL>cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)<EOL>for obj in objects:<EOL><INDENT>try:<EOL><INDENT>src, ext = build[obj]<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT>self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)<EOL><DEDENT>return objects<EOL><DEDENT>distutils.ccompiler.CCompiler.compile = _fix_compile<EOL>
Monkey-patch compiler to allow for removal of default compiler flags.