[Clfs-support] [clfs-embedded GIT-20161228-x86 ] GCC-6.2.0 - Final: libmpx failed to build

Andrew Bradford andrew at bradfordembedded.com
Wed Jun 14 06:04:47 PDT 2017


Hi Michele,

On 06/06 09:32, Michele Bucca wrote:
> I'm trying to build GCC (Stage 2) in the book however I get this
> error. I'm building for i486-linux-musl
> 
> make[4]: Entering directory
> '/mnt/clfs/sources/gcc-build/i486-linux-musl/libmpx/mpxrt'
> /bin/sh ../libtool  --tag=CC   --mode=compile
> /mnt/clfs/sources/gcc-build/./gcc/xgcc
> -B/mnt/clfs/sources/gcc-build/./gcc/
> -B/mnt/clfs/cross-tools/i486-linux-musl/bin/
> -B/mnt/clfs/cross-tools/i486-linux-musl/lib/ -isystem
> /mnt/clfs/cross-tools/i486-linux-musl/include -isystem
> /mnt/clfs/cross-tools/i486-linux-musl/sys-include    -DHAVE_CONFIG_H
> -I. -I../../../../gcc-6.2.0/libmpx/mpxrt -I..
> -I../../../../gcc-6.2.0/libmpx/..  -fPIC -g -O2 -c -o
> libmpx_la-mpxrt.lo `test -f 'mpxrt.c' || echo
> '../../../../gcc-6.2.0/libmpx/mpxrt/'`mpxrt.c
> libtool: compile:  /mnt/clfs/sources/gcc-build/./gcc/xgcc
> -B/mnt/clfs/sources/gcc-build/./gcc/
> -B/mnt/clfs/cross-tools/i486-linux-musl/bin/
> -B/mnt/clfs/cross-tools/i486-linux-musl/lib/ -isystem
> /mnt/clfs/cross-tools/i486-linux-musl/include -isystem
> /mnt/clfs/cross-tools/i486-linux-musl/sys-include -DHAVE_CONFIG_H -I.
> -I../../../../gcc-6.2.0/libmpx/mpxrt -I..
> -I../../../../gcc-6.2.0/libmpx/.. -fPIC -g -O2 -c
> ../../../../gcc-6.2.0/libmpx/mpxrt/mpxrt.c  -fPIC -DPIC -o
> .libs/libmpx_la-mpxrt.o
> In file included from ../../../../gcc-6.2.0/libmpx/mpxrt/mpxrt.c:54:0:
> ../../../../gcc-6.2.0/libmpx/mpxrt/mpxrt.c: In function 'read_mpx_status_sig':
> ../../../../gcc-6.2.0/libmpx/mpxrt/mpxrt.h:52:42: error: invalid
> application of 'sizeof' to incomplete type 'struct _libc_fpstate'
>  #define XSAVE_OFFSET_IN_FPMEM    sizeof (struct _libc_fpstate)
>                                           ^
> ../../../../gcc-6.2.0/libmpx/mpxrt/mpxrt.c:132:58: note: in expansion
> of macro 'XSAVE_OFFSET_IN_FPMEM'
>    uint8_t *regs = (uint8_t *)uctxt->uc_mcontext.fpregs + XSAVE_OFFSET_IN_FPMEM;
>                                                           ^~~~~~~~~~~~~~~~~~~~~
> Makefile:387: recipe for target 'libmpx_la-mpxrt.lo' failed
> make[4]: *** [libmpx_la-mpxrt.lo] Error 1
> make[4]: Leaving directory
> '/mnt/clfs/sources/gcc-build/i486-linux-musl/libmpx/mpxrt'
> Makefile:409: recipe for target 'all-recursive' failed
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory '/mnt/clfs/sources/gcc-build/i486-linux-musl/libmpx'
> Makefile:300: recipe for target 'all' failed
> make[2]: *** [all] Error 2
> make[2]: Leaving directory '/mnt/clfs/sources/gcc-build/i486-linux-musl/libmpx'
> Makefile:11448: recipe for target 'all-target-libmpx' failed
> make[1]: *** [all-target-libmpx] Error 2
> make[1]: Leaving directory '/mnt/clfs/sources/gcc-build'
> Makefile:867: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> should I put --disable-libmpx on configure? (if I do it builds
> successfully in my personal experience)
> 
> Do you have the same problem when building for i686-linux-musl?

I haven't built for any x86 in a while, but musl does not have
'struct _lib_fpstate' in its code, while glibc does.  So it seems that
libmpx has a hard dependency on a libc which supports this, and musl
doesn't (seem to).

Likely this means that --disable-libmpx is needed.

I created a trac ticket to keep tabs on this: http://trac.clfs.org/ticket/1170

Thanks,
Andrew



More information about the Clfs-support mailing list