Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binutils update to 2.31.1; enable cross ada #4312

Merged
merged 18 commits into from
Nov 19, 2018
Merged

binutils update to 2.31.1; enable cross ada #4312

merged 18 commits into from
Nov 19, 2018

Conversation

pullmoll
Copy link
Member

@pullmoll pullmoll commented Oct 31, 2018

[ci skip]

Supersedes: #2813
Also see: #4154

We will have a chicken-egg problem with gcc for x86_64-musl:

Once cross-x86_64-linux-musl is built for x86_64, we need to (force) cross build gcc for x86_64-musl from a x86_64 environment with ./xbps-src -a x86_64-musl -f pkg gcc to get Ada going.

Only afterwards the cross builders using an x86_64-musl environment can also compile the cross-*musl* packages.

Got cross build for i686-musl and x86_64-musl working.
Now this needs review and we need to coordinate the steps required to get things done.

@pullmoll pullmoll added the WIP Work in progress label Oct 31, 2018
@maxice8
Copy link
Contributor

maxice8 commented Oct 31, 2018

To avoid triggering CI [ci skip] needs to be in every commit

pullmoll referenced this pull request Oct 31, 2018
Signed-off-by: Jürgen Buchmüller <[email protected]>
@pullmoll
Copy link
Member Author

pullmoll commented Oct 31, 2018

Manual steps required to build gcc for x86_64-musl with gnat:

  1. pick binutils-2.31.1, cross-vpkg-dummy-0.29_1, and cross-x86_64-linux-musl-0.29_1
  2. set up an x86_64 environment on the x86_64-musl builder, i.e. ./xbps-src binary-bootstrap
  3. build binutils, cross-vpkg-dummy and cross-x86_64-linux-musl on x86_64
  4. cross build (forced) gcc-8.2.0_5 for x86_64-musl, i.e. ./xbps-src -a x86_64-musl -f pkg gcc
  5. merge this PR and let the builders work

Once the cross compilers are done:

  1. add gcc-ada and libada-devel to base-chroot{,-musl} templates and revbump or update
  2. finally revbump gcc to have it built with its own gnat

Someone with access to the x86_64-musl builder will have to do this.

In case someone wants to bootstrap w/o a working gcc-ada in the host (e.g. void before gcc-8.2.0_5), you can still use -o ~ada,gnatboot when building gcc for x86_64 in the void bootstrap.

@pullmoll pullmoll removed the WIP Work in progress label Oct 31, 2018
@pullmoll pullmoll changed the title [WIP] binutils update to 2.31.1; enable cross ada binutils update to 2.31.1; enable cross ada Oct 31, 2018
@maxice8
Copy link
Contributor

maxice8 commented Oct 31, 2018 via email

@pullmoll
Copy link
Member Author

pullmoll commented Oct 31, 2018

Uhm, just now, when trying to rebuild gcc for i686, it strikes me that our build system can not use a previous version of gcc-ada and libada-devel when building gcc native.

If I add gcc-ada and libada-devel to the hostmakedepends of gcc also for native builds, this results in a short circuit because those packages are just about to be built. Can we do anything to support this kind of use any previous package or even use a specific previous package dependency?

Thinking about it we could probably use the cross compiler's gnat similar to how gnatboot does it, but we have no cross-x86_64-linux-gnu package.

Or do we have to make gcc-ada and libada-devel part of the base-chroot{,-musl} to always have it available?

Edit2: Last not least we could perhaps integrate gcc-ada and libada* with gcc like we did once with g++.

@Vaelatern
Copy link
Member

Sadly xbps-src doesn't know how to do this.

@ghost
Copy link

ghost commented Nov 3, 2018

patches for binutils 2.31.1?

@pullmoll
Copy link
Member Author

pullmoll commented Nov 3, 2018

@protonesso what patches?

@ghost
Copy link

ghost commented Nov 3, 2018

@pullmoll
Copy link
Member Author

pullmoll commented Nov 3, 2018

No problem here inside a chroot with x86_64-musl:

[jbu@/tmp/void/muslc-3 builddir]$ cat test.c
int main() { return 0; }
[jbu@/tmp/void/muslc-3 builddir]$ gcc -ggdb3 -O0 -static test.c
[jbu@/tmp/void/muslc-3 builddir]$ gdb ./a.out
GNU gdb (GDB) 8.1.1
[... snip ...]
Reading symbols from ./a.out...done.
(gdb) run
Starting program: /builddir/a.out 
[Inferior 1 (process 863) exited normally]
(gdb) 

@ghost
Copy link

ghost commented Nov 3, 2018

oh okay

@pullmoll
Copy link
Member Author

pullmoll commented Nov 6, 2018

Updated to _linux_version=4.19 for the kernel-libc-headers

Is anyone of @void-linux/void-ops around to help go through the steps listed above?

@pullmoll
Copy link
Member Author

ping @void-linux/void-ops

@Gottox
Copy link
Member

Gottox commented Nov 10, 2018

Afaics this breaks the build of new packages, but there's no point where we run time is broken. Do I understand this correctly? If so, we can schedule the rebuild and let the maintainers know not to push to master in that time frame.

@Gottox
Copy link
Member

Gottox commented Nov 10, 2018

Is Wednesday evening CET okay?

@maxice8
Copy link
Contributor

maxice8 commented Nov 10, 2018 via email

@pullmoll
Copy link
Member Author

I don't believe it will break anything. In fact you can even just cross compile gcc for x86_64-musl without -f to create gcc-ada-8.2.0_5.x86_64-musl.xbps, libada-8.2.0_5.x86_64-musl.xbps, and libada-devel-8.2.0_5.x86_64-musl.xbps.
Once these pkgs are available all cross compilers can be built and we can add gcc-ada and libada-devel to the templates for base-chroot and base-chroot-musl and revbump. Still no breakage here and this will also fix bootstrapping.

FWIW Wednesday evening is ok for me. I'll join the xbps channel just in case.

@Gottox
Copy link
Member

Gottox commented Nov 18, 2018

  • 1) pick binutils-2.31.1, cross-vpkg-dummy-0.29_1, and cross-x86_64-linux-musl-0.29_1
  • 2) set up an x86_64 environment on the x86_64-musl builder, i.e. ./xbps-src binary-bootstrap
  • 3) build binutils, cross-vpkg-dummy and cross-x86_64-linux-musl on x86_64
  • 4) cross build (forced) gcc-8.2.0_5 for x86_64-musl, i.e. ./xbps-src -a x86_64-musl -f pkg gcc
  • 5) merge this PR and let the builders work

Once the cross compilers are done:

  • 6) add gcc-ada and libada-devel to base-chroot{,-musl} templates and revbump or update
  • 7) finally revbump gcc to have it built with its own gnat

@Gottox
Copy link
Member

Gottox commented Nov 18, 2018

cross-x86_64-linux-musl

=> Building Linux API headers
patching file include/uapi/linux/kernel.h
Hunk #1 succeeded at 2 (offset 1 line).
patching file include/uapi/linux/libc-compat.h
Hunk #1 FAILED at 165.
Hunk #2 succeeded at 262 with fuzz 2 (offset 54 lines).
1 out of 2 hunks FAILED -- saving rejects to file include/uapi/linux/libc-compat.h.rej
=> ERROR: cross-x86_64-linux-musl-0.29_1: do_build: 'patch -N $args -i $2' exited with 1
=> ERROR:   in _apply_patch() at srcpkgs/cross-x86_64-linux-musl/template:44
=> ERROR:   in _linux_headers() at srcpkgs/cross-x86_64-linux-musl/template:134
=> ERROR:   in do_build() at srcpkgs/cross-x86_64-linux-musl/template:211

@Gottox
Copy link
Member

Gottox commented Nov 18, 2018

fixed by rebasing against master.

@pullmoll
Copy link
Member Author

Rebased my branch before going to bed :)

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Thanks a lot :)

Yet another one on cross-x86_64-linux-musl:

