Skip to contentSkip to conversation

New: gcc --help -v doesn't work correctly with gcc>=10 and BR2_RELRO_PARTIAL or BR2_RELRO_FULL

Buildroot [email protected] 1 participant 4 messages Jan 7, 2023 – Jun 15, 2024

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=15231

Bug ID: 15231
Summary: gcc --help -v doesn't work correctly with gcc>=10 and
BR2_RELRO_PARTIAL or BR2_RELRO_FULL
Product: buildroot
Version: 2020.11.2
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---

Created attachment 9451
--> https://bugs.busybox.net/attachment.cgi?id=9451&action=edit
quick fix

gcc --help -v 2>&1 | grep ffunction-sections

This should display the option with description.
But with buildroot gcc>=10 with RELRO protection configured to Partial or Full, this doesn't work (doesn't display anything).
So affected buildroots are with versions >=2020.11.2
You can check this with bootlin compilers with buildroot>=2021.11

The cause of this is:

1) from gcc 10, the following doesn't work:
gcc -Wl,--some-flag --help -v 2>&1 | grep ffunction-section

I created a bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108328

2) toolchain-wrapper with BR2_RELRO_PARTIAL or BR2_RELRO_FULL adds -Wl,-z,relro linker flags which trigger this

now, BR2_RELRO_PARTIAL or BR2_RELRO_FULL are the default since 2021.05.

Moreover, this causes the python and python3 package to compile without the -fwrapv option, because python detects it using the: gcc --help -v 2>&1 | grep fwrapv

This is just one example that I stumbled upon, I think this can cause problems in general, and in other packages that do these kinds of checks.

I attached a quick fix patch (should I send it to the mailing list too?), but feel free to comment on the gcc bug report I created.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

[Buildroot] [Bug 15231] gcc --help -v doesn't work correctly with gcc>=10 and BR2_RELRO_PARTIAL or BR2_RELRO_FULL

https://bugs.busybox.net/show_bug.cgi?id=15231

--- Comment #1 from Sagi Mor <[email protected]> ---
in newer versions of buildroot -Wl,-z,max-page-size is added, so this bug happens even if RELRO protection is configured to None

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

[Buildroot] [Bug 15231] gcc --help -v doesn't work correctly with gcc>=10 and BR2_RELRO_PARTIAL or BR2_RELRO_FULL

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=15231

Sagi Mor <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

           Assignee|[email protected] |[email protected]
                   |.org                        |
Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

[Buildroot] [Bug 15231] gcc --help -v doesn't work correctly with gcc>=10 and BR2_RELRO_PARTIAL or BR2_RELRO_FULL

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=15231

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
         Resolution|---                         |MOVED
             Status|NEW                         |RESOLVED

--- Comment #2 from Yann E. MORIN <[email protected]> --- Thank you for your report.

The issue tracker for the Buildroot project has been moved to the Gitlab.com issue tracker:
https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old tracker. If you believe your issue is still relevant, please open one in the new issue tracker.

Thank you!

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot