[MacPorts] #70812: ossp-uuid +universal won't build under Sequoia

MacPorts noreply at macports.org
Sat Sep 21 19:59:21 UTC 2024


#70812: ossp-uuid +universal won't build under Sequoia
------------------------------+--------------------
  Reporter:  BarneyStratford  |      Owner:  (none)
      Type:  defect           |     Status:  new
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.10.1
Resolution:                   |   Keywords:
      Port:  ossp-uuid        |
------------------------------+--------------------

Comment (by kencu):

 Forcing {{{ac_cv_va_copy=yes}}} has been in the Portfile for 15 years:

 <https://github.com/macports/macports-
 ports/commit/fad4ce24b13740f00bb10dd4826302d27776fc7a#diff-
 b85b5f400cccc474bd41bd1bc78f2079713c8ee9b59f91f3a416586fa172ff05R35>

 and I simply extended that use a few years ago to add the new arm64
 platform <https://github.com/macports/macports-
 ports/commit/18d8336a2f6c16c5f6cefa0a26d44a240511519a> adding one more
 entry to fix the failing universal build at that time, which worked well
 enough up to now.

 However, according to to ChatGPT, {{{ac_cv_va_copy=yes}}}  was never the
 right fix.

 {{{

 The error you're encountering is related to the misuse of the `va_copy`
 macro, which is intended to copy a variable argument list (of type
 `va_list`). The macro expansion in your case seems problematic,
 specifically the declaration `__VA_COPY_USE_yes`, which is not recognized
 as a valid function or macro.

 ### Here's what's going wrong:
 1. The error message indicates that `__VA_COPY_USE_yes` is being used as
 part of a `va_copy` macro, but it is not defined anywhere.
 2. This error arises due to an implicit function declaration issue, which
 is disallowed in ISO C99 and later standards.

 ### To fix this issue:

 1. **Check the `config.h` file**:
    The root of the issue lies in the `config.h` file:
    ```c
    #define va_copy(d, s) __VA_COPY_USE(d, s)
    ```
    The macro `__VA_COPY_USE` is incorrectly expanding to
 `__VA_COPY_USE_yes`, which isn't a valid function.

    You need to either replace this macro with the correct `va_copy`
 function or adjust how the `__VA_COPY_USE` macro is being defined.

 2. **Use standard `va_copy`**:
    The `va_copy` macro is part of the C99 standard, and its proper usage
 looks like this:
    ```c
    #ifdef __GNUC__
    #  define va_copy(d,s) __builtin_va_copy(d,s)
    #else
    #  define va_copy(d,s) (d = s)
    #endif
    ```
    If your platform supports `__builtin_va_copy`, you should use it.

 3. **Modify the `config.h` definitions**:
    Check if you can replace:
    ```c
    #define va_copy(d, s) __VA_COPY_USE(d, s)
    ```
    with:
    ```c
    #define va_copy(d, s) __builtin_va_copy(d, s)
    ```
    or another correct variant of `va_copy` for your compiler.

 4. **Verify Clang version and target SDK**:
    You may want to verify the compatibility of the Clang version with the
 target SDK (`MacOSX15.sdk`) you are compiling against. Certain SDK or
 compiler version mismatches can lead to incorrect macro expansion or
 compilation issues.

 By resolving the incorrect `__VA_COPY_USE` macro and replacing it with a
 valid `va_copy` implementation, the errors should be resolved.
 }}}


 Whether it needs a different fix, or any fix at all any more, and what
 platforms may or may not need the fix to properly build universal will be
 an interesting project for someone to tackle.

 The port has a significant number of installs based on MacPorts' metrics,
 so I'll leave this for someone to take on who has time to invest in it.

-- 
Ticket URL: <https://trac.macports.org/ticket/70812#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list