Standard library header bug when compiling x32 application


Paul D. DeRocco
 

Using Yocto 3.2.1 on an Intel target, trying to use the x32 model. I'm
getting this compile error when I use the SDK to separately compile my
application. I get no such errors when I build Linux, or the SDK.

In file included from
/opt/poky/3.2.1/i64/sysroots/core2-64-poky-linux/usr/include/sys/cdefs.h:453
,
from
/opt/poky/3.2.1/i64/sysroots/core2-64-poky-linux/usr/include/features.h:465,
from
/opt/poky/3.2.1/i64/sysroots/core2-64-poky-linux/usr/include/dirent.h:25,
from ../my_header_file.h:7,
from ../my_source_file.cpp:3:
/opt/poky/3.2.1/i64/sysroots/core2-64-poky-linux/usr/include/bits/long-doubl
e.h:23:10: fatal error: bits/long-double-32.h: No such file or directory

long-double.h includes either long-double-32.h or long-double-64.h based on
the __WORDSIZE macro, which is 32. This works fine when compiling straight
32-bit or 64-bit code, but fails in x32 code because only long-double-64.h
exists. I don't see why the characteristics of a long double should have
anything to do with the "word size" of a pointer or long int. And indeed,
the two headers it chooses from are basically empty, except for defining
__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI. I'm also not sure why it would be
harmful for both of these files to exist always.

So this is an obvious bug. But my question is: what's the cleanest way to
get over this hump? Patch cdefs.h when building the SDK? Use a bbappend on
some SDK recipe to copy long-double-64.h to long-double-32.h? I have no idea
where this recipe would be.

--

Ciao, Paul D. DeRocco
Paul mailto:pderocco@ix.netcom.com

Join yocto@lists.yoctoproject.org to automatically receive all group messages.