Force link options?

We need the ability to forcefully include several libraries into our source
code for which there is actually no dependency. We used to do this under
Watcom via the libf option. Is there a way to do this with gcc?

Richard Doucet wrote:

We need the ability to forcefully include several libraries into our source
code for which there is actually no dependency. We used to do this under
Watcom via the libf option. Is there a way to do this with gcc?

-Wl,–whole-archive libmylib.a -Wl,–no-whole-archive should do it.