gcc -I../../../gcc-8.2.0/libgcc/. -I../../../gcc-8.2.0/libgcc/../gcc -I../../../gcc-8.2.0/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o unwind-sjlj.o -MT unwind-sjlj.o -MD -MP 
-MF unwind-sjlj.dep -fexceptions -c ../../../gcc-8.2.0/libgcc/unwind-sjlj.c -fvisibility=hidden -DHIDE_EXPORTS
/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/xgcc -B/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/ -B/usr/x86_64-linux-musl/bin/ -B/usr/x86_64-linux-m
usl/lib/ -isystem /usr/x86_64-linux-musl/include -isystem /usr/x86_64-linux-musl/sys-include    -g -O2 -fPIC -D__WCHAR_TYPE__=int -m32 -O2  -g -O2 -fPIC -D__WCHAR_TYPE__=int -DI
N_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fP
IC -mlong-double-80 -DUSE_ELF_SYMVER  -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -mlong-double-80 -DUSE_ELF_SYMVER  -I. -I. -I../../.././gcc -I../../../../gc
c-8.2.0/libgcc -I../../../../gcc-8.2.0/libgcc/. -I../../../../gcc-8.2.0/libgcc/../gcc -I../../../../gcc-8.2.0/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o sse_resms64fx_s.o -M
T sse_resms64fx_s.o -MD -MP -MF sse_resms64fx_s.dep -DSHARED -c -xassembler-with-cpp ../../../../gcc-8.2.0/libgcc/config/i386/sse_resms64fx.S
<command-line>: warning: "__WCHAR_TYPE__" redefined
<built-in>: note: this is the location of the previous definition
/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/xgcc -B/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/ -B/usr/x86_64-linux-musl/bin/ -B/usr/x86_64-linux-musl/lib/ -isystem /usr/x86_64-linux-musl/include -isystem /usr/x86_64-linux-musl/sys-include    -g -O2 -fPIC -D__WCHAR_TYPE__=int -m32 -O2  -g -O2 -fPIC -D__WCHAR_TYPE__=int -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -mlong-double-80 -DUSE_ELF_SYMVER  -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -mlong-double-80 -DUSE_ELF_SYMVER  -I. -I. -I../../.././gcc -I../../../../gcc-8.2.0/libgcc -I../../../../gcc-8.2.0/libgcc/. -I../../../../gcc-8.2.0/libgcc/../gcc -I../../../../gcc-8.2.0/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o generic-morestack.o -MT generic-morestack.o -MD -MP -MF generic-morestack.dep  -c ../../../../gcc-8.2.0/libgcc/generic-morestack.c -fvisibility=hidden -DHIDE_EXPORTS
<command-line>: warning: "__WCHAR_TYPE__" redefined
<built-in>: note: this is the location of the previous definition
In file included from /usr/x86_64-linux-musl/include/stdio.h:22,
                 from ../../../../gcc-8.2.0/libgcc/../gcc/tsystem.h:87,
                 from ../../../../gcc-8.2.0/libgcc/generic-morestack.c:30:
/usr/x86_64-linux-musl/include/bits/alltypes.h:101:24: error: conflicting types for 'size_t'
 typedef unsigned _Addr size_t;
                        ^~~~~~
In file included from ../../../../gcc-8.2.0/libgcc/../gcc/tsystem.h:44,
                 from ../../../../gcc-8.2.0/libgcc/generic-morestack.c:30:
