LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-08-2014, 11:11 AM   #31
hendrickxm
Member
 
Registered: Feb 2014
Posts: 62

Rep: Reputation: Disabled

Excellent. Could you check the slackbuild you used for binutils, it keeps failing here. I added a sed command and removed all patches, that way the package builds but the part after the oprofile output gives errors, so I am able to get a package but did not try to install.
 
Old 04-08-2014, 11:16 AM   #32
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 248

Original Poster
Rep: Reputation: Disabled
Code:
#!/bin/sh

# Copyright 2005-2012  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Modified 2011 by Eric Hameleers <alien at slackware.com> for ARM port.


PKGNAM=binutils
VERSION=${VERSION:-2.24}
BUILD=${BUILD:-1}

# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
  case "$MARCH" in
    i?86)    export ARCH=i486 ;;
    armv7hl) export ARCH=$MARCH ;;
    arm*)    export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
    *)       export ARCH=$MARCH ;;
  esac
fi

NUMJOBS=${NUMJOBS:-" -j9 "}

# Uncomment this to include the experimental gold linker:

# Set to ld.gold or ld.bfd:
DEFAULT_LD=ld.gold

# The --enable-initfini-array option was added in binutils-2.21.51.0.3.
# This option currently causes a world of hurt trying to compile glibc,
# and might break static libraries or cause other ill effects.  There
# is an upstream patch for glibc but it does not avoid all of the known
# problems (and there may be some unknown ones, too), so we will avoid
# introducing this feature for now.
# References:
# http://sourceware.org/bugzilla/show_bug.cgi?id=12343
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770


if [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS=""
  LIBDIRSUFFIX="64"
else
  LIBDIRSUFFIX=""
fi


case "$ARCH" in
    arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
    *)    TARGET=$ARCH-slackware-linux ;;
esac

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-binutils

rm -rf $PKG
mkdir -p $TMP $PKG

cd $TMP
rm -rf binutils-$VERSION
tar xvf $CWD/binutils-$VERSION.tar.gz || \
  tar xvf $CWD/binutils-$VERSION.tar.bz2 || exit 1
cd binutils-$VERSION
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure


chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

# End of preparations
if echo "$*" | grep -qw -- --prep ; then
  exit 0
fi
# Build for an x86 glibc2-based Linux system:
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --mandir=/usr/man \
  --infodir=/usr/info \
  --with-docdir=/usr/doc/binutils-$VERSION \
  --enable-ld=default \
  --enable-gold \
  --enable-plugins \
  --enable-threads \
  --with-pic \
  --enable-shared \
  --disable-nls \
  --disable-werror \
  --disable-multilib \
  --build=$TARGET \
  || exit 1

make clean || exit 1
make LDFLAGS="" $NUMJOBS || make LDFLAGS="" || exit 1
make install DESTDIR=$PKG || exit 1

# "make install" skips this, but binutils.spec doesn't.  Sneaky, huh?
cp -a include/libiberty.h $PKG/usr/include/libiberty.h

# Differentiate between BSD strings and GNU strings
( cd $PKG/usr/bin ; mv strings strings-GNU )
( cd $PKG/usr/man/man1 ; mv strings.1 strings-GNU.1 )

# Move ldscripts to /usr/lib${LIBDIRSUFFIX}, and then put symlinks in place
mv $PKG/usr/${TARGET}/lib/ldscripts $PKG/usr/lib${LIBDIRSUFFIX}
( cd $PKG/usr/${TARGET}
  ln -s /usr/lib${LIBDIRSUFFIX}/ldscripts lib/ldscripts
  for FILE in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip ; do
    if [ -r "/usr/bin/$FILE" ]; then
      rm -f bin/$FILE
      ln -s /usr/bin/$FILE bin/$FILE
    fi
  done
)

# If the requested default linker is present, make it the default:
# Set the link differently on the system to change the default at runtime.
if [ -r $PKG/usr/bin/$DEFAULT_LD ]; then
  ( cd $PKG/usr/bin ; rm -f ld ; ln -sf $DEFAULT_LD ld )
fi
      
find $PKG | xargs file | grep -e "executable" -e "shared object" \
  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

# Remove some unneeded man pages, and then compress the rest
rm -f $PKG/usr/man/man1/{dlltool,windres}.1
( cd $PKG/usr/man
  find . -type f -exec gzip -9 {} \;
  for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)

# Compress info pages
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*

mkdir -p $PKG/usr/doc/binutils-$VERSION
cp \
  $CWD/release.binutils-* \
  COPYING* ChangeLog.linux MAI* README* \
  $PKG/usr/doc/binutils-$VERSION

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
  touch -r ChangeLog $DOCSDIR/ChangeLog
fi

chown -R root:root $PKG/usr/doc/binutils-$VERSION

# Add slack-desc:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/binutils-$VERSION-$ARCH-$BUILD.txz
About SLKCFLAGS=""
I use /etc/profile and add custom flags to CFLAGS,CXXFLAGS and SLKCFLAGS

Last edited by tuxbg; 04-08-2014 at 11:18 AM.
 
Old 04-08-2014, 11:21 AM   #33
hendrickxm
Member
 
Registered: Feb 2014
Posts: 62

Rep: Reputation: Disabled
Thanks again. I will try this tonight and start rebuilding my toolchain again.
 
Old 04-08-2014, 11:31 AM   #34
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 248

Original Poster
Rep: Reputation: Disabled
You welcome
 
Old 04-08-2014, 11:36 AM   #35
hendrickxm
Member
 
Registered: Feb 2014
Posts: 62

Rep: Reputation: Disabled
So, I am building binutils and will continue with the toolchain:

U kernel-headers-3.12.15 DONE
U glibc-2.19 DONE
R zlib-1.2.8 DONE
U file-5.17 DONE
U binutils-2.24 DONE
R oprofile-0.9.7 SKIPPED
U gmp-6.0.0a DONE
R mpfr-3.1.2 DONE
U libmpc-1.0.2-1 DONE
Create symlink:
cd /usr/lib64
ln -s libmpc.so.3 libmpc.so.2
Install gcc-gnat DONE, gcc-go SKIPPED and gcc-java SKIPPED
R gcc-4.8.2 DONE
R libtool-2.4.2 DONE
R kernel-headers BUSY
R popt
R glibc
R binutils
R oprofile
R gcc
R libtool

Any comments?
After this the base will follow.
I am using slackel openbox 6.0 and I am trying to trim down my installed packages.

EDIT: I have installed the binary packages I have build on another testbox and that way I can test them at the same time.

Last edited by hendrickxm; 04-08-2014 at 03:52 PM.
 
Old 04-08-2014, 11:47 AM   #36
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 248

Original Poster
Rep: Reputation: Disabled
After rebuilding gcc with new libmpc you don't need to create symlinks to new version of that library because rebuilded version of gcc now does not need older version.
 
Old 04-08-2014, 04:17 PM   #37
hendrickxm
Member
 
Registered: Feb 2014
Posts: 62

Rep: Reputation: Disabled
I got up to the point where I want to rebuild glibc-2.19 but when I am building, it gives an error: ld too old.

Code:
configure: error: 
*** These critical programs are missing or too old: ld
*** Check the INSTALL file for required versions.
make: *** No targets specified and no makefile found.  Stop.
make: *** No targets specified and no makefile found.  Stop.
Any thought, did not have this issue when I used the slackware-current binutils rebuild version.

So I tried to compile a newer version of oprofile:

Code:
checking for cplus_demangle in -liberty... no
configure: error: liberty library not found
make: *** No targets specified and no makefile found.  Stop.
make: *** No targets specified and no makefile found.  Stop.
I screwed up somewhere.

Last edited by hendrickxm; 04-08-2014 at 04:31 PM.
 
Old 04-09-2014, 10:36 AM   #38
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 248

Original Poster
Rep: Reputation: Disabled
Well this is because glibc cant be build with ld.gold.You need to proceed like this
Code:
cd /usr/bin
rm -f ld
ln -sf ld.bfd ld
In my build script of binutils i use ld.gold linker instead of ld.bfd.
Or if you want your default linker to be gold apply this patch to glibc
Attached Files
File Type: txt glibc_p_patch.txt (1.6 KB, 5 views)
 
Old 04-09-2014, 04:46 PM   #39
hendrickxm
Member
 
Registered: Feb 2014
Posts: 62

Rep: Reputation: Disabled
Thanks again.
I added the patch to glibc. Are there any problems I might get into by using ld.gold?
I use grub, so I will need to be able to rebuild that. There is no more need for oprofile if I don't use ld.bfd or is there?

Hmm, I just rebuild glibc with the patch and tried to install the package. My computer froze, so I hard-rebooted and now it hangs on the boot after mounting /sys /proc. Damn.

I guess I will go for a rebuild with the current binutils, I did not have problems there.
So glibc-2.19, binutils-2.23.52.0.1, gcc-4.8.2, kernel-headers-3.12.16 and most of the latest available libraries.

Last edited by hendrickxm; 04-09-2014 at 05:07 PM.
 
Old 04-09-2014, 04:50 PM   #40
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Rep: Reputation: 77
I am confused, Slackware already has GCC 4.8.2 on it
 
Old 04-09-2014, 05:49 PM   #41
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 173

Rep: Reputation: 25
Quote:
Originally Posted by moisespedro View Post
I am confused, Slackware already has GCC 4.8.2 on it
Yes, that is correct. But when you rebuild your toolchain, as these guys are, building and rebuilding gcc is part of all that. Kernel headers, binutils, gcc (and deps), libc, must all be built in a certain way, often with specific peculiarities that can vary with each individual peice of the toolchain and the version used. I've been following this thread and like the way it is progressing.
 
Old 04-09-2014, 07:10 PM   #42
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Rep: Reputation: 77
Quote:
Originally Posted by j_v View Post
Yes, that is correct. But when you rebuild your toolchain, as these guys are, building and rebuilding gcc is part of all that. Kernel headers, binutils, gcc (and deps), libc, must all be built in a certain way, often with specific peculiarities that can vary with each individual peice of the toolchain and the version used. I've been following this thread and like the way it is progressing.
I am just wondering why are they doing that if Slackware already has it
 
Old 04-09-2014, 07:36 PM   #43
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 173

Rep: Reputation: 25
Quote:
But when you rebuild your toolchain, as these guys are, building and rebuilding gcc is part of all that.
Sooooo ... they are creating a toolchain, because they are upgrading the c library. The c library, compiler, linker/assembler, kernel headers... et al, that are used in a toolchain are tightly coupled together. To properly create a new toolchain for upgrading the c library requires that the compiler is built specifically for that c library. Soooo... they have to rebuild binutils, gcc, glibc, as well as many other packages, get the order right, discover incompatiblities, fix or find fixes for those incompatiblities, build, test, rebuild, test... I am hoping you are getting the idea that is complex, the order must be correct, get one thing wrong and you have to start again (probably from the beginning). If you have messed around with LFS, then you have dabbled in toolchain building.
 
Old 04-09-2014, 08:04 PM   #44
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Rep: Reputation: 77
I still don't get it, they aren't upgrading anything. The packages are already there!
That is why I don't get it (I know about the toolchain stuff)
 
Old 04-09-2014, 08:14 PM   #45
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 173

Rep: Reputation: 25
@moisepedro: No, glibc-2.19 is decidedly not even in current yet. Kernel headers in Slackware are from 3.10.17, here they are using 3.12.15. binutils is also more recent version.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Multilib issue: error upgrading glibc. System unusable. Slackware64 current val3xiv Slackware 2 05-21-2013 07:20 AM
Slackware64 -current (multilib) -- Wrong GCC version slaka Slackware 2 05-13-2013 10:39 AM
slackware64-current libtool using path to old version of GCC JazzItSelf Slackware 6 11-21-2011 11:35 PM
slackware64-current glibc resolver bug? fancylad Slackware 8 01-31-2010 04:47 PM
Blacklisting gcc/glibc with slackpkg in multilib-current damgar Slackware 1 01-04-2010 11:15 PM


All times are GMT -5. The time now is 07:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration