#2 Add ucrt64 target
Merged 2 years ago by smani. Opened 2 years ago by elmarco.
rpms/ elmarco/mingw-binutils ucrt  into  rawhide

file modified
+86 -4
@@ -1,8 +1,9 @@ 

  %global run_testsuite 1

+ %global mingw_build_ucrt64 1

  

  Name:           mingw-binutils

  Version:        2.37

- Release:        4%{?dist}

+ Release:        5%{?dist}

  Summary:        Cross-compiled version of binutils for Win32 and Win64 environments

  

  License:        GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
@@ -129,8 +130,9 @@ 

  BuildRequires:  bison

  BuildRequires:  texinfo

  BuildRequires:  zlib-devel

- BuildRequires:  mingw32-filesystem >= 102

- BuildRequires:  mingw64-filesystem >= 102

+ BuildRequires:  mingw32-filesystem >= 133

+ BuildRequires:  mingw64-filesystem >= 133

+ BuildRequires:  ucrt64-filesystem >= 133

  %if %{run_testsuite}

  BuildRequires:  dejagnu

  BuildRequires:  sharutils
@@ -171,6 +173,17 @@ 

  Cross compiled binutils (utilities like 'strip', 'as', 'ld') which

  understand Windows executables and DLLs.

  

+ %package -n ucrt64-binutils

+ Summary:        Cross-compiled version of binutils for the Win64 environment

+ Requires:       mingw-binutils-generic = %{version}-%{release}

+ 

+ # NB: This must be left in.

+ Requires:       ucrt64-filesystem >= 133

+ 

+ %description -n ucrt64-binutils

+ Cross compiled binutils (utilities like 'strip', 'as', 'ld') which

+ understand Windows executables and DLLs.

+ 

  

  %prep

  %autosetup -p1 -n binutils-%{version}
@@ -222,6 +235,24 @@ 

  %make_build

  popd

  

+ mkdir build_ucrt64

+ pushd build_ucrt64

+ CFLAGS="%{optflags}" \

+ ../configure \

+   --build=%_build --host=%_host \

+   --target=%{ucrt64_target} \

+   --disable-nls \

+   --with-sysroot=%{ucrt64_sysroot} \

+   --prefix=%{_prefix} \

+   --bindir=%{_bindir} \

+   --includedir=%{_includedir} \

+   --libdir=%{_libdir} \

+   --mandir=%{_mandir} \

+   --infodir=%{_infodir}

+ 

+ %make_build

+ popd

+ 

  # Create multilib versions for the tools strip, objdump nm, and objcopy

  mkdir build_multilib

  pushd build_multilib
@@ -229,7 +260,7 @@ 

  ../configure \

    --build=%_build --host=%_host \

    --target=%{mingw64_target} \

-   --enable-targets=%{mingw64_target},%{mingw32_target} \

+   --enable-targets=%{mingw64_target},%{mingw32_target},%{ucrt64_target} \

    --disable-nls \

    --with-sysroot=%{mingw64_sysroot} \

    --prefix=%{_prefix} \
@@ -274,6 +305,20 @@ 

    uuencode binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}.tar.bz2

    rm -f binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}-*.{sum,log}

  popd

+ 

+ pushd build_ucrt64

+   make -k check < /dev/null || :

+   echo ====================TESTING UCRT64 =========================

+   cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum

+   echo ====================TESTING UCRT64 END=====================

+   for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}

+   do

+     ln $file binutils-%{ucrt64_target}-$(basename $file) || :

+   done

+   tar cjf binutils-%{ucrt64_target}.tar.bz2 binutils-%{ucrt64_target}-*.{sum,log}

+   uuencode binutils-%{ucrt64_target}.tar.bz2 binutils-%{ucrt64_target}.tar.bz2

+   rm -f binutils-%{ucrt64_target}.tar.bz2 binutils-%{ucrt64_target}-*.{sum,log}

+ popd

  %endif

  

  
@@ -374,8 +419,45 @@ 

  %{_prefix}/%{mingw64_target}/bin/strip

  %{_prefix}/%{mingw64_target}/lib/ldscripts

  

+ %files -n ucrt64-binutils

+ %{_bindir}/%{ucrt64_target}-addr2line

+ %{_bindir}/%{ucrt64_target}-ar

+ %{_bindir}/%{ucrt64_target}-as

+ %{_bindir}/%{ucrt64_target}-c++filt

+ %{_bindir}/%{ucrt64_target}-dlltool

+ %{_bindir}/%{ucrt64_target}-dllwrap

+ %{_bindir}/%{ucrt64_target}-elfedit

+ %{_bindir}/%{ucrt64_target}-gprof

+ %{_bindir}/%{ucrt64_target}-ld

+ %{_bindir}/%{ucrt64_target}-ld.bfd

