[oe] linux-libc-headers-native, gcc-cross issue

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Mon Jun 21 19:27:18 UTC 2010


2010/6/21 Tom Rini <tom_rini at mentor.com>:
> Frans Meulenbroeks wrote:
>>
>> Dear all,
>>
>> After the introduction of linux-libc-headers-native I've bumped into
>> the following issue.
>> linux-libc-headers-native installs unistd.h in sysroots
>> This causes other recipes to pick up the x86 files instead of the target
>> ones.
>> I've seen this happen for both unistd.h and sigcontext.h
>
> What DISTRO/MACHINE are you using?

DISTRO is angstrom-2008.1, MACHINE is NEEK; this one is NIOS2 based
and not committed yet.
>From examining the gcc-cross dir I suspect some other archtectures
will also be vulnerable to this (as they also have a linux-unwind.h
which includes signal.h to get sigcontext).
The following architectures have a sigcontext struct in their gcc/config dir:

gcc-cross-4.1.2-r23.1/gcc-4.1.2/gcc/config> grep -r sigcontext .
./sh/linux-unwind.h:  struct sigcontext *sc;
./sh/linux-unwind.h:      sc = (struct sigcontext *) (void *)
&rt_->uc.uc_mcontext;
./sh/linux-unwind.h:  struct sigcontext *sc;
./sh/linux-unwind.h:      sc = (struct sigcontext *) (void *)
&rt_->uc.uc_mcontext;
./alpha/linux-unwind.h:  struct sigcontext *sc;
./i386/linux-unwind.h:  struct sigcontext *sc;
./i386/linux-unwind.h:      sc = (struct sigcontext *) (void *)
&uc_->uc_mcontext;
./i386/linux-unwind.h:  struct sigcontext *sc;
./i386/linux-unwind.h:      sc = (struct sigcontext *) (void *)
&rt_->uc.uc_mcontext;
./mips/linux-unwind.h:    struct sigcontext uc_mcontext;
./mips/linux-unwind.h:  struct sigcontext *sc;
./mips/linux-unwind.h:	struct sigcontext sigctx;
./mips/linux-unwind.h:  /* On o32 Linux, the register save slots in
the sigcontext are
./ia64/linux-unwind.h:/* This works only for glibc-2.3 and later,
because sigcontext is different
./ia64/linux-unwind.h:	struct sigcontext *sc;
./ia64/linux-unwind.h:      struct sigcontext *sc = frame_->sc;
./ia64/linux-unwind.h:	 in the sigcontext but leaves them intact, so there's no
./ia64/linux-unwind.h:	struct sigcontext *sc;
./ia64/linux-unwind.h:      struct sigcontext *sc = frame->sc;
./ia64/linux-unwind.h:	 in the sigcontext but leaves them intact, so there's no
./pa/linux-unwind.h:   tell us how to locate the sigcontext structure.
./pa/linux-unwind.h:  struct sigcontext *sc;
./nios2/linux-unwind.h:	struct sigcontext ctx;

The last one (nios2) is not committed yet. i386 is probably not
vulnerable (at least not on a i386 host) and maybe the same holds for
ia64 (less sure about that).
That leaves as problematic structures: sh, alpha, mips, pa, nios2
arm does not seem to be affected.
Guess the fact that only less popular machines are affected is the
reason this did not surface earlier.

Frans.
>
> --
> Tom Rini
> Mentor Graphics Corporation
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>




More information about the Openembedded-devel mailing list