ltib
[Top][All Lists]
Advanced

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

[Ltib] RE: GLIBC 2.5


From: Morrison, Tom
Subject: [Ltib] RE: GLIBC 2.5
Date: Wed, 4 Mar 2009 17:42:25 -0500

I should note that the spec file defined a way to get all the proper ‘stuff’ and rebuild – I did all of this – and it still failed!

 

That is why I tried the ‘base’ ./ltib –m prep… approach

 


From: Morrison, Tom
Sent: Wednesday, March 04, 2009 5:29 PM
To: address@hidden
Subject: GLIBC 2.5

 

I am using an LTIB package from Freescale for the MPC8572 (dated 121208)…

 

It seems that the subject line package of this BSP is a pre-built RPM (it doesn’t go through

the a full build when using generic <./ltib> build process. It looks like this full library gets

untars a pre-built one into the as a uses a pre-built rpm GLIBC (and an associated native

GCC compiler (whose source is available luckily)…

 

The problem with this pre-built one is that it was NOT built correctly for the E500 and/or

with a compiler that supports SPE (correctly)…

 

I determined this by noticing that when executing startup scripts (executing out of new rootfs),

I am getting multiple math emulation exceptions (when traced close to – it looks like it is

coming from GLIBC type functions).  I determine that this is case with both the New Linux

Kernel associated with this NEW LTIB Package, and my older (more stable) Linux Kernel

which has been thoroughly QA’d..

 

OK, I can deal with most of those exceptions – but unfortunately, there is something I

am trying to execute that is NOT handled correctly with my OLDER / more stable

Linux kernel…and thus causes an ILLEGAL instruction (and thus, my NEW user program

is NOT working)…

 

OK – well, maybe somebody who built this LTIB image took a lazy approach – so I decide I

want to try to build the GLIBC again (and make sure it has all the proper configuration switches

to NOT cause this problem)…

 

So, I try ./ltib –m prep –p glibc

 

>> Try glibc-2.5.tar.bz2.md5 from the GPP

>> 18:49:52 URL:http://www.bitshrine.org/gpp/glibc-2.5.tar.bz2.md5 [51/51] -> "glibc-2.5.tar.bz2.md5" [1]

>> Try glibc-2.5.tar.bz2 from the GPP

 

And it fails utterly…

 

I REALLY want to use this OLD/Stable kernel (with the new LTIB rootfs (because I can run Java with this version))…

 

a)   Have I made the proper analysis of this pre-built LTIB image not being built correctly (I KNOW that this is

the source of my math exceptions – 99.5% sure

b)   How do I get a new version

c)   Will this fix my problem?

 

Here is the spec file that came with the NEW LTIB image…

 

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

%define cs_version 4.2-187

 

Summary         : GNU standard C library with NPTL thread library.

Name            : glibc

Version         : 2.5

Release         : 1

License         : LGPL

Vendor          : Freescale

Packager        : Stuart Hughes & Steve Papacharalambous

Group           : System Environment/Libraries

Source0         : %{name}-%{version}.tar.bz2

Source1         : %{name}-ports-%{version}.tar.bz2

Source2         : %{name}-libidn-%{version}.tar.bz2

Patch0          : %{name}-%{cs_version}-from-fsf-2_5.diff.gz

Patch1          : %{name}_ports-%{cs_version}-from-fsf-2_5.diff.gz

BuildRoot       : %{_tmppath}/%{name}

Prefix          : %{pfx}

 

%Description

%{summary}

 

This glibc package is built using glibc-2.5 and glibc-ports-2.5 plus the

following patches from the CodeSourcery %{cs_version} release:

 

- glibc-4.2-187-from-fsf-2_5.diff

- glibc_ports-4.2-187-from-fsf-2_5.diff

 

The glibc and glibc-ports tarballs can be obtained from any of the GNU ftp

sites or their mirrors.

The CodeSourcery patch can be obtained by downloading the source rpm:

freescale-powerpc-linux-gnu-%{cs_version}.src.rpm from:

http://www.codesourcery.com/gnu_toolchains/power/download.html and then

extracting the glibc and glibc-ports patchs from this source rpm.

 

 

%Prep

%setup

%patch0 -p1

tar jxvf %{SOURCE1}

cd glibc-ports-%{version}

%patch1 -p1

cd ..

ln -s glibc-ports-%{version} ports

tar jxvf %{SOURCE2}

ln -s glibc-libidn-%{version} libidn

 

 

%Build

# Temporary hack - stevep

# For building toolchain components an optimized version of the

# target is needed.  This should really be defined in the config

# area of ltib, and not done in the toolchain spec files.

# For now we assume that the optimised target can be derived by

# stripping the trailing "-" off the toolchain prefix, but this

# will not be true for all cases, eg when using uClibc toolchains.

OPT_CFGHOST=`echo ${TOOLCHAIN_PREFIX} | perl -n -e 's,-$,,;print'`

 

# Use the toolchain headers as the default for the glibc build.

# TODO: Add a configuration option to allow selection of the BSP kernel

# headers for the build - stevep

TC_HEADERS_DIR="`dirname \`${TOOLCHAIN_PREFIX}gcc ${TOOLCHAIN_CFLAGS} -print-file-name=libc.so\` | perl -p -e 's,/lib$,,'`/include"

 

rm -rf build-glibc

mkdir build-glibc

cd build-glibc

echo "libc_cv_forced_unwind=yes" > config.cache

echo "libc_cv_c_cleanup=yes" >> config.cache

BUILD_CC="${BUILDCC}" \

CFLAGS="-O" \

../configure \

  --prefix=/usr \

  --build=%{_build} \

  --host=${OPT_CFGHOST} \

  --disable-profile \

  --without-gd \

  --without-cvs \

  --cache-file=config.cache \

  --enable-kernel=2.6.10 \

  --with-headers=${TC_HEADERS_DIR} \

  --enable-add->

make

 

%Install

cd build-glibc

make install install_root=${RPM_BUILD_ROOT}/%{pfx}

 

# remove absolute paths from text search files (if they exist)

perl -w -e '

    @ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV;

    exit(0) unless @ARGV;

    $^I = ".bak";

    while(<>) {

        s,[\S/]+/,,g if m,^GROUP,;

        print;

    }

    ' ${RPM_BUILD_ROOT}/%{pfx}/lib/libc.so \

      ${RPM_BUILD_ROOT}/%{pfx}/lib/libpthread.so \

      ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/lib/libc.so \

      ${RPM_BUILD_ROOT}/%{pfx}/%{_prefix}/lib/libpthread.so

 

# Remove libtool .la files.

find $RPM_BUILD_ROOT/%{pfx} -name \*.la -exec rm {} \;

 

 

%Clean

rm -rf ${RPM_BUILD_ROOT}

 

 

%Files

%defattr(-,root,root)

%{pfx}/*

 

Tom Morrison
Principal Software Engineer

EMPIRIX
20 Crosby Drive
- Bedford, MA  01730
p: 781.266.3567 f: 781.266.3670
email: address@hidden
www.empirix.com


 


reply via email to

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