Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

Intel MPX, gcc/as fail to build glibc


Has anyone successfully compiled an MPX instrumented glibc? What version of glibc, gcc and binutils did you use?

I'm having a terrible time trying to get this to work. I get errors of this form:

I have tried at least the following versions:

gcc (GCC) 5.0.0 20141211 (experimental) using GNU assembler (Gentoo 2.24 p1.4) 2.24
gcc (GCC) 5.0.0 20141215 (experimental) using GNU assembler (Gentoo 2.24 p1.4) 2.24
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (Gentoo 2.24 p1.4) 2.24
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (GNU Binutils)
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (GNU Binutils)
gcc (GCC) 5.0.0 20140925 (experimental) using GNU assembler (GNU Binutils)

They all give the same errors. Note that I'm giving the compiler -fcheck-pointer-bounds and -mmpx, if I omit these, there are no compilation issues.

Note that the last version is the same one as provided by Intel at

Passing -S to the compiler for the vfprintf.c file works without errors. However assembling this file fails. The unresolved labels in the assembly output look like this:

I have a working MPX environment, I can compile and run MPX instrumented binaries using the Intel SDE with no issues.

My configure statement when attempting to build glibc: ..glibc_source/configure CC='/mpx_gcc3/bin/gcc' CFLAGS='-g -O2 -fcheck-pointer-bounds -mmpx' --prefix=/mpx_glibc2 --disable-werror

I have my MPX enabled GCC in /mpx_gcc3, I'm giving the CFLAGS argument (obviously) to get MPX instrumented code produced. I have --disable-werror as I get some warnings which otherwise halt the build earlier than my main error. If these warnings are useful, I can provide them.

What is the problem here? Is this GCC producing bad assembly, or is this an assembler (GNU AS) issue? I looked at the assembly and it seems it is a problem with GCC.

However my main question is simply: How do I compile glibc?

0 Kudos
2 Replies

Thanks for reporting this, I can reproduce the failure for the following test

int foo(int p)


 int a;

static const int step0_jumps[] = { &&l1 - &&l2};


 if (p > 0)

   a = 1;


   a = 2;

l2: return a+ step0_jumps[0];


Issue seems to be in that tricky usage of labels. We will take a look



Great, a few days after I posted here initially I filed a bug report to GCC as well. In case you were thinking of filing a bug report there, to avoid duplicates. I isolated the bug down to something similar to what you have found -- tricky usage of labels: