diff mbox series

[bug#49244] gnu: grub-efi: Only enable the stack protector on x86_64-linux.

Message ID 20210627184708.17496-1-mail@cbaines.net
State Accepted
Headers show
Series [bug#49244] gnu: grub-efi: Only enable the stack protector on x86_64-linux. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Baines June 27, 2021, 6:47 p.m. UTC
Follow up to 018f95094153660e3041ec160718f0bda286a3dc, as gcc on aarch64-linux
doesn't seem to support -mstack-protector-guard=global.

* gnu/packages/bootloaders.scm (grub-efi)[arguments]: Only add
"--enable-stack-protector" to #:configure-flags when system is x86_64-linux.
---
 gnu/packages/bootloaders.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Mathieu Othacehe June 29, 2021, 3:36 p.m. UTC | #1
Hey Chris,

> +                    ,@(if (string=? (%current-system)
> +                                    "x86_64-linux")
> +                          '("--enable-stack-protector") ; EFI-only for now
> +                          '())

Maybe we should also avoid this option when cross-compiling? Otherwise
it looks OK.

Thanks,

Mathieu
M June 30, 2021, 3:14 p.m. UTC | #2
Mathieu Othacehe schreef op di 29-06-2021 om 17:36 [+0200]:
> Hey Chris,
> 
> > +                    ,@(if (string=? (%current-system)
> > +                                    "x86_64-linux")
> > +                          '("--enable-stack-protector") ; EFI-only for now
> > +                          '())
> 
> Maybe we should also avoid this option when cross-compiling? Otherwise
> it looks OK.

Or rather,
(string-prefix? (or (%current-target-system) (%current-system)) "x86_64")
(or was it the other way around)?

Greetings,
Maxime.
Christopher Baines July 1, 2021, 11:30 p.m. UTC | #3
Mathieu Othacehe <othacehe@gnu.org> writes:

> Hey Chris,
>
>> +                    ,@(if (string=? (%current-system)
>> +                                    "x86_64-linux")
>> +                          '("--enable-stack-protector") ; EFI-only for now
>> +                          '())
>
> Maybe we should also avoid this option when cross-compiling? Otherwise
> it looks OK.

Yeah, I was trying to test the cross-compiling case, but I think
something else fails regardless. Anyway, I've pushed something similar
to what Maxime suggested as fd549750d9ab23a0505aeb4c03e1299e860a4f16.

Thanks,

CHris
diff mbox series

Patch

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index e83f21ea63..1ff0348ac7 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -303,7 +303,10 @@  menu to select one of the installed operating systems.")
            ((#:tests? _ #f) #f)
            ((#:configure-flags flags ''())
             `(cons* "--with-platform=efi"
-                    "--enable-stack-protector" ; EFI-only for now
+                    ,@(if (string=? (%current-system)
+                                    "x86_64-linux")
+                          '("--enable-stack-protector") ; EFI-only for now
+                          '())
                     ,flags))
            ((#:phases phases)
             `(modify-phases ,phases