[PATCH 0/4] [core-updates] Fix cross-compiling bootstrap tarballs

  • Done
  • quality assurance status badge
Details
3 participants
  • Marius Bakke
  • Marius Bakke
  • zimoun
Owner
unassigned
Submitted by
Marius Bakke
Severity
normal
M
M
Marius Bakke wrote on 21 Jun 2019 14:24
(address . guix-patches@gnu.org)
20190621122411.17847-1-mbakke@fastmail.com
With these patches, we can again cross-compile the bootstrap tarballs on
core-updates.

As of commit bd0dc2df04a1550f41d3d5c7cc2c26ad12468b36, here are my
results for armhf and Hurd(!):

$ ./pre-inst-env guix build --target=arm-linux-gnueabihf bootstrap-tarballs
/gnu/store/q245c0s6cc55ziamfxpv43lwbnxaw0n6-bootstrap-tarballs-0
$ guix hash -rx $(!!)
01lksw8qw973bc2lllz97pxm67x84rz8crbdiqwnlbyjq0j3mvaq

$ ./pre-inst-env guix build --target=i586-pc-gnu bootstrap-tarballs
/gnu/store/4i3zxmzcrpg2h8inwgfd24sdsgan9jw7-bootstrap-tarballs-0
$ guix hash -rx $(!!)
17yjlqvwlv8v28qm5v888kshx30djylml9fgpwkcqvx3idzw7i1v

Now, I haven't actually tried bootstrapping a system from these yet.
Do we have automated tests for that?

Marius Bakke (4):
gnu: make-bootstrap: Remove obsolete header file.
gnu: make-bootstrap: Restore cross-compilation workarounds.
gnu: make-bootstrap: Adjust for GCC 7.
gnu: bootstrap-tarballs: Don't include the native mes when
cross-compiling.

gnu/packages/make-bootstrap.scm | 64 ++++++++++++++++++++++++---------
guix/build/make-bootstrap.scm | 1 -
2 files changed, 47 insertions(+), 18 deletions(-)

--
2.22.0
M
M
Marius Bakke wrote on 21 Jun 2019 14:26
[PATCH 1/4] gnu: make-bootstrap: Remove obsolete header file.
(address . 36322@debbugs.gnu.org)
20190621122628.18174-1-mbakke@fastmail.com
* guix/build/make-bootstrap.scm (copy-linux-headers): Do not install 'a.out.h'.
---
guix/build/make-bootstrap.scm | 1 -
1 file changed, 1 deletion(-)

Toggle diff (14 lines)
diff --git a/guix/build/make-bootstrap.scm b/guix/build/make-bootstrap.scm
index e5ef1d6d2b..0d29338ce3 100644
--- a/guix/build/make-bootstrap.scm
+++ b/guix/build/make-bootstrap.scm
@@ -47,7 +47,6 @@ bootstrap libc."
(install-file (pk 'src (string-append kernel-headers "/include/linux/" file))
(pk 'dest (string-append incdir "/linux"))))
'(
- "a.out.h" ; for 2.2.5
"atalk.h" ; for 2.2.5
"errno.h"
"falloc.h"
--
2.22.0
M
M
Marius Bakke wrote on 21 Jun 2019 14:26
[PATCH 2/4] gnu: make-bootstrap: Restore cross-compilation workarounds.
(address . 36322@debbugs.gnu.org)
20190621122628.18174-2-mbakke@fastmail.com
These workarounds were removed in cf8264364761857ca3550398369a0f20d7b0d512 and
218eb6e611c0a238802bf9cb5742d37cea0bb012, but were needed for %BOOTSTRAP-TARBALLS.

* gnu/packages/make-bootstrap.scm (%static-inputs)[coreutils, tar]: Add
<#:configure-flags>.
---
gnu/packages/make-bootstrap.scm | 37 ++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 12 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index ec477da7c8..561a286d26 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -150,7 +150,15 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
"--disable-silent-rules"
"--enable-no-install-program=stdbuf,libstdbuf.so"
"CFLAGS=-Os -g0" ; smaller, please
- "LDFLAGS=-static -pthread")
+ "LDFLAGS=-static -pthread"
+
+ ;; Work around a cross-compilation bug whereby libcoreutils.a
+ ;; would provide '__mktime_internal', which conflicts with the
+ ;; one in libc.a.
+ ,@(if (%current-target-system)
+ `("gl_cv_func_working_mktime=yes")
+ '()))
+
#:tests? #f ; signal-related Gnulib tests fail
,@(package-arguments coreutils)))
@@ -213,17 +221,22 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
'()))))
(tar (package (inherit tar)
(arguments
- (substitute-keyword-arguments (package-arguments tar)
- ((#:phases phases)
- `(modify-phases ,phases
- (replace 'set-shell-file-name
- (lambda _
- ;; Do not use "/bin/sh" to run programs; see
- ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
- (substitute* "src/system.c"
- (("/bin/sh") "sh")
- (("execv ") "execvp "))
- #t))))))))
+ `(;; Work around a cross-compilation bug whereby libgnu.a would provide
+ ;; '__mktime_internal', which conflicts with the one in libc.a.
+ ,@(if (%current-target-system)
+ `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
+ '())
+ ,@(substitute-keyword-arguments (package-arguments tar)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'set-shell-file-name
+ (lambda _
+ ;; Do not use "/bin/sh" to run programs; see
+ ;; <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
+ (substitute* "src/system.c"
+ (("/bin/sh") "sh")
+ (("execv ") "execvp "))
+ #t)))))))))
;; We don't want to retain a reference to /gnu/store in the bootstrap
;; versions of egrep/fgrep, so we remove the custom phase added since
;; grep@2.25. The effect is 'egrep' and 'fgrep' look for 'grep' in
--
2.22.0
M
M
Marius Bakke wrote on 21 Jun 2019 14:26
[PATCH 3/4] gnu: make-bootstrap: Adjust for GCC 7.
(address . 36322@debbugs.gnu.org)
20190621122628.18174-3-mbakke@fastmail.com
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc)[native-inputs]:
Add SEARCH-PATHS to CROSS-GCC, and NATIVE-SEARCH-PATHS to the native GCC.
---
gnu/packages/make-bootstrap.scm | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 561a286d26..df6b828a2d 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -106,16 +106,33 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(define (native-inputs)
(if (%current-target-system)
- (let ((target (%current-target-system)))
- `(("cross-gcc" ,(cross-gcc target
- #:xbinutils (cross-binutils target)
- #:libc (cross-bootstrap-libc)))
+ (let* ((target (%current-target-system))
+ (xgcc (cross-gcc
+ target
+ #:xbinutils (cross-binutils target)
+ #:libc (cross-bootstrap-libc))))
+ `(("cross-gcc" ,(package
+ (inherit xgcc)
+ (search-paths
+ ;; Ensure the cross libc headers appears on the
+ ;; C++ system header search path.
+ (cons (search-path-specification
+ (variable "CROSS_CPLUS_INCLUDE_PATH")
+ (files '("include")))
+ (package-search-paths gcc)))))
("cross-binutils" ,(cross-binutils target))
,@(%final-inputs)))
`(("libc" ,(glibc-for-bootstrap))
("libc:static" ,(glibc-for-bootstrap) "static")
("gcc" ,(package (inherit gcc)
(outputs '("out")) ;all in one so libgcc_s is easily found
+ (native-search-paths
+ ;; Set CPLUS_INCLUDE_PATH so GCC is able to find the libc
+ ;; C++ headers.
+ (cons (search-path-specification
+ (variable "CPLUS_INCLUDE_PATH")
+ (files '("include")))
+ (package-native-search-paths gcc)))
(inputs
`(;; Distinguish the name so we can refer to it below.
("bootstrap-libc" ,(glibc-for-bootstrap))
--
2.22.0
M
M
Marius Bakke wrote on 21 Jun 2019 14:26
[PATCH 4/4] gnu: bootstrap-tarballs: Don't include the native mes when cross-compiling.
(address . 36322@debbugs.gnu.org)
20190621122628.18174-4-mbakke@fastmail.com
* gnu/packages/make-bootstrap.scm (%bootstrap-tarballs)[inputs]: Check
%CURRENT-TARGET-SYSTEM when deciding whether to use the reduced binary seeds.
---
gnu/packages/make-bootstrap.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index df6b828a2d..2163b646f6 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -825,7 +825,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
%build-inputs)
#t)))
(inputs `(("guile-tarball" ,%guile-bootstrap-tarball)
- ,@(match (%current-system)
+ ,@(match (or (%current-target-system) (%current-system))
((or "i686-linux" "x86_64-linux")
`(("bootstrap-mescc-tools" ,%mescc-tools-bootstrap-tarball)
("bootstrap-mes" ,%mes-bootstrap-tarball)
--
2.22.0
Z
Z
zimoun wrote on 7 Apr 2022 15:18
Re: bug#36322: [PATCH 0/4] [core-updates] Fix cross-compiling bootstrap tarballs
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36322@debbugs.gnu.org)
86lewh1179.fsf@gmail.com
Hi Marius,

What is the status of this patch series [1]?



On Fri, 21 Jun 2019 at 14:24, Marius Bakke <mbakke@fastmail.com> wrote:
Toggle quote (19 lines)
> With these patches, we can again cross-compile the bootstrap tarballs on
> core-updates.
>
> As of commit bd0dc2df04a1550f41d3d5c7cc2c26ad12468b36, here are my
> results for armhf and Hurd(!):
>
> $ ./pre-inst-env guix build --target=arm-linux-gnueabihf bootstrap-tarballs
> /gnu/store/q245c0s6cc55ziamfxpv43lwbnxaw0n6-bootstrap-tarballs-0
> $ guix hash -rx $(!!)
> 01lksw8qw973bc2lllz97pxm67x84rz8crbdiqwnlbyjq0j3mvaq
>
> $ ./pre-inst-env guix build --target=i586-pc-gnu bootstrap-tarballs
> /gnu/store/4i3zxmzcrpg2h8inwgfd24sdsgan9jw7-bootstrap-tarballs-0
> $ guix hash -rx $(!!)
> 17yjlqvwlv8v28qm5v888kshx30djylml9fgpwkcqvx3idzw7i1v
>
> Now, I haven't actually tried bootstrapping a system from these yet.
> Do we have automated tests for that?

I think the next action is waiting an answer for this question,
eventually. :-)

Toggle quote (12 lines)
> Marius Bakke (4):
> gnu: make-bootstrap: Remove obsolete header file.
> gnu: make-bootstrap: Restore cross-compilation workarounds.
> gnu: make-bootstrap: Adjust for GCC 7.
> gnu: bootstrap-tarballs: Don't include the native mes when
> cross-compiling.
>
> gnu/packages/make-bootstrap.scm | 64 ++++++++++++++++++++++++---------
> guix/build/make-bootstrap.scm | 1 -
> 2 files changed, 47 insertions(+), 18 deletions(-)


What would the next step? More tests? Merge into core-updates? Other?


Cheers,
simon
M
M
Marius Bakke wrote on 7 Apr 2022 23:15
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 36322-close@debbugs.gnu.org)
87bkxcioip.fsf@gnu.org
zimoun <zimon.toutoune@gmail.com> skriver:

Toggle quote (6 lines)
> Hi Marius,
>
> What is the status of this patch series [1]?
>
> 1: <http://issues.guix.gnu.org/issue/36322>

[...]

Toggle quote (11 lines)
>> Marius Bakke (4):
>> gnu: make-bootstrap: Remove obsolete header file.
>> gnu: make-bootstrap: Restore cross-compilation workarounds.
>> gnu: make-bootstrap: Adjust for GCC 7.
>> gnu: bootstrap-tarballs: Don't include the native mes when
>> cross-compiling.
>>
>> gnu/packages/make-bootstrap.scm | 64 ++++++++++++++++++++++++---------
>> guix/build/make-bootstrap.scm | 1 -
>> 2 files changed, 47 insertions(+), 18 deletions(-)

This series is long obsolete, closing!

Thanks for the reminder. :-)
-----BEGIN PGP SIGNATURE-----

iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCYk9UXg8cbWFyaXVzQGdu
dS5vcmcACgkQ6HGLpZEUEHe0IwEA/loeQr139ZvbvQUzzMP9WLQxl/7A3b9qgp0G
ki7AeegBAJXKxZ7OfSD6NpcfzucpEExFwzmx9j3+TUtDZh1DPf8K
=2nSS
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 36322@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 36322
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch