Ticket #2995 (closed enhancement: fixed)
Do not link gmodule in if it's not required
Reported by: | er13 | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.10 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | gotar@… | |
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
Two mc-components require gmodule: aspell and textmode_x11_support. If however both are disabled there is no need to link it in.
Might be not that important for desktop-systems... Saves however space and memory on embedded systems.
Attached patch contains a possible solution.
Attachments
Change History
Changed 12 years ago by er13
comment:1 Changed 12 years ago by andrew_b
- Status changed from new to closed
- Resolution set to wontfix
Use --as-needed (or something like that if your linker is not GNU ld) in your build system if your don't want link unused libraries.
I hope embedded system developers who use GNU ld as part of their toolchain, use it with --as-needed by default. If not, they should, definitely.
comment:2 Changed 12 years ago by er13
Unfortunately using --as-needed globally is not an option because of the need to support older uClibc versions containing "pthread + .so's loaded per dlopen"-bug (one has to link libraries into the main binary in order to get dlopen loaded modules work).
Using it on a per package basis still requires to patch something in the package build system as CFLAGS and LDFLAGS are cached and reused for all packages.
I still consider the patch attached to be the proper way to fix it. It's better fixed in mc as in every embedded build system out there.
Btw. --as-needed is neither in buildroot nor in openwrt used by default.
comment:3 Changed 11 years ago by gotar
- Cc gotar@… added
I'm sharing er13 point of view, that such dependencies should be removed as soon as possible. Decent program should not depend on environment features, especially when solution is so simple and doesn't require maintaince.
comment:4 Changed 11 years ago by andrew_b
- Status changed from closed to reopened
- Resolution wontfix deleted
comment:5 Changed 11 years ago by andrew_b
- Status changed from reopened to accepted
- Owner set to andrew_b
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.10
Branch: 2995_link_gmodule_if_required
changeset:b40a7bcbc7037b596fcfe4a9519e38dce5b0e5dc
comment:7 Changed 11 years ago by andrew_b
- Votes for changeset changed from slavazanko to slavazanko andrew_b
comment:8 Changed 11 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from slavazanko andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from on review to merged
Merged to master: [5260d6612c6e8f0c46dd89e5abc355d6b1d0a4ee].