You are not logged in.

#1 2005-03-31 20:29:20

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

uclibc and gcc

im trying to build an Arch uclibc based system, and i already have a root system built using the buildroot tool from uclibc. ive started making the base packages and most compiles fine, but im having problems with recompiling the gcc package under the uclibc system (error: "stage1/libgcc_s.so: undefined reference to `dl_iterate_phdr'").
ive looked in the buildroot toolchain and saw it uses several patches for gcc (3.4.3) and tried to apply them - most apply fine but some dont, and im still getting the same error. does anyone has any experience with repackaging gcc package under uclibc?

tnx.

Offline

#2 2005-04-01 11:41:31

mattux
Member
Registered: 2004-04-22
Posts: 81

Re: uclibc and gcc

i have tried the same with my crux system (a half year ago) and i dont get it work  it seems that gcc 3.4 has many problems with uclibc , but you can try ->-> http://buildroot.uclibc.org/ <-< who knows maybe the uclibc´s guys know how to make it work....

mattux

Offline

#3 2005-04-01 14:26:06

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: uclibc and gcc

tnx, buildroot is what i used to build the initial uclibc system - now im trying to make it the "Arch" way - ie, PKGBUILDS. i tried following LFS method and obviously it works, but since the rules dont apply to PKGBUILDs im looking for someone who made uclibc-based-packages already... i've read some posts from users having a uclibc based system, i hope some made PKGBUILDs too...

ive emailed the buildroot maintainer asking for the gcc 3.4.3 patches prerequisites, so i hope to get some info there.

Offline

#4 2005-04-01 16:56:06

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: uclibc and gcc

I've built a uclibc based mini-Arch using the LFS bootstrap method.  I ran into the dl_blahblah problem and I think the trick was to build gcc with --disable-shared.  This does not create a static gcc just static libraries.  Also I didn't build C++ so this may not work for you.

# $Id: PKGBUILD,v 1.4 2005/03/20 07:41:05 root Exp $
# Maintainer: judd <jvinet@zeroflux.org>
pkg=gcc
pkgname=gcc.uc
pkgver=3.4.3
pkgrel=2
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
groups=('devel')
depends=('binutils.uc')
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/$pkg-{core,g++,testsuite}-$pkgver.tar.bz2 
        gcc-3.4.1-VisibilityPatch2.diff)

build() {
  # now build the new (current) version
  cd $startdir/src/gcc-$pkgver

  # Do NOT run fixincludes
  sed -ie "@./fixinc.sh@ d" gcc/Makefile.in

  # Adjust config entries from which spec file will be generated
  for i in `find gcc/config -name "*.h"`
  do
    sed -r -e 's /lib(64)?/ld(64)?(-linux)?(-x86-)?(-ia)?(64)?.so.[12] /lib/ld-uClibc.so.0 ' -i "$i"
    if [ $? -ne 0 ]; then exit 1; fi
  done

  patch -Np1 -i $startdir/src/gcc-3.4.1-VisibilityPatch2.diff || return 1
  mkdir ../gcc-build
  cd ../gcc-build
  ../gcc-$pkgver/configure --prefix=/usr --disable-shared 
     --enable-languages=c --enable-threads=posix --enable-__cxa_atexit 
     --disable-nls i386-pc-linux-gnu
  make bootstrap || return 1
  make DESTDIR=$startdir/pkg install || return 1
  rm -rf $startdir/pkg/usr/bin/c++filt $startdir/pkg/usr/lib/libiberty.a
  mkdir -p $startdir/pkg/lib
  (cd $startdir/pkg/lib; ln -s ../usr/bin/cpp)
  (cd $startdir/pkg/usr/bin; ln -sf gcc cc)

  # UCLIBC: not building C++
  #(cd $startdir/pkg/usr/bin; ln -sf gcc cc; ln -sf g++ c++)
  # get rid of the references to my build dir
  #sed -i "s|-L$startdir/src[^ ]* ||g" $startdir/pkg/usr/lib/{libstdc++.la,libsupc++.la}
  #chmod 644 $startdir/pkg/usr/lib/*.la
}
md5sums=('d2cbfe8fc3205c1d7969b26377405778' '26cb84db92feb8e03bb7bf3bc264844f'
         'b4fff6ce0a038021b9e507917abb9a07' 'd2b2e7d8e2eb265ce445e4e916d83708')

I currently have 47 packages, all console based cause I didn't bother with X.  Unfortunately I don't have the webspace to host the packages.

Good luck.

Offline

#5 2005-04-02 03:59:17

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: uclibc and gcc

k, tnx for that, this package gave me another error.
the author emailed be back specifying which patches should be applied but this gave same error as your package did. so that got me thinking, so i traced the problem down to missing include uclibc files under /usr/include/bits... i will email the author once i'll have my email working again :S

tnx again.

Offline

#6 2005-04-03 02:25:07

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: uclibc and gcc

Interesting.  Are you cross-compiling or native?  My build works within a native uclibc system.

Offline

#7 2005-04-03 04:56:46

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: uclibc and gcc

native. also, please check your pm wink

Offline

Board footer

Powered by FluxBB