Re: [PATCH v2] grub-core: Build fixes for i386

2021-05-18 Thread Matt Turner
On Tue, May 18, 2021 at 3:48 AM Jan (janneke) Nieuwenhuizen
 wrote:
>
> This fixes cross-compiling to x86 (e.g., the Hurd) from x86-linux.
>
> To reproduce, update the Grub source description in your local Guix
> archive and run
>
>./pre-inst-env guix build --system=i686-linux --target=i586-pc-gnu grub
>
> or install an x86 cross-build environment on x86-linux (32bit!) and
> configure to cross build and make, e.g., do something like
>
> ./configure \
>CC_FOR_BUILD=gcc \
>--build=i686-unknown-linux-gnu
>--host=i586-pc-gnu
> make
>
> * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386.
> ---
>  grub-core/lib/i386/relocator64.S | 27 +--
>  1 file changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/grub-core/lib/i386/relocator64.S 
> b/grub-core/lib/i386/relocator64.S
> index 148f38adb..b4675dd16 100644
> --- a/grub-core/lib/i386/relocator64.S
> +++ b/grub-core/lib/i386/relocator64.S
> @@ -63,8 +63,10 @@ VARIABLE(grub_relocator64_cr3)
> movq%rax, %cr3
>  #endif
>
>
> +#ifdef __x86_64__
> .code64
> +#endif
>
> /* mov imm64, %rax */
> .byte   0x48
> @@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3)
>  VARIABLE(grub_relocator64_rsp)
> .quad   0
>
> +#ifdef __x86_64__
> movq%rax, %rsp
> +#else
> +   /* movq %rax, %rsp */
> +   .byte   0x48
> +   .byte   0x89
> +   .byte   0xc4
> +#endif
>
>  #ifdef GRUB_MACHINE_EFI
> jmp LOCAL(skip_efi_stack_align)
> @@ -85,7 +94,14 @@ VARIABLE(grub_relocator64_rsp)
>  */
>  VARIABLE(grub_relocator64_efi_start)
> /* Align the stack as UEFI spec requires. */
> +#ifdef __x86_64__
> andq$~15, %rsp
> +#else
> +   .byte 0x48
> +.byte 0x83
> +.byte 0xe4
> +.byte 0xf0

Indentation on these lines is inconsistent.

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v3 3/5] argon2: Import Argon2 from cryptsetup

2021-01-19 Thread Matt Turner
On Tue, Jan 19, 2021 at 8:12 AM Petr Vorel  wrote:
> Therefore postponing Argon2 to another release means users will have it in 2+
> years after 2.06 release (unless distros backport it).

Maybe we can have more frequent releases? Every two years is a pretty
artificial limitation.

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: GRUB 2.06 release

2020-02-28 Thread Matt Turner
On Fri, Feb 28, 2020 at 4:46 AM Daniel Kiper  wrote:
>
> On Tue, Feb 25, 2020 at 02:15:16PM +0100, John Paul Adrian Glaubitz wrote:
> > Hi!
> >
> > On 2/20/20 9:46 AM, John Paul Adrian Glaubitz wrote:
> > > On 2/19/20 4:01 PM, Daniel Kiper wrote:
> > >> As I told during my FOSDEM 2020 presentation we are preparing for
> > >> GRUB 2.06 release. Tentative schedule is below:
> > >>   - code freeze: 15th of March, 23:59:59 UTC; everything posted after
> > >> that date will not be considered as a release material,
> > >>   - release: taking into account last experience I think that it will
> > >> happen no later than June; hopefully earlier; exact date depends
> > >> on number of bugs found, etc.
> > >>
> > >> So, please plan accordingly...
> > >
> > > Let me know when you want me to start the build tests on all 
> > > architectures.
> >
> > FWIW, it would be great if both these fixes could be included in the 2.06 
> > release:
> >
> >   * build: Disable PIE in TARGET_CCASFLAGS if needed
> > * build: Move TARGET_* assignments earlier
>
> All are in right now...
>
> Matt, Mike, I added SOB on behalf of you. I hope this is not a problem for 
> you.

Thank you, Daniel. That's perfectly okay with me.

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 2/2] build: Disable PIE in TARGET_CCASFLAGS if needed

2020-02-19 Thread Matt Turner
From: Mike Gilbert 

PIE should be disabled in assembly sources as well, or else grub will
fail to boot.

Bug: https://bugs.gentoo.org/667852
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index b5e31c787..e2c783652 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1263,6 +1263,7 @@ grub_CHECK_LINK_PIE
 # `-fPIE' or '-fpie' and '-pie' in the default specs.
 if [ x"$pie_possible" = xyes ]; then
   TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -fno-PIE -fno-pie"
 fi
 
 if [ x"$link_nopie_needed" = xyes ] || [ x"$pie_possible" = xyes ]; then
-- 
2.24.1


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 1/2] build: Move TARGET_* assignments earlier

2020-02-19 Thread Matt Turner
From: Mike Gilbert 

On a 32-bit SPARC userland, configure fails to compile assembly and the
build fails:

checking for options to compile assembly... configure: error: could not 
compile assembly

config.log shows:

asm-tests/sparc64.S: Assembler messages:
asm-tests/sparc64.S:5: Error: Architecture mismatch on "lduw [%o4+4],%o4".
asm-tests/sparc64.S:5: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; 
requested architecture is sparclite.)
asm-tests/sparc64.S:7: Error: Architecture mismatch on "stw %o5,[%o3]".
asm-tests/sparc64.S:7: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; 
requested architecture is sparclite.)
asm-tests/sparc64.S:8: Error: Architecture mismatch on "bne,pt %icc,1b ,pt 
%icc,1b".
asm-tests/sparc64.S:8: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; 
requested architecture is sparclite.)

Simply moving these blocks earlier in configure.ac is sufficient to
ensure that the tests are executed with the appropriate flags
(specifically -m64 in this case).

Bug: https://bugs.gentoo.org/667850
---
 configure.ac | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index e07ba4b56..b5e31c787 100644
--- a/configure.ac
+++ b/configure.ac
@@ -562,6 +562,24 @@ CPPFLAGS="$TARGET_CPPFLAGS"
 LDFLAGS="$TARGET_LDFLAGS"
 LIBS=""
 
+if test "x$target_m32" = x1; then
+  # Force 32-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
+  TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
+  TARGET_MODULE_FORMAT="elf32"
+fi
+
+if test "x$target_m64" = x1; then
+  # Force 64-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
+  TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+  TARGET_MODULE_FORMAT="elf64"
+fi
+
 # debug flags.
 TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls 
-Wmissing-prototypes -Wmissing-declarations"
 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
@@ -750,24 +768,6 @@ if test "x$target_cpu" = xi386 && test "x$platform" != 
xemu; then
   TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
 fi
 
-if test "x$target_m32" = x1; then
-  # Force 32-bit mode.
-  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
-  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
-  TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
-  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
-  TARGET_MODULE_FORMAT="elf32"
-fi
-
-if test "x$target_m64" = x1; then
-  # Force 64-bit mode.
-  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
-  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
-  TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
-  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
-  TARGET_MODULE_FORMAT="elf64"
-fi
-
 if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && 
test "x$platform" != xemu && test "x$platform" != xefi; then
TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3"
 fi
-- 
2.24.1


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


GRUB 2 for DEC Alpha?

2009-01-27 Thread Matt Turner
Hi,

I learned today that GRUB 2 aims to be cross platform and already
supports in some form PPC.

Is there any interest in supporting the DEC Alpha (SRM) platform?

According to the Current Status [*] page, BSD partition maps are
already supported, so maybe the only thing to be done is the
SRM-specific code?

Alpha users currently use the long unmaintained aboot bootloader.
Possibly code could be reused from aboot.

Thanks,

Matt Turner

[*] http://grub.enbug.org/CurrentStatus


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel