[ELDK] newbie autoconf on ELDK 4.1

Detlev Zundel dzu at denx.de
Fri May 16 17:49:45 CEST 2008


Hi Cosmo,

>   Hello.  It was very difficult to find this list, but finally I'm here!

Why was it difficult and how did you find it in the end?

>   I'm (ELDK newbie) trying to use ELDK 4.1 on my x86 laptop to target
>   a 440EPx 'Sequoia' eval kit.  I've read as much as I can find,
>   including the Wiki page '3.5 Working with ELDK' that covers
>   exporting CROSS_COMPILE and setting the PATH.  This probably works
>   exactly as advertised, but I need to first build a GNU project
>   (GLPK) before I can compile and link my own code to it.

>   The problem is that I can't figure out how to start that project's
>   (GLPK) './configure' for cross-compile in my situation.  I've been
>   trying --host=powerpc-linux-gnu, but I think perhaps I should be
>   using --target=<something here>.  If I don't pass ask configure for
>   cross-compile, all of the code successfully builds and runs native
>   x86 linux as expected.  I just can't get the cross-compile correct.

That's how it usually works.  Setup CROSS_COMPILE correctly and then a
simple "./configure --host=ppc-linux" should do the trick.  This is one
reason why the compiler can be called under this generic name.

Note that "--target" is not what you want here.  This is an option that
I only know to be useful when doing a funny compile of gcc to be
"--host"ed on another system and generating code for yet another
"--target".  Simply forget about this combination again ;)

>   Also, is there any difference in using ppc_4xxFP (which implies
>   -mcpu=405fp) and explicitly using -mcpu=440fp?  

This all boils down to gcc using either cost model:

/* Instruction costs on PPC405 processors.  */
static const
struct processor_costs ppc405_cost = {
  COSTS_N_INSNS (5),    /* mulsi */
  COSTS_N_INSNS (4),    /* mulsi_const */
  COSTS_N_INSNS (3),    /* mulsi_const9 */
  COSTS_N_INSNS (5),    /* muldi */
  COSTS_N_INSNS (35),   /* divsi */
  COSTS_N_INSNS (35),   /* divdi */
  COSTS_N_INSNS (11),   /* fp */
  COSTS_N_INSNS (11),   /* dmul */
  COSTS_N_INSNS (11),   /* sdiv */
  COSTS_N_INSNS (11),   /* ddiv */
};

/* Instruction costs on PPC440 processors.  */
static const
struct processor_costs ppc440_cost = {
  COSTS_N_INSNS (3),    /* mulsi */
  COSTS_N_INSNS (2),    /* mulsi_const */
  COSTS_N_INSNS (2),    /* mulsi_const9 */
  COSTS_N_INSNS (3),    /* muldi */
  COSTS_N_INSNS (34),   /* divsi */
  COSTS_N_INSNS (34),   /* divdi */
  COSTS_N_INSNS (5),    /* fp */
  COSTS_N_INSNS (5),    /* dmul */
  COSTS_N_INSNS (19),   /* sdiv */
  COSTS_N_INSNS (33),   /* ddiv */
};

So using the -mcpu=440fp gcc will generate slightly different code for
numerically intensive code.  I have to admit that I do not know how much
difference in actual execution speed this will give but you're free to
benchmark that of course ;)

>   Can someone suggest a link to read, or perhaps give me some pointer
>   to get me started?  

What exactly do you want to learn?

>   My EDLK install is exactly matching the instructions for the .ISO
>   image.  Once I learn how to get it to setup for cross-compile, I'm
>   off to the races!

It's really only setting CROSS_COMPILE and PATH correctly.  If you have
done this, you're all setup.

Cheers
  Detlev

-- 
0x2B | ~0x2B
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the eldk mailing list