Valgrind Unrecognised instruction
<p>I have the following code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;random&gt;

int main() {
    std::mt19937_64 rng(std::random_device{}());
    std::cout &lt;&lt; std::uniform_int_distribution&lt;&gt;(0, 100)(rng) &lt;&lt; '\n';
}
</code></pre>

<p>I try to profile it using <code>valgrind</code>, but it says:</p>

<pre><code>vex amd64-&gt;IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
vex amd64-&gt;IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64-&gt;IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64-&gt;IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==2092== valgrind: Unrecognised instruction at address 0x4cdc1b5.  
==2092== at 0x4CDC1B5:std::(anonymous namespace)::__x86_rdrand() (random.cc:69)  
==2092== by 0x4CDC321: std::random_device::_M_getval() (random.cc:130)  
==2092== by 0x4009D4: main (random.h:1619)  
</code></pre>

<p>Preceded by multiple instances of:</p>

<pre><code>--2092-- WARNING: Serious error when reading debug info  
--2092-- When reading debug info from /lib/x86_64-linux-gnu/ld-2.22.so:  
--2092-- Ignoring non-Dwarf2/3/4 block in .debug_info  
</code></pre>

<p>I am on Debian using standard packages on an x86-64 platform compiling with gcc 5.3.1 using valgrind-3.11.0. The illegal instruction seems to be inside libstdc++6.</p>

<p>How do I get <code>valgrind</code> to profile my code?</p>