This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
DTRACE_PROBE macro fails to compile with Clang++
- From: Martin Martin <martin at infinio dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 11 Sep 2013 13:32:15 -0400
- Subject: DTRACE_PROBE macro fails to compile with Clang++
- Authentication-results: sourceware.org; auth=none
The following code:
#include <sys/sdt.h>
int main() {
DTRACE_PROBE(a, b);
}
compiles with with G++, but when compiled with clang++ 3.3 gives:
clang++ dtrace_probe.cpp
dtrace_probe.cpp:4:5: error: unknown flag
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:36:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:43:31: note: expanded from macro '_SDT_ASM_3'
# define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:9:2: note: expanded from here
".pushsection .note.stapsdt"
^
<inline asm>:2:31: note: instantiated into assembly here
.pushsection .note.stapsdt,"?","note"
^
dtrace_probe.cpp:4:5: error: .popsection without corresponding .pushsection
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:36:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:41:26: note: expanded from macro '_SDT_ASM_1'
# define _SDT_ASM_1(x) _SDT_S(x) "\n"
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:29:2: note: expanded from here
".popsection"
^
<inline asm>:14:12: note: instantiated into assembly here
.popsection
^
dtrace_probe.cpp:4:5: error: expected '@' or '%' before type
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:38:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BASE); \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:45:36: note: expanded from macro '_SDT_ASM_5'
# define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:32:2: note: expanded from here
".pushsection .stapsdt.base"
^
<inline asm>:2:33: note: instantiated into assembly here
.pushsection .stapsdt.base,"aG","progbits",.stapsdt.base,comdat
^
dtrace_probe.cpp:4:5: error: .popsection without corresponding .pushsection
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:38:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BASE); \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:41:26: note: expanded from macro '_SDT_ASM_1'
# define _SDT_ASM_1(x) _SDT_S(x) "\n"
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:42:2: note: expanded from here
".popsection"
^
<inline asm>:7:12: note: instantiated into assembly here
.popsection
^
4 errors generated.
$ clang++ --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix