MINGW-packages
MINGW-packages copied to clipboard
UNC paths now unreadable by GNU binutils (ld)
I upgraded my MSYS2 toolchain with pacman -Syu after a few months of leaving it alone, since I was afraid of breakage. It appears my fears were well-founded. Since at least 2019, I've been using MSYS2 to build multi-gigabyte repos over UNC paths/mapped network drives. The problem with network drives on Windows is that the applications can see that the mapped drive is a network drive, and GNU binutils is now seeing that Z: is a UNC path, and spitting "invalid argument" when attempting to access some files there, suggesting to me that something is using a Windows API call wrong.
Any help would be appreciated.
This package appears to work, though I haven't tested others in the 2.39 series other than the latest. https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-binutils-2.38-4-any.pkg.tar.zst
At a quick glance I'd say one of:
- https://github.com/bminor/binutils-gdb/commit/cb7da2a640c405e0658c135b3ab2ac5be2fdc53a
- https://github.com/bminor/binutils-gdb/commit/ba0eb22c8beb1166780d7c7e11ef4e623b8017e9
- https://github.com/bminor/binutils-gdb/commit/5f3fc928df037b21ee401d7115951b988a3ea571
Also see https://github.com/bminor/binutils-gdb/commits/master/bfd/bfdio.c
Which environment are you compiling the code in ? I am only asking because the msys version of /usr/include/locale.h does not contain the "___lc_codepage_func(void);" definition but the /mingw64/include/locale.h does.
It'd be the best if you contacted Binuts developers directly because we don't develop it.
Hi! Open the MSYS2 64bit > MSYS2 MSYS
shell and enter the following commands:
- git clone https://github.com/msys2/MINGW-packages.git
- cd MINGW-packages/mingw-w64-binutils
- export MINGW_ARCH=mingw64
- export PKGEXT=.pkg.tar
- makepkg-mingw
You should see the following output:
$ makepkg-mingw
==> MINGW_ARCH: mingw64
-> Building mingw64...
==> Making package: mingw-w64-binutils 2.39-2
...
- Note: if you get an error about failed PGP checks:
Simply add the==> Verifying source file signatures with gpg... binutils-2.39.tar.xz ... FAILED (unknown public key 13FCEF89DD9E3C4F) ==> ERROR: One or more PGP signatures could not be verified!
--skippgpcheck
argument:makepkg-mingw --skippgpcheck
From there on, you can make any modification you want to the source code located in MINGW-packages/mingw-w64-binutils/src/binutils-2.39
, then just build a new package with the following command:
- makepkg-mingw -f --noextract --install
Refer to https://man.archlinux.org/man/makepkg.8.en for more informations
not related but since this is about binutils heres a patch adding reproducible libraries to dlltool, taken from upstream and considered in testing but seems to work fine. pr29489.zip
@revelator could you open a PR for the reproducible builds patch?
not home atm. but ill see what i can do.
Thanks! 😃 Anyway no rush, whenever you feel like!
if in a hurry to try it out then the maintainer for the package can just add it at the end of the other patches for binutils :) been using it myself for several months and it works fine for my part (using it with python mostly since that package seems to use dlltool extensivly and no problems so far).
added the patch and upped the build number, may have to update the checksums cant remember if i did that beforehand. dlltool defaults to deterministic when binutils are build with --enable-deterministic-archives so it should be on by default. built all python packages using this and no problems so far.