[MacPorts] #74329: yodl @3.05.01: build fails on x86_64 - root.h overrides compiler va_copy with an invalid assignment

MacPorts noreply at macports.org
Sat Aug 15 18:25:18 UTC 2026


#74329: yodl @3.05.01: build fails on x86_64 - root.h overrides compiler va_copy
with an invalid assignment
-----------------------------+---------------------
 Reporter:  rex4539          |      Owner:  (none)
     Type:  defect           |     Status:  new
 Priority:  Normal           |  Milestone:
Component:  ports            |    Version:  2.12.99
 Keywords:  x86_64 haspatch  |       Port:  yodl
-----------------------------+---------------------
 `yodl` fails to build on x86_64 macOS. The build stops in `src/string`:

 {{{
 /usr/bin/clang -c -o ../../tmp/wip/rss/20stringvformat.o -Os -arch x86_64
 -c stringvformat.c
 stringvformat.c:13:5: error: array type 'va_list' (aka
 '__builtin_va_list') is not assignable
    13 |     va_copy(copy, list);
       |     ^       ~~~~
 ./../root/root.h:86:42: note: expanded from macro 'va_copy'
    86 | #    define va_copy(dest, src) do { dest = src; } while (0)
       |                                     ~~~~ ^
 1 error generated.
 }}}

 == Cause ==

 `src/root/root.h` carries a fallback for platforms without `va_copy`:

 {{{
 /* va_copy is C99; try to deal with systems that lack it. */
 #ifndef va_copy
 #  ifdef __va_copy
 #    define va_copy __va_copy
 #  else
 #    define va_copy(dest, src) do { dest = src; } while (0)
 #  endif
 #endif
 }}}

 but `root.h` never includes `<stdarg.h>`, and it is included '''ahead'''
 of
 `<stdarg.h>` by its consumers: `src/string/string.h:10` includes
 `../root/root.h`, and only then (line 12) `<stdarg.h>`. So neither
 `va_copy`
 nor `__va_copy` is defined when the guard is evaluated, and the fallback
 replaces a perfectly good compiler-provided `va_copy` with a plain
 assignment.

 That assignment is invalid wherever `va_list` is an array type. On x86_64
 (System V) `va_list` is `__builtin_va_list`, an array type, so the
 assignment
 is a hard error. On arm64 Darwin `va_list` is a plain `char *`, which is
 assignable — '''which is why the port builds on Apple Silicon and fails
 only
 on Intel.'''

 The bug is upstream rather than MacPorts-specific; it is latent on any
 x86_64
 target, and recent clang rejects it outright instead of warning.

 == Fix ==

 Include `<stdarg.h>` in `root.h` ahead of the guard, so the compiler's own
 `va_copy` is visible and the fallback is correctly skipped.

 Two hunks: a new `files/include-stdarg.patch`, and the Portfile change
 adding
 it with a `revision` bump.

 `files/include-stdarg.patch`:

 {{{#!diff
 Index: src/root/root.h
 ===================================================================
 --- src/root/root.h.orig
 +++ src/root/root.h
 @@ -78,6 +78,13 @@
  #  define ATTRIBUTE_FORMAT_PRINTF(a,b)
  #endif

 +/* va_copy is defined by <stdarg.h>, which root.h did not include.  As
 +   root.h is included ahead of <stdarg.h> (e.g. by src/string/string.h),
 +   the fallback below used to override a perfectly good compiler-provided
 +   va_copy with a plain assignment, which is invalid wherever va_list is
 +   an array type (x86_64 System V, among others). */
 +#include <stdarg.h>
 +
  /* va_copy is C99; try to deal with systems that lack it. */
  #ifndef va_copy
  #  ifdef __va_copy
 }}}

 Portfile:

 {{{#!diff
 --- textproc/yodl/Portfile
 +++ textproc/yodl/Portfile
 @@ -4,6 +4,7 @@

  name                yodl
  version             3.05.01
 +revision            1
  categories          textproc
  platforms           darwin
  license             GPL-3
 @@ -32,7 +33,8 @@

  patchfiles          avoid-c++11.patch \
                      use-macports-compilers.patch \
 -                    use-macports-locations.patch
 +                    use-macports-locations.patch \
 +                    include-stdarg.patch
  post-patch {
      reinplace -W ${worksrcpath} s|__MP_CC__|${configure.cc}| INSTALL.im
      reinplace -W ${worksrcpath} s|__MP_CXX__|${configure.cxx}| INSTALL.im
 }}}

 == Maintainer note ==

 The Portfile names `{larryv @larryv}` as maintainer, but #56651
 (''[Port Abandoned] Ports abandoned by larryv'', closed `wontfix`) lists
 `yodl` among the abandoned ports. The maintainer line was apparently never
 updated, so the port may in practice be unmaintained.

 == Steps to reproduce ==

 {{{
 sudo port install yodl
 }}}

 == Verification performed ==

 Applied to a pristine `yodl_3.05.01.orig.tar.gz` extraction together with
 the
 three existing patchfiles, then built with the port's own flags
 (`CFLAGS='-Os -arch x86_64'` — no extra workaround flags):

  * `./build programs` — rc=0
  * `./build macros` — rc=0
  * `./build man` — rc=0
  * 0 `error:` lines across all three phase logs
  * `yodl --version` → `yodl version 3.05.01`
  * smoke test: processed a small `article` document to text output
 correctly

 Without the patch the same tree fails at `stringvformat.c` as shown above.

 == Environment ==

 || macOS || 15.7.8 (24G824), x86_64 ||
 || Xcode || Command Line Tools, Apple clang 17.0.0 (clang-1700.0.13.5) ||
 || MacPorts || 2.12.99 ||
 || icmake || 9.03.01_1 ||

 == Workaround until the fix lands ==

 {{{
 sudo port clean --work yodl
 sudo port install yodl configure.cflags="-Os -include stdarg.h"
 }}}

 Note that `configure.cflags-append=` does '''not''' work on the MacPorts
 command line — command-line options are applied as a plain `set`, so the
 `-append` form silently creates an unused variable instead.

-- 
Ticket URL: <https://trac.macports.org/ticket/74329>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list