[meta-mingw] [PATCH 2/2] binutils: disable gprofng on mingw32 host

Rahul Trivedi <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <CACoT=N4dJyopCtqmz1gmGm4-rdb4WZVrYPO_kXVTjYZbfNZ8fg@mail.gmail.com>
gprofng is enabled by default in binutils 2.42 but does not build for an

x86_64-w64-mingw32 host: its sources rely on POSIX-only constructs

(libdl/dlopen, mmap with MAP_PRIVATE on /proc-style fds, sigaction-based

profiler signals) that mingw-w64 does not provide.


Pass --disable-gprofng via EXTRA_OECONF for mingw32 host builds so

binutils configures and compiles cleanly.


Signed-off-by: Rahul Trivedi <[email protected]>

---

 recipes-devtools/binutils/binutils_%.bbappend | 2 ++

 1 file changed, 2 insertions(+)


diff --git a/recipes-devtools/binutils/binutils_%.bbappend
b/recipes-devtools/binutils/binutils_%.bbappend

index 401bace..76a8c6f 100644

--- a/recipes-devtools/binutils/binutils_%.bbappend

+++ b/recipes-devtools/binutils/binutils_%.bbappend

@@ -3,3 +3,5 @@

 # in dlltool.c.  Push the POSIX minimum / NTFS per-component limit via the

 # compile flags instead of carrying a source patch.

 CFLAGS:append:mingw32 = " -DNAME_MAX=255"

+

+EXTRA_OECONF:append:mingw32 = " --disable-gprofng"

-- 

2.51.0



On Wed, Apr 29, 2026 at 5:56 PM Rahul Trivedi <[email protected]> wrote:
>
> mingw-w64's <limits.h> does not define NAME_MAX, which Poky's backport
>
> of upstream binutils commit d0285cdf58ad (carried as
>
> 0017-dlltool-file-name-too-long.patch in scarthgap) uses unconditionally
>
> in dlltool.c.  As a result, building binutils-cross-canadian for an
>
> x86_64-w64-mingw32 host fails with:
>
>
>     dlltool.c: error: 'NAME_MAX' undeclared
>
>
> Define NAME_MAX via CFLAGS at the POSIX minimum and NTFS per-component
>
> limit (255) for mingw32 host builds, which avoids carrying a source
>
> patch in meta-mingw.
>
>
> Signed-off-by: Rahul Trivedi <[email protected]>
>
> ---
>
>  recipes-devtools/binutils/binutils_%.bbappend | 5 +++++
>
>  1 file changed, 5 insertions(+)
>
>  create mode 100644 recipes-devtools/binutils/binutils_%.bbappend
>
>
> diff --git a/recipes-devtools/binutils/binutils_%.bbappend
> b/recipes-devtools/binutils/binutils_%.bbappend
>
> new file mode 100644
>
> index 0000000..401bace
>
> --- /dev/null
>
> +++ b/recipes-devtools/binutils/binutils_%.bbappend
>
> @@ -0,0 +1,5 @@
>
> +# mingw-w64 <limits.h> doesn't define NAME_MAX, which Poky's backport of
>
> +# upstream commit d0285cdf58ad (0017-dlltool-file-name-too-long.patch) uses
>
> +# in dlltool.c.  Push the POSIX minimum / NTFS per-component limit via the
>
> +# compile flags instead of carrying a source patch.
>
> +CFLAGS:append:mingw32 = " -DNAME_MAX=255"
>
> --
>
> 2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.