+ %{_bindir}/%{ucrt64_target}-nm

+ %{_bindir}/%{ucrt64_target}-objcopy

+ %{_bindir}/%{ucrt64_target}-objdump

+ %{_bindir}/%{ucrt64_target}-ranlib

+ %{_bindir}/%{ucrt64_target}-readelf

+ %{_bindir}/%{ucrt64_target}-size

+ %{_bindir}/%{ucrt64_target}-strings

+ %{_bindir}/%{ucrt64_target}-strip

+ %{_bindir}/%{ucrt64_target}-windmc

+ %{_bindir}/%{ucrt64_target}-windres

+ %{_prefix}/%{ucrt64_target}/bin/ar

+ %{_prefix}/%{ucrt64_target}/bin/as

+ %{_prefix}/%{ucrt64_target}/bin/dlltool

+ %{_prefix}/%{ucrt64_target}/bin/ld

+ %{_prefix}/%{ucrt64_target}/bin/ld.bfd

+ %{_prefix}/%{ucrt64_target}/bin/nm

+ %{_prefix}/%{ucrt64_target}/bin/objcopy

+ %{_prefix}/%{ucrt64_target}/bin/objdump

+ %{_prefix}/%{ucrt64_target}/bin/ranlib

+ %{_prefix}/%{ucrt64_target}/bin/readelf

+ %{_prefix}/%{ucrt64_target}/bin/strip

+ %{_prefix}/%{ucrt64_target}/lib/ldscripts

+ 

  

  %changelog

+ * Wed Feb 23 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 2.37-5

+ - Add ucrt64 target. Related to rhbz#2055254.

+ 

  * Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.37-4

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

  

no initial comment

Pull-Request has been merged by smani

2 years ago

Thanks @smani

How do we handle gcc bootstrap now?

It needs the following
- headers + threads enabled
- gcc bootstrap
- crt
- headers - threads (had to tweak temporarily Require: winpthread here..)
- winpthreads (seems necessary for gcc libs nowadays), with ssp flags disabled
- gcc
- winpthreads
- gcc gomp=1

I'd proceed as you outlined in a side tag (my own notes are:

  • mingw-filesystem
  • mingw-binutils
  • mingw-headers
  • mingw-w64-tools
  • mingw-gcc with bootstrap=1, enable_libgomp=0
  • mingw-crt
  • mingw-gcc with bootstrap=0, enable_libgomp=0
  • mingw-winpthreads
  • mingw-gcc with bootstrap=0, enable_libgomp=1

@smani I haven't done side tag for a long long time ;) any link? So I complete the bootstap in the side tag and then submit the various final PRs? Then the side tag is somehow merged?

Just do fedpkg request-side-tag and follow the instructions printed out. When done, submit an update in bodhi from the side tag.

@smani, I need to push to git though. With --srpm I get: ActionNotAllowed: policy violation (build_from_srpm. Any idea?

Yes you need to push to git. ideally you'd set up a COPR repo before and test everything through, and then do the builds in the side tag when you're confident everything works.

@smani
Here we go with copr https://copr.fedorainfracloud.org/coprs/elmarco/ucrt/

If I just follow your steps, there is an issue at gcc ( bootstrap=1, enable_libgomp=0)
https://download.copr.fedorainfracloud.org/results/elmarco/ucrt/fedora-rawhide-x86_64/03541179-mingw-gcc/builder-live.log.gz

It looks like winpthreads must be built before now...

So that would be:

  • mingw-filesystem
  • mingw-binutils
  • mingw-headers
  • mingw-w64-tools
  • mingw-gcc with bootstrap=1, enable_libgomp=0
  • mingw-crt
  • mingw-winpthreads
  • mingw-gcc with bootstrap=0, enable_libgomp=1

?

You can see the build order I followed here after the failed attempt with GCC following your proposed order: https://copr.fedorainfracloud.org/coprs/elmarco/ucrt/builds/

  • mingw-filesystem
  • mingw-binutils
  • mingw-headers
  • mingw-w64-tools
  • mingw-gcc with bootstrap=1, enable_libgomp=0
  • mingw-crt
    (failed gcc)
  • headers - threads (tweak temporarily -Require: winpthread)
  • winpthreads (with ssp flags disabled)
  • gcc with bootstrap=0, enable_libgomp=1
  • winpthreads

plus copr should have (its in the PR)
- header (add back +Require: winpthreads)

I'd say proceed as you did in COPR, sorry but I haven't yet found the time to look into it in more detail.

@smani ok, I'd need commit accesses to push the changes to rawhide branches, and build on the side tag. thanks

I'm happy to add you, I take you need access to these repos?

mingw-filesystem
mingw-binutils
mingw-headers
mingw-w64-tools
mingw-gcc
mingw-crt
mingw-winpthreads
Metadata