Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fbc: Add -nolib command line option #400

Merged
merged 1 commit into from Oct 2, 2022
Merged

Conversation

dkl
Copy link
Member

@dkl dkl commented Oct 2, 2022

The new option allows excluding specific libraries when linking, no matter where it came from (default lib, #inclib, -l, objinfo...).

This allows selectively blacklisting libraries and can be used to...

  • remove unused dependencies when linking against shared libraries (when linking against static libraries via -l, the linker automatically skips unused libs, but not for shared libraries)

  • override unwanted #inclibs (although arguably this is not the ideal solution for that, but just a last resort)

  • disable only some default libs, instead of all as done by -nodeflibs. For example, this could be used to specifically omit libtinfo. Using -nodeflibs would omit a lot more (including fbrt0.o) which would have to be re-added manually again.

The new option allows excluding specific libraries when linking,
no matter where it came from (default lib, #inclib, -l, objinfo...).

This allows selectively blacklisting libraries and can be used to...

- remove unused dependencies when linking against shared libraries
  (when linking against static libraries via -l, the linker
   automatically skips unused libs, but not for shared libraries)

- override unwanted #inclibs (although arguably this is not the ideal
  solution for that, but just a last resort)

- disable only some default libs, instead of all as done by -nodeflibs.
  For example, this could be used to specifically omit libtinfo.
  Using -nodeflibs would omit a lot more (including fbrt0.o) which would
  have to be re-added manually again.
@jayrm jayrm merged commit 6cf5252 into freebasic:master Oct 2, 2022
@dkl dkl deleted the nolib-option branch October 3, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants