Dne 07. 06. 22 v 11:10 Florian Weimer napsal(a):
* Vít Ondruch:Dne 03. 06. 22 v 16:32 Tom Stellard napsal(a):On 6/3/22 02:24, Vít Ondruch wrote:Hi Tom, Since you are looking into this and I like this proposal, have you considered to look alto into `%extension_*flags`: https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros#_120-123I have not considered this. Do you think there is some way this proposal could be extended to help solve this problem as well?I think the current struggle is that we have `%extension_cflags` and `%build_cflags`, while we would actually need the set of ``%build_cflags - %extension_cflags`. The problem is that the `%build_cflags` order is not necessarily followed in the resulting code, so if we need to modify the resulting code, we have no way to achieve this.I don't see how the list difference would solve your fundamental issue. Could you elaborate? Or maybe you already did, and you missed it, in which case I would appreciate a pointer.
https://src.fedoraproject.org/rpms/ruby/pull-request/110This PR ^^ has the lengthy discussion. But let me reiterate. So there is `%build_cflags` and the original assumption was that if you give these flags to the build system, they are recorded also in the output, so you could do something such as `s/%build_cflags/%extension_cflags/`. But that does not work, because the build system is free to change the `%build_cflags`. So in the output, there is something we can call e.g. `%output_build_cflags`. From these flags, we would like to remove the flags which are not usable for the extensions, i.e. the set of `%build_cflags - %extension_cflags`.
IOW, these are the `%build_cflags`: ~~~ $ rpm --eval '%build_cflags'-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
~~~ while these are the output flags: ~~~-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC
~~~If we had the `%build_cflags - %extension_cflags` set, we could at least iterate over the set and remove the flags from the output.
Vít
Thanks, Florian
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure