New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 34040 - "error: ‘__va_copy’ was not declared in this scope" while building libomp against musl libc
Summary: "error: ‘__va_copy’ was not declared in this scope" while building libomp aga...
Status: RESOLVED FIXED
Alias: None
Product: OpenMP
Classification: Unclassified
Component: Runtime Library (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-02 21:19 PDT by Peter Levine
Modified: 2017-08-19 17:06 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2017-08-02 21:19:20 PDT
Building libomp-3.9.0 in Gentoo Linux with musl as libc using GCC-6.3.0 or GCC-5.4.0 results in:

> /var/tmp/portage/sys-libs/libomp-3.9.0/work/openmp-3.9.0.src/runtime/src/kmp_str.c:211:40: error: ‘__va_copy’ was not declared in this scope
>                  __va_copy( _args, args );  // Make copy of args.
>                                         ^

musl had previously provided "__va_copy" but has since relegated it only for scenarios in which "__GNUC__ < 3", in favor of using "va_copy" (see http://git.musl-libc.org/cgit/musl/commit/?id=def0af189871a499efdc9bc37438d8b20eb702ab).


Seeing as libomp source code already uses one-line, double-slash style comments which require at least C99 dialect, and that va_copy is a C99 macro, the best course of action would be to change "__va_copy" to "va_copy".
Comment 1 Peter Levine 2017-08-19 17:06:38 PDT
Fixed with https://reviews.llvm.org/rL311269