[meta-mingw] [PATCH 1/2] binutils: define NAME_MAX for mingw-w64 host build

Rahul Trivedi <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <CACoT=N6UZ9xULwNnNOGqmL9pMrhR66dH=cxbb4fj=u836eXQXA@mail.gmail.com>
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.