/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/gcc/include/stddef.h:216:23: note: previous declaration of 'size_t' was here
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/xgcc -B/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/./gcc/ -B/usr/x86_64-linux-musl/bin/ -B/usr/x86_64-linux-musl/lib/ -isystem /usr/x86_64-linux-musl/include -isystem /usr/x86_64-linux-musl/sys-include    -g -O2 -fPIC -D__WCHAR_TYPE__=int -O2  -g -O2 -fPIC -D__WCHAR_TYPE__=int -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -mlong-double-80 -DUSE_ELF_SYMVER  -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -mlong-double-80 -DUSE_ELF_SYMVER  -I. -I. -I../.././gcc -I../../../gcc-8.2.0/libgcc -I../../../gcc-8.2.0/libgcc/. -I../../../gcc-8.2.0/libgcc/../gcc -I../../../gcc-8.2.0/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o emutls.o -MT emutls.o -MD -MP -MF emutls.dep -fexceptions -c ../../../gcc-8.2.0/libgcc/emutls.c -fvisibility=hidden -DHIDE_EXPORTS
make[4]: *** [../../../../gcc-8.2.0/libgcc/static-object.mk:17: generic-morestack.o] Error 1
make[4]: Leaving directory '/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/x86_64-linux-musl/32/libgcc'
make[3]: *** [Makefile:1201: multi-do] Error 1
make[3]: Leaving directory '/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/x86_64-linux-musl/libgcc'
make[2]: *** [Makefile:125: all-multi] Error 2
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap/x86_64-linux-musl/libgcc'
make[1]: *** [Makefile:11672: all-target-libgcc] Error 2
make[1]: Leaving directory '/builddir/cross-x86_64-linux-musl-0.29/gcc-bootstrap'
make: *** [Makefile:885: all] Error 2
=> ERROR: cross-x86_64-linux-musl-0.29_1: do_build: 'make ${makejobs}' exited with 2
=> ERROR:   in _gcc_bootstrap() at srcpkgs/cross-x86_64-linux-musl/template:119
=> ERROR:   in do_build() at srcpkgs/cross-x86_64-linux-musl/template:211

@pullmoll
Copy link
Member Author

pullmoll commented Nov 19, 2018

This is strange because it builds just fine here. Verified just now.
Can you zap and binary-bootstrap x86_64-musl again to make sure you have the latest packages?
I'll try the build with the official repository's packages.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

I'm currently building on x86_64 for step 3).

@pullmoll
Copy link
Member Author

Oh, yes, of course on x86_64.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Having a freshly bootstrapped masterdir fixed the issue. something in the build progress taints the masterdir.

@Gottox Gottox merged commit e649ccd into void-linux:master Nov 19, 2018
@pullmoll
Copy link
Member Author

Darn. The main gcc is not aware of GNAT because it has not been rebuilt.
Can you force cross build it once more, i.e. also rebuild gcc-8.2.0_5-x86_64-musl.xbps?

@pullmoll
Copy link
Member Author

My guess that a build without -f should be sufficient was wrong :P

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Might be my mistake, I haven't cleaned up the masterdir.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Hope and wait.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

https://bugzilla.redhat.com/show_bug.cgi?id=1552529#c1 okay, something went wront with binutils.

@pullmoll
Copy link
Member Author

pullmoll commented Nov 19, 2018

Is the builder itself bootstrapped? binutils is in base-chroot-musl.
BTW cannot connect to chat.freenode.net for some reason.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Ah, I see, I think I've got the error.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

The old binutils got installed again.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Looks promising 👍

@pullmoll
Copy link
Member Author

Yes, thank you. I think the gcc revbump needs to happen before the base-chroot{,-musl} update because the latter requires gcc-ada, libada{,-devel} having been built for each architecture.

@pullmoll
Copy link
Member Author

I.e. step 7) before 6)

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

👍 wilco

@pullmoll
Copy link
Member Author

OTOH gcc-ada is required w/o hostmakedpends for the native builds of gcc.
Perhaps let the cross built gcc fail once and then succeed once the base-chroot{,-musl} is done for native.

@Gottox
Copy link
Member

Gottox commented Nov 19, 2018

Great, will update once the build has finished. Thanks!

@pullmoll
Copy link
Member Author

I'm away from keyboard for some time now. Hope you can manage the remaining steps. 🍺

@pullmoll
Copy link
Member Author

@chneukirchen If the aarch64{,-musl} builders are still using their own x86_64 packages, which I believe they do, they need to be updated manually. In the host build binutils, cross-aarch64-linux-{gnu,musl}, and cross-vpkg-dummy.

@Gottox
Copy link
Member

Gottox commented Nov 20, 2018

Why add ada to base-chroot at all? - The only compiler it has included is gcc.

@pullmoll
Copy link
Member Author

Because gcc needs gcc-ada in the host to build ada.
The only way to avoid the (impossible to break) circular dependency is to always have the previous gcc-ada available.

@pullmoll pullmoll deleted the ada branch November 20, 2018 10:00
@ghost ghost mentioned this pull request Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants