Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2016 21:12:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 209590] emulators/qemu-sbruno emulators/qemu-user-static: Fix build with libc++ 3.8.0
Message-ID:  <bug-209590-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209590

            Bug ID: 209590
           Summary: emulators/qemu-sbruno emulators/qemu-user-static: Fix
                    build with libc++ 3.8.0
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sbruno@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(sbruno@FreeBSD.org)
          Assignee: sbruno@FreeBSD.org

Created attachment 170418
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D170418&action=
=3Dedit
Don't define certain atomic macros for C++

During the exp-run in bug 208158, it was found that emulators/qemu-sbruno [=
1]
and emulators/qemu-user-static [2] give errors with libc++ 3.8.0:

  CXX   disas/arm-a64.o
In file included from disas/arm-a64.cc:25:
In file included from
/wrkdirs/usr/ports/emulators/qemu-sbruno/work/qemu-bsd-user-743fbff/disas/l=
ibvixl/vixl/a64/disasm-a64.h:33:
In file included from
/wrkdirs/usr/ports/emulators/qemu-sbruno/work/qemu-bsd-user-743fbff/disas/l=
ibvixl/vixl/a64/decoder-a64.h:30:
In file included from /usr/include/c++/v1/list:173:
In file included from /usr/include/c++/v1/memory:616:
/usr/include/c++/v1/atomic:1316:1: error: expected parameter declarator
atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
^
/wrkdirs/usr/ports/emulators/qemu-sbruno/work/qemu-bsd-user-743fbff/include=
/qemu/atomic.h:139:61:
note: expanded from macro 'atomic_fetch_add'
#define atomic_fetch_add(ptr, n) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CS=
T)
                                                            ^
<built-in>:16:26: note: expanded from here
#define __ATOMIC_SEQ_CST 5
                         ^

This is because qemu's include/qemu/atomic.h defines several atomic macro n=
ames
which conflict with standard C++ names, e.g. atomic_fetch_add,
atomic_fetch_sub, etc.  Fix this (for both ports), by not defining the macr=
os
when __cplusplus is defined.  If any future qemu C++ code needs to use these
atomic macros, it will have to be fixed separately.

It would be better if qemu didn't attempt to use the same identifiers as be=
ing
used in the C++ standard, but renaming all the instances to e.g.
qemu_atomic_xxx would cause a lot of code churn, so it is probably not worth
it.

[1]
http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-05-01_=
10h29m48s/logs/errors/qemu-sbruno-2.5.93.g20160428.log
[2]
http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-05-01_=
10h29m48s/logs/errors/qemu-user-static-2.5.93.g20160428.log

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209590-13>