-
Notifications
You must be signed in to change notification settings - Fork 9
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
LDFLAGS appended to CFLAGS causing build failures #11
Comments
Yes, this is intentional (e.g. for -flto or for "small" packages which need no separate compile and linking phase). You can prevent it by setting NOLDADD=1, either globally or on a per-package base in package.cflags |
Does this not also affect src_install phase too? |
I am not sure whether I understand the question. |
umm ldflags should never be added to CFLAGS, not even for lto builds. You add CFLAGS to LDFLAGS to achieve the results that you are thinking of. |
For correctly working build systems you are right. However, there were several examples of ebuilds/build systems which didn't honour LDFLAGS at all. The latter may even be a security issue if you use flags like -Wl,-z,now -Wl,-z,relro |
Surely in this case, it's better to highlight and fix bad ebuilds than cause random breakage elsewhere?! It should be possible to create a tracker bug for the issue, and highlight maintainers in individual bugs, and/or a combined bug for maintainer-needed. |
The breakage is due to use using the features incorrectly has nothing to do with an actual problem in the build system or the toolchain. You should fix your script rather then expect the toolchain or packages to adjust to what you want to believe is correct. |
If you have found packages in the tree with such behavior you should have opened a bug report, these packages should be fixed to respect the build system the user has defined when plausible. |
In an ideal world, all packages behave the same concerning *FLAGS or are fixed, soon, and then later won't ever break again. In the real world, however, you have the choice between running a more secure system or having a dream of an ideal world. |
[Imported from 14.2.0/gentoo/28_all_drop_CFLAGS_sed.patch] Bug: https://bugs.gentoo.org/849722 Bug: InBetweenNames/gentooLTO#846 Bug: vaeth/portage-bashrc-mv#11
[Imported from 14.2.0/gentoo/28_all_drop_CFLAGS_sed.patch] Bug: https://bugs.gentoo.org/849722 Bug: InBetweenNames/gentooLTO#846 Bug: vaeth/portage-bashrc-mv#11
I'm experiencing some strange build failures with musl libc, which @anarchpenguin and I have narrowed down to LDFLAGS becoming appended to CFLAGS in builds. Should this really happen, and is there an option to prevent it, if so, for circumstances where it should not ..
The text was updated successfully, but these errors were encountered: