On 11/22/2018 9:07 PM, Liu Hao wrote:
在 2018/11/23 上午7:50, Edward Diener 写道:
There is a bug which in binutils which causes clang targeting
mingw-64/gcc on Windows to create a bad windows executable. The bug is
explained at https://sourceware.org/bugzilla/show_bug.cgi?id=23872 and
is fixed at
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=73af69e74974eaa155eec89867e3ccc77ab39f6d

in the binutils-gdb git repository. I understand that part of the blame
for this problem resides with clang, and I have posted a bug report with
clang that is referencing the problem I found, which may be because of
the bug.

Is it possible for me to replace the binutils executables in the latest
mingw-64 installation I have installed on Windows, which is for gcc-8.1,
with the fixed version ? If so how would I do that working on Windows ?
I do have MSYS2 installed but I do not know how to use it to rebuild the
binutils for a mingw-64 installation, if that is possible, so if anyone
can offer me guidance in doing so it would be appreciated. I am a
knowledgeable C++ programmer so I just need some sort of recipe for
doing this, if it is possible, in order to succeed.



If you already have MSYS2 then upgrading its packages is easy:

1. Clone 'https://github.com/Alexpux/MINGW-packages.git'.
2. CD into 'mingw-w64-binutils', where there are a series of patches and
    a file named 'PKGBUILD'.
3. Save the commit in question as a patch file.
4. Add that patch into 'PKGBUILD'. Note that there are two places where
    it is expected. The checksum need not be updated.
5. Run `updpkgsums` in an MSYS2 shell to update the checksum for the new
    patch.
6. Run `makepkg-mingw` in an MSYS2 shell. This builds both mingw32 and
    mingw64 packages for you.

The outcome of this was:

==> Making package: mingw-w64-binutils 2.30-5 (Fri, Nov 23, 2018 8:52:01 AM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found binutils-2.30.tar.bz2
  -> Found binutils-2.30.tar.bz2.sig
  -> Found 0001-enable-gold-on.mingw32.patch
  -> Found 0002-check-for-unusual-file-harder.patch
  -> Found 0010-bfd-Increase-_bfd_coff_max_nscns-to-65279.patch
  -> Found 0110-binutils-mingw-gnu-print.patch
  -> Found 0200-remove-provide-qualifiers.patch
  -> Found binutils-gdb.git-73af69e74974eaa155eec89867e3ccc77ab39f6d.patch
==> Validating source files with sha256sums...
    binutils-2.30.tar.bz2 ... Passed
    binutils-2.30.tar.bz2.sig ... Skipped
    0001-enable-gold-on.mingw32.patch ... Passed
    0002-check-for-unusual-file-harder.patch ... Passed
    0010-bfd-Increase-_bfd_coff_max_nscns-to-65279.patch ... Passed
    0110-binutils-mingw-gnu-print.patch ... Passed
    0200-remove-provide-qualifiers.patch ... Passed
binutils-gdb.git-73af69e74974eaa155eec89867e3ccc77ab39f6d.patch ... Passed
==> Verifying source file signatures with gpg...
    binutils-2.30.tar.bz2 ... FAILED (unknown public key 13FCEF89DD9E3C4F)
==> ERROR: One or more PGP signatures could not be verified!

Do you have any idea of how I am supposed to fix the ERROR ?

7. Wait for the build process to finish. There should be sort of
    'mingw-w64-{i686,x86_64}-binutils*.tar.xz' in the current directory
    after the packages are built successfully.
8. Run `pacman -U <SOME.TAR.XZ>' to install these packages. Remember to
    replace <SOME.TAR.XZ> with the real names of your packages. Wildcards
    are allowed.



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to