[Xorp-users] Report: XORP-CT cross-compilation with PPC

Ben Greear greearb at candelatech.com
Fri Jul 16 07:45:55 PDT 2010


On 07/16/2010 05:33 AM, Juarez Paulino wrote:
> I think my previous mail didn't get into the list because I have used
> some formatting.
>
> So here comes a copy... I hope it can helps someone.

Thanks for the detailed email!

If it's not too much trouble, can you send the changes as a diff?

git diff > /tmp/foo.patch

If the list won't take it, send directly to me.


I think some of these can be rolled in as is, and I can add some
compile-time args to deal with things like endian-ness checks.

I have a few more comments inline below:

>  > Our buildroot toolchain already had all of them.
>  >
>  >
>  > 2) Merging cross-compilation environment on SConstruct:
>  >
>  > We couldn't get SCons to work with previous export/guest/build
> options like:
>  >
>  > $ export
> CC=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-gcc \
>  > export
> CXX=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-g++ \
>  > export
> RANLIB=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-ranlib \
>  > scons \
>  > # :( dont work yet...
>  >
>  > or:
>  >
>  > $ export
> CC=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-gcc \
>  > export
> CXX=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-g++ \
>  > export
> RANLIB=/opt/ppc83xx-linux-uclibc/usr/bin/powerpc-83xx-linux-uclibc-ranlib \
>  > scons build=i686-pc-linux-gnu host=powerpc-83xx-linux-uclibc
>  > # :P dont work either...

I used syntax like this when cross-compiling to ARM.  Could you try this
and see if it works?  If not, plz send me the output of the failed
attempt.  Replace my paths with your tools, and change build=
accordingly.

   scons build=arm-unknown-linux-gnu \
     STRIP=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-sstrip \
     CC=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
     CXX=${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++ \
     CFLAGS=-I${HOME}/x-tools/arm-unknown-linux-gnueabi/local/include \
     CXXFLAGS=-I${HOME}/x-tools/arm-unknown-linux-gnueabi/local/include \
     LINKFLAGS=-L${HOME}/x-tools/arm-unknown-linux-gnueabi/local/lib


>  > 3) Eliminating Endianess problem
>  >
>  > After some terrible hours of debugging, we managed to cross-compile
> XORP-CT and not to get the endianess problem on FEA sockets. Our PowerPC
> machine uses BIG_ENDIAN, but our host cross-compilation machine uses
> LITTLE_ENDIAN, so endianess-check get wrong parameters when looking for it.
>  >
>  > Maybe there is some better ways, but we find it easy to "brute
> define" things by hand to get xorp_config.h correctly identify endianess.

I'll look into this check when I get some time.  If it could use the
(cross)-compiler to do the checks, it should be able to work properly regardless
of cross-compiling or not.

> ==============================================================================
>  >
>  >
>  > - With these modifications, we got XORP-CT top-of-tree Ben version to
> cross-compile and works fine with PIM module on PPC machine.
>  >
>  > - We've tested XORP-CT restricted space versions (only with PIM
> module and necessary) and it seems to work fine too on our SSM environment.
>  >
>  > - Our last stripped working version got around ~9.6MB space:
>  >
>  > sudo scons -j4 disable_ipv6=yes disable_fw=yes
> disable_warninglogs=yes disable_tracelogs=yes disable_fatallogs=yes
> disable_infologs=yes disable_assertlogs=yes disable_errorlogs=yes
> enable_olsr=no enable_bgp=no enable_vrrp=no enable_policy=no
> enable_rip=no optimize=size enable_fea_dummy=no enable_xorpsh=no
> disable_profile=yes
>  >
>  > * We had to enable and configure OSPF module too, as xorp can
> recognize (i think it inverts) the system metrics...

Can you give me some details on the OSPF issue?  I don't understand
what you wrote above.

>  > Our next work and probably most difficult is to reduce more our XORP
> version.
>  >
>  > So do you have any tips beyond Ben PATCHES (on getting out modules,
> xorpsh and IPv6 code) from where we could begin?

What is your goal for size?

There is probably some more ipv6 code that can be eliminated from
the core libraries and such.  If you go this route, please do
it in smaller chunks if possible and send me patches for each chunk.

There may be tools that can help determine what is taking up
the space in files (code, data, etc)..that might help narrow down
things to look for.

There is also some 'dead' code in xorp still.  In particular, I
have been meaning to remove the 'batch' logic from the libxipc
logic.  It's not used by any code.  Not sure if it will save
much space though.


Thanks,
Ben


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list