My host platform can be either cygwin or Linux x86 and my target is an
embedded system based on "Alchemy" Mips32 little Endian running a HardHat
linux 2.0 based system.   The toolchains are setup and functional.  The
mips_fp_el kernel is up.  I am trying to understand how i can cross compile
to this target the XFree 4.2.1 release.  The current mips.cf comments and
code indicate it to only work for BSD, is this true?   There are references
to Linux/mips in the change log and some .cf file. Has anyone to your
knowledge done this sort of cross compile successfully and if so, are there
any examples of the changes?

There are many mailing list references to XFree cross compiling but no
complete examples which I can base my modifications off of.  The closest is
http://handhelds.org/minihowto/building-x.html.  I'd hoped to download
http://www.x86-64.org/Downloads/XFree86.src.tar.bz2 as an example but it
doesn't seem to be available any more.

My specific questions are:

1) all the net references talk about a command line like:

    make World CROSSCOMPILEDIR="TargetCompilerBinDir"

    Well, i can't find CROSSCOMPILEDIR anywhere in the 4.2.1 xc source tree. 
    What am i missing?

2) Is the "New Cross Compile Method" as described in cc-imake.pdf regarding
the x86-64 project in the source tree?  I couldn't find it in the base 4.2.1
tree but it seems to be present in the latest config/cf files at least. 
Right? I'm pulling it down the tree now but it will probably take most of
the night.

3) How does one specify the "target architecture"?  Is it done in the
host.def or in cross.def?  Guido's info below is said to go into host.def.

4) where is the best place to specify my target specific gcc flags 
(i.e. -fno-pic -mno-abicalls -mips2 -G 0 -O2 -EL -DEL -Wa,-G0,-non_shared)?

Thanks for your time
Tibor


I'd offline received this information from Guido Guenther.
------------------------------
I've not crosscompiled for a long time since I'm usually working on
driver modules only, which is easier to do natilvely however I used:

#define StandardIncludes -i//crossdev/mips-linux/include
#define HasZlib NO
#define MipsArchitecture
#define __mips
#undef i386Architecture
#define OSName Linux 2.4.3 mips [ELF]
#define OSMajorVersion 2
#define OSMinorVersion 4
#define OSTeenyVersion 3
#define LinuxCLibMajorVersion 6
#define LinuxCLibMinorVersion 2
#define LinuxCLibTeenyVersion 2
#define LinuxBinUtilsMajorVersion 211
#define CcCmd mips-linux-gcc -g
#define AsCmd mips-linux-gcc -c -x assembler-with-cpp -g
#define LdCmd mips-linux-ld -g
#define ArCmdBase mips-linux-ar
#define RanlibCmd mips-linux-ranlib
#define CrossCompiling YES
#define ComplexHostProgramTarget(program)                               @@\
              CC=cc                                                     @@\
    STD_INCLUDES=                                                       @@\
          CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS)         @@\
EXTRA_LOAD_FLAGS=                                                       @@\
        PROGRAM = program                                               @@\
                                                                        @@\
AllTarget(program)                                                      @@\
                                                                        @@\
program: $(OBJS) $(DEPLIBS)                                             @@\
        RemoveTargetProgram($@)                                         @@\
        HostLinkRule($@,$(_NOOP_),$(OBJS),$(DEPLIBS) $(LOCAL_LIBRARIES)) @@\
                                                                        @@\
DependTarget()                                                          @@\
                                                                        @@\
LintTarget()                                                            @@\
                                                                        @@\
clean::                                                                 @@\
        RemoveFile(ProgramTargetName(program))

#define SimpleHostProgramTarget(program)                                @@\
           OBJS = program.o                                             @@\
           SRCS = program.c                                             @@\
                                                                        @@\
ComplexHostProgramTarget(program)

#define HostLinkRule(target, flags, src, libs)  gcc -o target flags src libs
$(EXTRA_LOAD_FLAGS)

in config/cf/hosts.def. This worked very well for me but I read on a
mailing list that the following in config/cf/hosts.def:

#define CrossCompiling             YES

and then calling make like:
cd xc; make World CROSSCOMPILEDIR=/skiff/local/bin
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to