I tried to build it with 

TARGET_SYS           = "i686-oe-linux"
MACHINE              = "qemux86"
but there is no error in do_compile_ptest_base.  

make[1]: Entering directory '/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/helpers'
i686-oe-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/helpers -I../..   -I../../../kbd-2.5.1/src/libcommon -I../../../kbd-2.5.1/src/libkeymap -I../../../kbd-2.5.1/src/libkbdfile -DDATADIR=\"/usr/lib/kbd/ptest/tests\" -DBUILDDIR=\"/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/helpers\"    -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c -o libkeymap-bkeymap.o ../../../kbd-2.5.1/tests/helpers/libkeymap-bkeymap.c
...
libtool: link:  echo "local: *; };" >> .libs/libtswrap.ver
libtool: link:  i686-oe-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot -shared  -fPIC -DPIC  .libs/ioctl.o   -ldl  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot -g -O0 -O2 -O2 -g -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native=   -Wl,-soname -Wl,libtswrap.so.1 -Wl,-version-script -Wl,.libs/libtswrap.ver -o .libs/libtswrap.so.1.0.0
libtool: link: (cd ".libs" && rm -f "libtswrap.so.1" && ln -s "libtswrap.so.1.0.0" "libtswrap.so.1")
libtool: link: (cd ".libs" && rm -f "libtswrap.so" && ln -s "libtswrap.so.1.0.0" "libtswrap.so")
libtool: link: i686-oe-linux-gcc-ar cr .libs/libtswrap.a  ioctl.o
libtool: link: i686-oe-linux-gcc-ranlib .libs/libtswrap.a
libtool: link: ( cd ".libs" && rm -f "libtswrap.la" && ln -s "../libtswrap.la" "libtswrap.la" )
make[1]: Leaving directory '/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/libtswrap'
Maybe the gcc is different.
Could you share your build steps?