Bug 12083

Summary: build failure with gcc-6.3.0: ./md-unwind-support.h:55:21: error: field 'uc' has incomplete type
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Scott Branden <scott.branden>
Component: devtools / tool chainAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: Medium CC: jon.richardson, meta.mr.watcher, meta.watcher, scott.branden
Version: 2.4   
Target Milestone: 2.4   
Hardware: x86   
OS: arm64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
bitbake libgcc logfile failure none

Description Scott Branden 2017-09-14 04:18:43 UTC
If I see GCCVERSION = "6.3" I get the following build failure:

 aarch64-poky-linux-gcc  -march=armv8-a --sysroot=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0=/usr/src/debug/libgcc/6.3.0-r0 -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot-native= -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot= -O2  -isystem/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/gcc-6.3.0/build.aarch64-poky-linux.aarch64-poky-linux-native/usr/include -O2 -pipe -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -I. -I. -I/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/gcc-6.3.0/build.aarch64-poky-linux.aarch64-poky-linux/aarch64-poky-linux/libgcc/../.././gcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/. -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/../gcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/../include  -DHAVE_CC_TLS  -o unwind-dw2-fde-dip.o -MT unwind-dw2-fde-dip.o -MD -MP -MF unwind-dw2-fde-dip.dep -fexceptions -c ../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/unwind-dw2-fde-dip.c -fvisibility=hidden -DHIDE_EXPORTS
| In file included from ../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/unwind-dw2.c:401:0:
| ./md-unwind-support.h: In function 'aarch64_fallback_frame_state':
| ./md-unwind-support.h:55:21: error: field 'uc' has incomplete type
|      struct ucontext uc;
|                      ^~
| aarch64-poky-linux-gcc  -march=armv8-a --sysroot=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0=/usr/src/debug/libgcc/6.3.0-r0 -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot-native= -fdebug-prefix-map=/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/recipe-sysroot= -O2  -isystem/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/gcc-6.3.0/build.aarch64-poky-linux.aarch64-poky-linux-native/usr/include -O2 -pipe -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -I. -I. -I/tmp/yocto_builds/11494916_ldk_6.x_ns2-bcm958712-d4svk/poky/build/tmp/work/aarch64-poky-linux/libgcc/6.3.0-r0/gcc-6.3.0/build.aarch64-poky-linux.aarch64-poky-linux/aarch64-poky-linux/libgcc/../.././gcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/. -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/../gcc -I../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/../include  -DHAVE_CC_TLS  -o unwind-sjlj.o -MT unwind-sjlj.o -MD -MP -MF unwind-sjlj.dep -fexceptions -c ../../../../../../../work-shared/gcc-6.3.0-r0/gcc-6.3.0/libgcc/unwind-sjlj.c -fvisibility=hidden -DHIDE_EXPORTS
| make: *** [unwind-dw2.o] Error 1
Comment 1 Scott Branden 2017-09-14 07:07:01 UTC
This worked fine 2.4 M2, fails with latest
Comment 2 Juro Bystricky 2017-09-14 15:39:41 UTC
(In reply to comment #1)
> This worked fine 2.4 M2, fails with latest

Scott, does it still work with 2.4 M2 and not latest or it **used** to work fine with 2.4 M2 ? 
Can you please provide some additional info regarding your system: distro, gcc version, steps to reproduce, etc.
Also, to satisfy my own curiosity, why do you actually use GCCVERSION = "6.3"?
It is not the default value and it is quite conceivable gcc 6.3 support will be dropped from the release.
Comment 3 Scott Branden 2017-09-14 17:43:58 UTC
Created attachment 4009 [details]
bitbake libgcc logfile failure
Comment 4 Scott Branden 2017-09-14 17:49:46 UTC
Hi Juro,

I did some further investigation I bisected the issue.  Things are broken in 2.4_M2 as well actually.  They are fine in 2.4_M1 and earlier.

Using git bisect and rebuilding I found the commit causing the failure is:
glibc: Upgrade to 2.25.90

I am building for aarch64

To reproduce set: GCCVERSION = "6.3%"
and do:
bitbake libgcc

log.do_compile attached.


We need GCC 6.3 as some code doesn't work for 7.x compiler.  And, certain programs have been tested against certain gcc versions.  In fact, I need to revert the removal of GCC 5.4 locally for other projects as well.
Comment 5 Juro Bystricky 2017-09-14 20:27:10 UTC
(In reply to comment #4)
> Hi Juro,
> 
> I did some further investigation I bisected the issue.  Things are broken in
> 2.4_M2 as well actually.  They are fine in 2.4_M1 and earlier.
> 
> Using git bisect and rebuilding I found the commit causing the failure is:
> glibc: Upgrade to 2.25.90
> 
> I am building for aarch64
> 
> To reproduce set: GCCVERSION = "6.3%"
> and do:
> bitbake libgcc
> 
> log.do_compile attached.
> 
> 
> We need GCC 6.3 as some code doesn't work for 7.x compiler.  And, certain
> programs have been tested against certain gcc versions.  In fact, I need to
> revert the removal of GCC 5.4 locally for other projects as well.

Thanks, I can reproduce the problem easily.
I do have a patch that I am currently testing.
Comment 6 Juro Bystricky 2017-09-14 23:21:04 UTC
sent patch to the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2017-September/142352.html
Comment 7 Scott Branden 2017-09-16 18:33:51 UTC
I can confirm this fixes the build issues we are having with GCCVERSION = 6.3%