[ELDK] pcap library and tcpdump in ELDK

Dave Rensberger David.Rensberger at ambientcorp.com
Mon Oct 20 21:17:14 CEST 2008


Yes, you're right, I missed that small but important detail.  I just
assumed that "usr/ppc-linux/bin" was part of the PATH manipulation that
"eldk_init" does (as an aside, though, is there any reason that
eldk_init shouldn't be modified to do this for you?).

Even after getting the path right, I still have problems rebuilding the
pcap SRPM.   It seems that the configure script still tries to do the
"build a test program and run it" test, which should only work if you're
not cross-compiling (see output below).

--Dave

+ ./configure --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu
--target=ppc-denx-linux --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --enable-ipv6
checking build system type... i386-pc-linux-gnu
checking host system type... i386-pc-linux-gnu
checking target system type... powerpc-denx-linux-gnu
checking for i386-pc-linux-gnu-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C
compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
error: Bad exit status from
/home/drensberger/abtg_X3000_daveR/denxbuild/output/default_ppc_4xx.list
_install/var/tmp/rpm-tmp.91371 (%build)


-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de] 
Sent: Monday, October 20, 2008 2:54 PM
To: Dave Rensberger
Cc: stefano babic; eldk at lists.denx.de
Subject: Re: [ELDK] pcap library and tcpdump in ELDK

Dear "Dave Rensberger",

In message
<B7BC4CB64CA090478F283BA589292737577C18 at abtg-mail.ambientcorp.com> you
wrote:
> Are the instructions on
> http://www.denx.de/wiki/view/DULG/ELDKRebuildingComponents
> still valid?

Yes, it is.

> Whenever I do this, the rpmbuild succeeds in producing binary rpms in
> the ppc/ directory, but if I inspect the resultant libraries with
> readelf, it says that they're actually x86 binaries.   During the
build
> process, it appears that my system compiler, rather than the
> cross-compiler is being called.

Then you probably did not read the second bullet item below:

        The <ELDK_root>/usr/ppc-linux/bin directory must be in PATH
        before the /usr/bin directory. This is to make sure that the
        command gcc results in the fact that the ELDK cross compiler
        is invoked, rather than the host gcc.

> I also get a weird error when installing the binary RPM:
> 
> My-host> ${CROSS_COMPILE}rpm -i
> usr/src/denx/RPMS/ppc/libpcap-ppc_4xx-0.9.8-2.ppc.rpm 
> /sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~:
> Permission denied
> error: %post(libpcap-ppc_4xx-0.9.8-2.ppc) scriptlet failed, exit
status
> 1

Assuming your RPM was build correctly (i. e. it is indeed referencing
the /opt/eldk/ppc_4xx/etc/ld.so.cache file, not your host system's
/etc/ld.so.cache), then the directory permissions in your target root
file system prevent you from doing this.

But given the error message above I speculate that you might in  fact
attempt  to overwrite your host system's /etc/ld.so.cache file, which
would be not a good thing to do.

> It seems like something isn't fully aware of the cross-compilation
> environment.   I have the "CROSS_COMPILE" variable set and the
directory
> containing the denx toolchain is first in my path (did this via the
> eldk_init script).  Do I need to additionally set "CC" or something (I

This is NOT enough.

> tried this once, and it made some other problems).

Please see the last bullet in "3.7.2. Rebuilding Target Packages",
http://www.denx.de/wiki/view/DULG/ELDKRebuildingComponents#Section_3.7.2
.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Ja, mach' nur einen Plan,    sei nur ein grosses Licht
und mach' dann noch 'nen zweiten Plan,    geh'n tun sie beide nicht."
                                     -- Bert Brecht, Dreigroschenoper


More information about the eldk mailing list