The reason for this error is the -fPIC
or -fpic
compiler flag which indicates that position independent code should be emitted. To locate variables it uses a global offset table whose pointer is stored in ebx
. Therefore with this flag you are not allowed to use ebx
in inline assembly.
According to https://software.intel.com/en-us/blogs/2014/12/26/new-optimizations-for-x86-in-upcoming-gcc-50-32bit-pic-mode this is changed in GCC 5.0. The library probably changes your flags so you have to see if you can change your code.