all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#54407: Issues building grub for powerpc64le, could not force big-endian
@ 2022-03-15 21:11 Christopher Baines
  2022-03-30 17:41 ` Danny Milosavljevic
  2022-03-30 17:46 ` Maxime Devos
  0 siblings, 2 replies; 7+ messages in thread
From: Christopher Baines @ 2022-03-15 21:11 UTC (permalink / raw)
  To: 54407

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

grub can't be built for powerpc64le, I believe the same failure occurs
with native builds or cross compilation from x86_64. I think this might
have always been the case.

This is the error from the build log:

  checking for options to get big-endian compilation... no
  configure: error: could not force big-endian

Looking in the config.log file, it tries a bunch of options with
different errors, but this one stands out:

  cc1: error: '-m32' not supported in this configuration

I know very little about gcc, but I think this might relate to the
multilib thing, which I'm guessing is disabled for the gcc in use here.

Any ideas about this issue?

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-03-15 21:11 bug#54407: Issues building grub for powerpc64le, could not force big-endian Christopher Baines
@ 2022-03-30 17:41 ` Danny Milosavljevic
  2022-03-30 17:46 ` Maxime Devos
  1 sibling, 0 replies; 7+ messages in thread
From: Danny Milosavljevic @ 2022-03-30 17:41 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 54407

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hi,

On Tue, 15 Mar 2022 21:11:37 +0000
Christopher Baines <mail@cbaines.net> wrote:

> grub can't be built for powerpc64le, I believe the same failure occurs
> with native builds or cross compilation from x86_64. I think this might
> have always been the case.
> 
> This is the error from the build log:
> 
>   checking for options to get big-endian compilation... no
>   configure: error: could not force big-endian
> 
> Looking in the config.log file, it tries a bunch of options with
> different errors, but this one stands out:
> 
>   cc1: error: '-m32' not supported in this configuration
> 
> I know very little about gcc, but I think this might relate to the
> multilib thing, which I'm guessing is disabled for the gcc in use here.

-m32 is to compile 32 bit object files with a compiler that usually compiles 64 bit objects.
If you want to use any libraries, then those have to be available as a 32 bit version somewhere.

The Guix gcc package recipe disables this (and I think that was the right call to make).

There are not a lot of use cases for using "-m32" anyway since on x86_64 the generated instructions are already just as compact as the x86 (32 bit) ones if the immediate operand is not too big.

Not sure what the configure script is doing there.

But there are a few programs that need 32 bit compilers--BIOS-based bootloaders are one of them (since they start up in ancient 8088 real mode).

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-03-15 21:11 bug#54407: Issues building grub for powerpc64le, could not force big-endian Christopher Baines
  2022-03-30 17:41 ` Danny Milosavljevic
@ 2022-03-30 17:46 ` Maxime Devos
  2022-04-04 19:37   ` Christopher Baines
  1 sibling, 1 reply; 7+ messages in thread
From: Maxime Devos @ 2022-03-30 17:46 UTC (permalink / raw)
  To: Christopher Baines, 54407

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

Christopher Baines schreef op di 15-03-2022 om 21:11 [+0000]:
> grub can't be built for powerpc64le, I believe the same failure
> occurs
> with native builds or cross compilation from x86_64. I think this
> might
> have always been the case.
> 
> This is the error from the build log:
> 
>   checking for options to get big-endian compilation... no
>   configure: error: could not force big-endian
> 
> Looking in the config.log file, it tries a bunch of options with
> different errors, but this one stands out:
> 
>   cc1: error: '-m32' not supported in this configuration
> 
> I know very little about gcc, but I think this might relate to the
> multilib thing, which I'm guessing is disabled for the gcc in use
> here.
> 
> Any ideas about this issue?

Maybe you could add a gcc compiling for 32-bit ppc (maybe without a
glibc since this is grub) and patch the configuration script to use the
32-bit ppc gcc instead of using the 64-bit ppc+-m32?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-03-30 17:46 ` Maxime Devos
@ 2022-04-04 19:37   ` Christopher Baines
  2022-08-18  8:11     ` Maxime Devos
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2022-04-04 19:37 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54407

[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]


Maxime Devos <maximedevos@telenet.be> writes:

> Christopher Baines schreef op di 15-03-2022 om 21:11 [+0000]:
>> grub can't be built for powerpc64le, I believe the same failure
>> occurs
>> with native builds or cross compilation from x86_64. I think this
>> might
>> have always been the case.
>>
>> This is the error from the build log:
>>
>>   checking for options to get big-endian compilation... no
>>   configure: error: could not force big-endian
>>
>> Looking in the config.log file, it tries a bunch of options with
>> different errors, but this one stands out:
>>
>>   cc1: error: '-m32' not supported in this configuration
>>
>> I know very little about gcc, but I think this might relate to the
>> multilib thing, which I'm guessing is disabled for the gcc in use
>> here.
>>
>> Any ideas about this issue?
>
> Maybe you could add a gcc compiling for 32-bit ppc (maybe without a
> glibc since this is grub) and patch the configuration script to use the
> 32-bit ppc gcc instead of using the 64-bit ppc+-m32?

I've had a go at this, using something like what I've included below,
but I haven't stumbled upon the right options yet, or a way to work out
why gcc still thinks "-m32 not supported".

(define multilib-gcc
  (package
   (inherit gcc)
   (name "foo-gcc")
   (arguments
    (substitute-keyword-arguments (package-arguments gcc)
         ((#:phases phases)
          `(modify-phases ,phases
             (add-after 'unpack 'fix-genmultilib
               (lambda _
                 ;; patch-shebang doesn't work here because there are actually
                 ;; several scripts inside this script, each with a #!/bin/sh
                 ;; that needs patching.
                 (substitute* "gcc/genmultilib"
                   (("#!/bin/sh") (string-append "#!" (which "sh"))))))))
         ((#:configure-flags flags)
          `(append (list
                    "--with-endian=little,big"
                    "--enable-multilib"
                    "--with-multilib-list=mx32,m64,m32"
                    )
                   (delete "--disable-multilib" ,flags)))))))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-04-04 19:37   ` Christopher Baines
@ 2022-08-18  8:11     ` Maxime Devos
  2022-08-18  8:14       ` Maxime Devos
  0 siblings, 1 reply; 7+ messages in thread
From: Maxime Devos @ 2022-08-18  8:11 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 54407


[-- Attachment #1.1.1.1: Type: text/plain, Size: 1316 bytes --]


On 04-04-2022 21:37, Christopher Baines wrote:
>> Maybe you could add a gcc compiling for 32-bit ppc (maybe without a
>> glibc since this is grub) and patch the configuration script to use the
>> 32-bit ppc gcc instead of using the 64-bit ppc+-m32?
> I've had a go at this, using something like what I've included below,
> but I haven't stumbled upon the right options yet, or a way to work out
> why gcc still thinks "-m32 not supported". [...]

I was thinking of skipping the multilib and maybe skipping support for 
multiple endians, something like:

> (use-modules (guix utils) (guix packages) (guix gexp))
> (define (ppc-32bit-gcc)
>   (if (%current-target-system)
>       (error "not supported -- TODO make a cross-compiler to 32-bit 
> ppc here with cross-gcc")
>       (package
>         (inherit (@ (gnu packages gcc) gcc))
>         (arguments
>           (substitute-keyword-arguments
>             (package-arguments (@ (gnu packages gcc) gcc))
>             ((#:system _) "ppc-linux")
>             ((#:configure-flags flags)
>              (pk 'f #~(append (list "--with-endian=big") #$flags))))))))
> (ppc-32bit-gcc)
(currently compiling, let's see if if it works ...)

Greetings,
Maxime.


[-- Attachment #1.1.1.2: Type: text/html, Size: 2026 bytes --]

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-08-18  8:11     ` Maxime Devos
@ 2022-08-18  8:14       ` Maxime Devos
  2022-08-18  8:33         ` Maxime Devos
  0 siblings, 1 reply; 7+ messages in thread
From: Maxime Devos @ 2022-08-18  8:14 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 54407


[-- Attachment #1.1.1.1: Type: text/plain, Size: 2075 bytes --]


On 18-08-2022 10:11, Maxime Devos wrote:
>
>
> On 04-04-2022 21:37, Christopher Baines wrote:
>>> Maybe you could add a gcc compiling for 32-bit ppc (maybe without a
>>> glibc since this is grub) and patch the configuration script to use the
>>> 32-bit ppc gcc instead of using the 64-bit ppc+-m32?
>> I've had a go at this, using something like what I've included below,
>> but I haven't stumbled upon the right options yet, or a way to work out
>> why gcc still thinks "-m32 not supported". [...]
>
> I was thinking of skipping the multilib and maybe skipping support for 
> multiple endians, something like:
>
>> (use-modules (guix utils) (guix packages) (guix gexp))
>> (define (ppc-32bit-gcc)
>>   (if (%current-target-system)
>>       (error "not supported -- TODO make a cross-compiler to 32-bit 
>> ppc here with cross-gcc")
>>       (package
>>         (inherit (@ (gnu packages gcc) gcc))
>>         (arguments
>>           (substitute-keyword-arguments
>>             (package-arguments (@ (gnu packages gcc) gcc))
>>             ((#:system _) "ppc-linux")
>>             ((#:configure-flags flags)
>>              (pk 'f #~(append (list "--with-endian=big") #$flags))))))))
>> (ppc-32bit-gcc)
> (currently compiling, let's see if if it works ...)

The #:system doesn't work, trying

> (use-modules (guix utils) (guix packages) (guix gexp))
> (define (ppc-32bit-gcc)
>   (if (%current-target-system)
>       (error "not supported -- TODO make a cross-compiler to 32-bit 
> ppc here with cross-gcc")
>       (package
>         (inherit (@ (gnu packages gcc) gcc))
>         (arguments
>           (substitute-keyword-arguments
>             (cons* #:system "powerpc-linux" (package-arguments (@ (gnu 
> packages gcc) gcc)))
>             ((#:configure-flags flags)
>              (pk 'f #~(append (list "--with-endian=big") #$flags))))))))
> (ppc-32bit-gcc)
instead.


[-- Attachment #1.1.1.2: Type: text/html, Size: 3239 bytes --]

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#54407: Issues building grub for powerpc64le, could not force big-endian
  2022-08-18  8:14       ` Maxime Devos
@ 2022-08-18  8:33         ` Maxime Devos
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Devos @ 2022-08-18  8:33 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 54407


[-- Attachment #1.1.1: Type: text/plain, Size: 359 bytes --]

Doesn't work for me:

> while setting up the build environment: a `powerpc-linux' is required 
> to build 
> `/gnu/store/gmq50nq4xf4wa0msqms140s3jkk5v47q-guile-bootstrap-2.0.drv', 
> but I am a `x86_64-linux'

even though QEMU has been set up, though that's more a local 
configuration problem than a problem in gcc package.

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-18  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15 21:11 bug#54407: Issues building grub for powerpc64le, could not force big-endian Christopher Baines
2022-03-30 17:41 ` Danny Milosavljevic
2022-03-30 17:46 ` Maxime Devos
2022-04-04 19:37   ` Christopher Baines
2022-08-18  8:11     ` Maxime Devos
2022-08-18  8:14       ` Maxime Devos
2022-08-18  8:33         ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.