On 12/3/16, Barry Kauler <[email protected]> wrote:
> On 12/3/16, Barry Kauler <[email protected]> wrote:
>> Yeah, supporting T2 has been a one-man-show mostly, for many years,
>> with just a bit of input from others sometimes. I appreciate that Rene
>> is keeping T2 alive.
>>
>> Regarding the problem of what appears to be a broken dietlibc in my
>> Quirky Linux, and also causes dietlibc to fail in Stage-0 in T2,I have
>> posted to a thread in the Puppy Linux forum:
>>
>> http://murga-linux.com/puppy/viewtopic.php?p=934447#934447
>>
>> In that thread, I have used the "-v" verbose option of the 'diet'
>> executable, to show that gcc seems to be ignoring the injunction to
>> find the dietlibc sys/types.h, instead finding the system sys/types.h
>>
>> Right now, it's a showstopper for me and T2.
>>
>
> I have a solution. I posted a fix to be able to compile dietlibc in my
> host system, to the above Puppy Forum link. Quoting:
>
> ------------------------
> Fixed it!
>
> Have to export these environment variables, so gcc knows where the
> system headers are, so that "-nostdinc" knows what to ignore!
>
> I thought that gcc would already know that, given that it is compiled
> by ubuntu as multilib.
>
> Code:
> # export C_INCLUDE_PATH=/usr/include/arm-linux-gnueabihf
> # export CPLUS_INCLUDE_PATH=/usr/include/arm-linux-gnueabihf
> #
> # /usr/lib/arm-linux-gnueabihf/diet/bin/diet -v gcc -nostdinc
> helloworld.c -o helloworld
> gcc -nostdlib -static -L/usr/lib/arm-linux-gnueabihf/diet/lib-arm
> -L/usr/lib/diet/lib /usr/lib/arm-linux-gnueabihf/diet/lib-arm/start.o
> -nostdinc helloworld.c -o helloworld -isystem
> /usr/lib/arm-linux-gnueabihf/diet/include -D__dietlibc__
> /usr/lib/arm-linux-gnueabihf/diet/lib-arm/libc.a -lgcc
> /usr/lib/arm-linux-gnueabihf/diet/lib-arm/libc.a
> helloworld.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
> main()
> ^
> /usr/lib/arm-linux-gnueabihf/diet/lib-arm/libc.a(vprintf.o): In
> function `vprintf':
> (.text+0x2c): warning: warning: the printf functions add several
> kilobytes of bloat.
> #
> ------------------------
>
> Now back onto T2. Compiling dietlibc, Stage-1, gcc is looking at those
> same headers in the host system. So, it looks like I need to export
> those same environment variables in dietlibc.conf.
> I'm not sure how to do that though.
>
Success, I have now compiled dietlibc in T2.
I did a quick hack in dietlibc.conf, just inserted two lines:
dietlibc_initial_fixup() {
sed -i /WANT_SYSENTER/d dietfeatures.h
sed -i "s,(CROSS)strip,(STRIP),g" Makefile
sed -i "s,(CROSS)ar,(AR),g" Makefile
sed -i "s,(CROSS)ld,(LD),g" Makefile
case "$arch_machine" in
powerpc) ln -vs bin-ppc bin-powerpc ;;
powerpc64) ln -vs bin-ppc64 bin-powerpc64 ;;
esac
export C_INCLUDE_PATH=/usr/include/arm-linux-gnueabihf
export CPLUS_INCLUDE_PATH=/usr/include/arm-linux-gnueabihf
if atstage cross || [ "$toolsdir" == tools.cross ] ; then
mkdir -p bin-$cpu bin-native
ln -s bin-$cpu "bin-${CC%%-*}"
fi
}
But that is not a generic solution. Rene or someone, could you kindly
advise how to put those two lines in, in a better way? The multilib
path is going to be different on some hosts, for example on an x86_64
system: /usr/include/x86_64-linux-gnu
Ha ha, now it has stopped at building m4.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[email protected] with a subject of: unsubscribe t2