Skip to content

Instantly share code, notes, and snippets.

@ihnorton
Created December 20, 2019 16:23
Show Gist options
  • Save ihnorton/748ce65bff86db49a47bd5d9729652a3 to your computer and use it in GitHub Desktop.
Save ihnorton/748ce65bff86db49a47bd5d9729652a3 to your computer and use it in GitHub Desktop.
adding prepended linker arguments with distutils
# in distutils/command/build_ext.py
# obviously a one-off hack...
549 self.compiler.link_shared_object(
550 objects, ext_path,
551 libraries=self.get_libraries(ext),
552 library_dirs=ext.library_dirs,
553 runtime_library_dirs=ext.runtime_library_dirs,
554 extra_preargs=['-Wl,-Bsymbolic-functions', '-Wl,-Bsymbolic'],
555 extra_postargs=extra_args,
556 export_symbols=self.get_export_symbols(ext),
557 debug=self.debug,
558 build_temp=self.build_temp,
559 target_lang=language)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment