custom link argument order

Gabriel Ganne Gabriel.Ganne at
Tue Mar 7 09:47:22 EST 2017


I'm currently writing a python C module which has a chained dependency:

- mymodule requires libb

- libb requires liba

To that effect, within, I link against both liba and libb

  libraries=['a', 'b'],

Also, as I'm working on Ubuntu, I want to add -Wl,--no-as-needed to make sure that the symbols not immediately needed will still be stripped.


However, it seems that the extra_link_args are systematically appended at the end of the link line, but for this to work, the '-Wl,--no-as-needed' argument need to be *before* the link against my two libraries.

How can I choose the order of my link arguments that I pass to gcc using ?

Best regards,


Gabriel Ganne

More information about the Python-list mailing list