If I build from this configuration: Build Configuration: BB_VERSION = "1.15.2" TARGET_ARCH = "powerpc" TARGET_OS = "linux" MACHINE = "qemuppc" DISTRO = "poky" DISTRO_VERSION = "1.2+snapshot-20120515" TUNE_FEATURES = "m32 fpu-hard ppc603e" TARGET_FPU = "" meta meta-yocto = "master:12b4543ac9f54c0db0ee4a7ee546a71946a051f8" build 'core-image-sato' Using the default GCC 4.7.x, the X server fails with this error: Fatal server error: no screens found Rebuild (the whole thing!) using GCC 4.6.x by specifying GCCVERSION = "4.6%" and no other changes. With this configuration, X works fine. I've duplicated this on both qemuppc and my own PowerPC machines. I've not net delved into the why...
The problem boils down to code that looks like this: void *ptr; switch(XX) { case a: define_some_structure A; ptr = &A; break; case b: define_some_structure B; ptr = &B; break; } call_some_function(ptr); The data in the structure (either A or B) is being destroyed or lost somewhere in this process, hence the function may fail. IMO, this is should not be legal (if it even is, I'm not a C spec expert), even if it has been around and working for 25 years :-( The attached patch fixes this bug and the X server runs again. That said, who knows how many other such dragons are left to be discovered.
Created attachment 513 [details] Fix incorrect stack variable usage
(In reply to comment #2) > Created attachment 513 [details] > Fix incorrect stack variable usage this patch is OK FWIW I think gcc 4.7 kills the locals once it goes out of scope i.e. switch {} I wonder if you get warnings about it from gcc
There are no warnings about this in the build log. Per discussion with Martin Jansa, I've proposed (oe-core list) to bring in an upstream fix from 2010-08-10 (which tells you how stale this recipe is...) http://cgit.freedesktop.org/xorg/xserver/patch/Xext/xace.c?id=6dae7f3792611aace1df0cca63bf50c50d93de43
Merged in master. commit 6d40b658f42837f4270f1dd3c0f350eb84b369f0 Author: Gary Thomas <gary@mlbassoc.com> Date: Fri May 18 17:18:18 2012 +0300
Verified