ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Ltib] Calling Native toolchain as well as target toolchaininmakefil


From: Marc Titinger
Subject: RE: [Ltib] Calling Native toolchain as well as target toolchaininmakefile.
Date: Tue, 4 Sep 2007 10:54:44 +0200

Hi Stuart,

first, thanks a lot for your quick reply.

the original makefiles in libgpg-error do call $(CC_FOR_BUILD) for compiling the native tool, so at first, I tried to set CC_FOR_BUILD in the spec file as you recommended.

here is a snippet from the Makefile :

---------------------------------------------------------------
# It is correct to use $(CC_FOR_BUILD) here.  We want to run the
# program at build time.
mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
        $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c

code-from-errno.h: mkerrcodes Makefile
        ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
-------------------------------------------------------------------


Here is my spec file (copied/modified from libglade) :

------------------------------------------------------------------
%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : The libglade library for loading user interfaces
Name            : libgpg-error
Version         : 1.5
Release         : 1
Vendor          : Freescale
Packager        : Stuart Hughes
Group           : System Environment/Libraries
Source          : %{name}-%{version}.tar.bz2
License         : LGPL
BuildRoot       : %{_tmppath}/%{name}

%Description
%{summary}

%Prep
%setup

%Build
CC_FOR_BUILD="$BUILDCC"
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} 
make

%Install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}

%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%{pfx}/*
------------------------------------------------------------

Another thing makes me believe that I have some spoofing issue :

when I use a "mkerrcodes" pre-compiled for intel in the makefile, then "./ltib -p libgpg-error" completes, and the lib is properly installed in rootfs/usr/lib, and is an ARM binary. no problem so far.

But, when I compile a subsequent package (libgcrypt) that needs it, the spoofing seems not to work completely :

gcc -shared  .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-module.o .libs/libgcrypt_la-ath.o -Wl,--whole-archive ../cipher/.libs/libcipher.a ../mpi/.libs/libmpi.a -Wl,--no-whole-archive  /usr/lib/libgpg-error.so -lnsl  -Wl,--version-script=./libgcrypt.vers -Wl,-soname -Wl,libgcrypt.so.11 -o .libs/libgcrypt.so.11.2.3
/usr/lib/libgpg-error.so: could not read symbols: File in wrong format


all the compiled .o files are ARM but /usr/lib resolves to the native path, not the rootfs path I think.

How can I check where the standard include and lib path actually go during build time ?

Regards,

Marc.









-----Original Message-----
From:   Stuart Hughes [mailto:address@hidden]
Sent:   Tue 9/4/2007 9:36 AM
To:     Marc Titinger
Cc:     address@hidden
Subject:        Re: [Ltib] Calling Native toolchain as well as target toolchaininmakefile.

Hi Mark,

Using $BUILDCC is the right way to call up the host based compiler.
However you'll need to look at the Makefiles for libgpg-error to see if
it is cross compiler aware (e.g. has some provision for building some
parts with one compiler and some another).  If it has, then use whatever
it requires, often this is CC_FOR_BUILD="$BUILDCC" (note the quote but
sometimes it's HOSTCC="$BUILDCC", it depends on the package.  If the
package is not cross compiler aware then you'll need to make a patch so
that it is.

One thing, normally Makefile.am should not need to be worried about as
this only gets processed when you run 'automake' ?

Have you got a spec file you can send me for this package?  If you can't
get it working easily let me know, maybe I can take a look.

Regards, Stuart


On Mon, 2007-09-03 at 18:32 +0200, Marc Titinger wrote:
> Hello,
>
> I'm trying to add the libgpg-error package to an iMX31 ltib distro
> (based on the last Freescale ADS iso), and I need to call the host
> (i586) gcc instead of the spoofed cross compiler at some point in the
> Makefile.am.
>
> I've read some tips from thread so I tried :
>
> - setting CC_FOR_BUILD=$BUILDCC in the spec file : didn't work, the
> binary was still compiled for the target instead of being intel code.
>
> - localy unspoofing the path : did'nt work either, so I'm missing
> something, please help !
>
>
> #--------export PATH=$(UNSPOOF_PATH)-----------
> export
> PATH=/home/mtr/ltib-imx31ads-20070511/bin:/opt/freescale/ltib/usr/bin:/opt/freescale/usr/local/gcc-4.1.1-glibc-2.4-nptl-6/arm-none-linux-gnueabi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin
>
> cc -I. -I. -o mkerrcodes ./mkerrcodes.c <--- still generates ARM
> binary.
>
> #--------export PATH=$(SPOOF_PATH)----
> export
> PATH=/opt/freescale/ltib/usr/spoof:/home/mtr/ltib-imx31ads-20070511/bin:/opt/freescale/ltib/usr/bin:/opt/freescale/usr/local/gcc-4.1.1-glibc-2.4-nptl-6/arm-none-linux-gnueabi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin
>
>
> _______________________________________________
> LTIB home page: http://bitshrine.org
>
> Ltib mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/ltib





reply via email to

[Prev in Thread] Current Thread [Next in Thread]