SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The log files you show us only contain the errors at the end when the script tries to packages binaries which apparently were not compiled. You will find the real errors much earlier in the logfile.
I'm REALLY REALLY SORRY.The mistake was mine,because i edit slackbuild and put this --disable-bootstrap but the original slackbuild have this make $NUMJOBS bootstrap;,i just remove that line and gcc compiles perfectly
This thread is old but i have another problem with gcc-4.8.0.The problem is gcc-4.8.0 compile perfect but miss libgomp and all symbolic link to libgomp.
I recompile gcc with that configure options
Components within gcc can fail on errors without the slackbuild exiting - it will move on to the next component. Tee the slackbuild output to a log file: './gcc.SlackBuild 2>&1 | tee /tmp/gcc.buildlog'
After the build completes, check the log for errors:
'grep -nw Error /tmp/gcc.buildlog'
Sort through that and look for an error message, then you can open the log and go top that line to look back and try top make sense of what went wrong.
Components within gcc can fail on errors without the slackbuild exiting - it will move on to the next component. Tee the slackbuild output to a log file: './gcc.SlackBuild 2>&1 | tee /tmp/gcc.buildlog'
After the build completes, check the log for errors:
'grep -nw Error /tmp/gcc.buildlog'
Sort through that and look for an error message, then you can open the log and go top that line to look back and try top make sense of what went wrong.
Good luck!
SlackBuild create a such log,and there is no errors in.But anyway,i edit SlackBuild to support only c and c++ and now gcc compiles perfect.But when i upgrade --reinstall gcc startx didnt work
IIRC, the log that is generated inside the gcc-$mcookie dir won't catch as much information as tee'ing the output as I described above, and since you mentioned it's working when you run make manually, you'll want to see the output from the Slackbuild itself, not just the make process.
How much RAM do you have, and how many processes are you running in parallel (make -j*)? I had ld errors on some of the gcc libs due to a shortage of RAM (compiling for ARM on a machine with 750MB available). You might want to try adding more swap if you compile again with the other language options.
IIRC, the log that is generated inside the gcc-$mcookie dir won't catch as much information as tee'ing the output as I described above, and since you mentioned it's working when you run make manually, you'll want to see the output from the Slackbuild itself, not just the make process.
How much RAM do you have, and how many processes are you running in parallel (make -j*)? I had ld errors on some of the gcc libs due to a shortage of RAM (compiling for ARM on a machine with 750MB available). You might want to try adding more swap if you compile again with the other language options.
I have 8 gb ram and amd fx-4100 processor,i use make -j7 ,i'll try your tee and report back.This is the modified script that i create for gcc
Code:
#!/bin/bash
GMP_VERS=5.1.1
GMP_BUILD=${GMP_BUILD:-1}
MPFR_VERS=3.1.2
MPFR_BUILD=${MPFR_BUILD:-1}
MPC_VERS=0.8.2
MPC_BUILD=${MPC_BUILD:-2}
PPL_VERS=1.0
PPL_BUILD=${PPL_BUILD:-1}
ISL_VERS=0.11.1
ISL_BUILD=${ISL_BUILD:-1}
CLOOG_VERS=0.18.0
CLOOG_BUILD=${CLOOG_BUILD:-1}
GCC_VERS=4.8.0
GCC_BUILD={GCC_BUILD:-2}
export ARCH=x86_64
NUMJOBS=${NUMJOBS:-" -j7 "}
CWD=$(pwd)
TMP=${TMP:-/home/tux/tmp/}
PKG1=$TMP/package-gmp
PKG2=$TMP/package-mpfr
PKG3=$TMP/package-mpc
PKG4=$TMP/package-ppl
PKG5=$TMP/package-isl
PKG6=$TMP/package-cloog
PKG7=$TMP/package-gcc
PKG8=$TMP/package-gcc-g++
mkdir -p $TMP/build/{gmp,mpfr,mpc,ppl,isl,cloog,gcc}
if [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC -pipe -march=native -mtune=native -flto -fuse-linker-plugin"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
rm -rf $PKG1
mkdir -p $TMP $PKG1/usr
cd $TMP
tar xvf $CWD/gmp-$GMP_VERS.tar.?z*
cd gmp-$GMP_VERS
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
cd $TMP/build/gmp
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="-O2 -fPIC -pipe -march=native -mtune=native -flto -fuse-linker-plugin" \
../../gmp-$GMP_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--infodir=/usr/info \
--with-gnu-ld \
--enable-cxx \
--build=$TARGET
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG1 || exit 1
rm $PKG1/usr/info/dir
gzip -9 $PKG1/usr/info/*
find $PKG1 | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
mkdir -p $PKG1/usr/doc/gmp-$GMP_VERS
cp -a \
AUTHORS COPYING* NEWS README \
$PKG1/usr/doc/gmp-$GMP_VERS
# 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 $PKG1/usr/doc/*-$GMP_VERS)
cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
touch -r ChangeLog $DOCSDIR/ChangeLog
fi
mkdir -p $PKG1/install
cat $CWD/slack-desc/slack-desc-gmp > $PKG1/install/slack-desc || exit 1
cd $PKG1
/sbin/makepkg -l y -c n ../gmp-$GMP_VERS-$ARCH-$GMP_BUILD.txz || exit 1
upgradepkg --reinstall ../gmp-$GMP_VERS-$ARCH-$GMP_BUILD.txz
cd $TMP
tar xvf $CWD/mpfr-$MPFR_VERS.tar.?z*
cd mpfr-$MPFR_VERS
chown -R root:root .
cd $TMP/build/mpfr
CFLAGS="$SLKCFLAGS" \
../../mpfr-$MPFR_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--infodir=/usr/info \
--docdir=/usr/doc/mpfr-$MPFR_VERS \
--enable-static=yes \
--with-gmp=$PKG1 \
--enable-shared=yes \
--build=$TARGET
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG2 || exit 1
find $PKG2 | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
rm -f $PKG2/usr/info/dir
gzip -9 $PKG2/usr/info/*
mkdir -p $PKG2/usr/doc/mpfr-$MPFR_VERS
cp -a \
AUTHORS BUGS COPYING* FAQ.html INSTALL NEWS README* TODO VERSION \
examples \
$PKG2/usr/doc/mpfr-$MPFR_VERS
# 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 $PKG2/usr/doc/mpfr-$MPFR_VERS)
cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
touch -r ChangeLog $DOCSDIR/ChangeLog
fi
mkdir -p $PKG2/install
cat $CWD/slack-desc/slack-desc-mpfr > $PKG2/install/slack-desc
cd $PKG2
/sbin/makepkg -l y -c n $TMP/mpfr-$MPFR_VERS-$ARCH-$MPFR_BUILD.txz || exit 1
upgradepkg --reinstall $TMP/mpfr-$MPFR_VERS-$ARCH-$MPFR_BUILD.txz
cd $TMP
tar xvf $CWD/mpc-$MPC_VERS.tar.?z*
cd mpc-$MPC_VERS
chown -R root:root .
cd $TMP/build/mpc
CFLAGS="$SLKCFLAGS" \
../../mpc-$MPC_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--infodir=/usr/info \
--docdir=/usr/doc/mpc-$MPC_VERS \
--with-gmp=$PKG1 \
--with-mpfr=$PKG2 \
--enable-static=yes \
--enable-shared=yes \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG3 || exit 1
find $PKG3 | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
rm -f $PKG3/usr/info/dir
gzip -9 $PKG3/usr/info/*
mkdir -p $PKG3/usr/doc/mpc-$MPC_VERS
cp -a \
AUTHORS COPYING* INSTALL NEWS README* TODO \
$PKG3/usr/doc/mpc-$MPC_VERS
# 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 $PKG3/usr/doc/mpc-$MPC_VERS)
cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
touch -r ChangeLog $DOCSDIR/ChangeLog
fi
mkdir -p $PKG3/install
cat $CWD/slack-desc/slack-desc-mpc > $PKG3/install/slack-desc || exit 1
cd $PKG3
/sbin/makepkg -l y -c n $TMP/mpc-$MPC_VERS-$ARCH-$MPC_BUILD.txz || exit 1
removepkg /var/log/packages/libmpc-0.8.2-x86_64-2 || exit 1
upgradepkg --reinstall --install-new $TMP/mpc-$MPC_VERS-$ARCH-$MPC_BUILD.txz
cd $TMP
tar xvf $CWD/ppl-$PPL_VERS.tar.?z*
cd ppl-$PPL_VERS
zcat $CWD/pp.patch.gz | patch -p1 --verbose || exit 1
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 {} \;
cd $TMP/build/ppl
CFLAGS="$SLKCFLAGS" \
../../ppl-$PPL_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--with-gmp=$PKG1
--enable-interfaces="c,cxx" \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG4
find $PKG4 | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
# Compress and if needed symlink the man pages:
if [ -d $PKG4/usr/man ]; then
( cd $PKG4/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
mkdir -p $PKG4/install
cat $CWD/slack-desc/slack-desc-ppl > $PKG4/install/slack-desc || exit 1
cd $PKG4
/sbin/makepkg -l y -c n $TMP/ppl-$PPL_VERS-$ARCH-$PPL_BUILD.txz || exit 1
upgradepkg --reinstall --install-new $TMP/ppl-$PPL_VERS-$ARCH-$PPL_BUILD.txz
cd $TMP
tar xvf $CWD/isl-$ISL_VERS.tar.?z*
cd isl-$ISL_VERS
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 {} \;
cd $TMP/build/isl
CFLAGS="$SLKCFLAGS" \
../../isl-$ISL_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG5
rm -f $PKG5/usr/lib${LIBDIRSUFFIX}/*gdb.py
find $PKG5 | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
# Compress and if needed symlink the man pages:
if [ -d $PKG5/usr/man ]; then
( cd $PKG5/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
mkdir -p $PKG5/install
cat $CWD/slack-desc/slack-desc-ppl > $PKG5/install/slack-desc || exit 1
cd $PKG5
/sbin/makepkg -l y -c n $TMP/isl-$ISL_VERS-$ARCH-$ISL_BUILD.txz || exit 1
upgradepkg --reinstall --install-new $TMP/isl-$ISL_VERS-$ARCH-$ISL_BUILD.txz
cd $TMP
tar xvf $CWD/cloog-$CLOOG_VERS.tar.?z*
cd cloog-$CLOOG_VERS
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 {} \;
cd $TMP/build/cloog
CFLAGS="$SLKCFLAGS" \
../../cloog-$CLOOG_VERS/configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--sysconfdir=/etc \
--with-gmp=$PKG1 \
--with-isl=system \
--with-bits=gmp \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG6
find $PKG6 | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
# Compress and if needed symlink the man pages:
if [ -d $PKG6/usr/man ]; then
( cd $PKG6/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
mkdir -p $PKG6/install
cat $CWD/slack-desc/slack-desc-cloog > $PKG6/install/slack-desc || exit 1
cd $PKG6
/sbin/makepkg -l y -c n $TMP/cloog-$CLOOG_VERS-$ARCH-$CLOOG_BUILD.txz || exit 1
upgradepkg --reinstall --install-new $TMP/cloog-$CLOOG_VERS-$ARCH-$CLOOG_BUILD.txz
mkdir -p $PKG{7,8}/install
cat $CWD/slack-desc/slack-desc-gcc > $PKG7/install/slack-desc
cat $CWD/slack-desc/slack-desc-gcc-g++ > $PKG8/install/slack-desc
cd $TMP
tar xvf $CWD/gcc-$GCC_VERS.tar.?z*
( cd $TMP/gcc-$$GCC_VERS
# Restore target headers that were dropped (accidentally?) in gcc-4.8.0:
zcat $CWD/gcc.target_h.diff.gz | patch -p1 --verbose || exit 1
# Fix register clobber that was breaking WINE with -O2 optimization
# (and probably affected other code as well):
zcat $CWD/regcprop.fixo2.diff.gz | patch -p2 --verbose || exit 1
#
zcat $CWD/gcc-no_fixincludes.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
# Fix perms/owners
chown -R root:root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 754 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
)
cd $TMP/build/gcc
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
../../gcc-$GCC_VERS/configure --prefix=/usr
--libdir=/usr/lib$LIBDIRSUFFIX \
--mandir=/usr/man --infodir=/usr/info \
--enable-bootstrap \
--enable-languages=c,c++,lto \
--enable-shared --enable-threads=posix \
--with-system-zlib --enable-__cxa_atexit \
--disable-libunwind-exceptions --enable-clocale=gnu \
--disable-libstdcxx-pch --disable-nls \
--enable-gnu-unique-object --enable-linker-build-id \
--enable-lto --enable-gold --enable-ld=default \
--enable-cloog-backend=isl --disable-cloog-version-check \
--with-gmp=$PKG1 --with-mpfr=$PKG2 --with-mpc=$PKG3 \
--with-ppl=$PKG4 --with-cloog=$PKG6 \
--enable-plugin --with-plugin-ld=ld.gold \
--with-linker-hash-style=gnu --disable-gtktest \
--disable-multilib --disable-libssp --disable-werror \
--enable-checking=release \
--with-cpu=native --with-arch=native --with-tune=native \
--with-arch-directory=amd64 \
--target=${TARGET} \
--build=${TARGET} \
--host=${TARGET} || exit 1
make $NUMJOBS bootstrap ;
make info
# Set GCCCHECK=something to run the tests
if [ ! -z $GCCCHECK ]; then
make $NUMJOBS check
fi
make install DESTDIR=$PKG7
rm -f $PKG7/usr/lib${LIBDIRSUFFIX}/*gdb.py
# Be sure the "specs" file is installed.
if [ ! -r $PKG7/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${GCC_VERS}/specs ]; then
cat stage1-gcc/specs > $PKG7/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${GCC_VERS}/specs
fi
# Make our 64bit gcc look for 32bit gcc binaries in ./32 subdirectory:
if [ "$ARCH" = "x86_64" ]; then
sed -i 's#;.\(:../lib !m64 m32;\)$#;32\1#' \
$PKG7/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${GCC_VERS}/specs
fi
make -i install-info DESTDIR=$PKG7
chmod 755 $PKG7/usr/lib${LIBDIRSUFFIX}/libgcc_s.so.1
# Fix stuff up:
( cd $PKG7/usr/info ; rm dir ; gzip -9 * )
( cd $PKG7
# *not* ${LIBDIRSUFFIX}
mkdir -p lib
cd lib
ln -sf /usr/bin/cpp .
)
( cd $PKG7/usr/bin
mv g++ g++-gcc-$GCC_VERS
mv gcc gcc-$GCC_VERS
ln -sf g++-gcc-$GCC_VERS g++
ln -sf gcc-$GCC_VERS gcc
ln -sf g++ c++
ln -sf gcc cc
ln -sf gcc-$GCC_VERS ${TARGET}-gcc
ln -sf gcc-$GCC_VERS ${TARGET}-gcc-$GCC_VERS
ln -sf gcc-ar ${TARGET}-gcc-ar
ln -sf gcc-nm ${TARGET}-gcc-nm
ln -sf gcc-ranlib ${TARGET}-gcc-ranlib
ln -sf g++-gcc-$GCC_VERS ${TARGET}-c++
ln -sf g++-gcc-$GCC_VERS ${TARGET}-g++
)
( cd $PKG7/usr/man
gzip -9 */*
cd man1
ln -sf g++.1.gz c++.1.gz
ln -sf gcc.1.gz cc.1.gz
)
## build the txz package
#(
# cd $PKG1;
# makepkg -l y -c n $TMP/gcc-$VERSION-$ARCH-$GCC_BUILD.txz
#)
# keep a log
) 2>&1 | tee $TMP/gcc.build.log
# gcc-g++:
( cd $PKG8
mkdir -p usr/bin
mv $PKG7/usr/bin/*++* usr/bin
mkdir -p usr/include
mv $PKG7/usr/include/c++ usr/include
mkdir -p usr/lib${LIBDIRSUFFIX}
mv $PKG7/usr/lib${LIBDIRSUFFIX}/*++* usr/lib${LIBDIRSUFFIX}
mkdir -p usr/libexec/gcc/$TARGET/$GCC_VERS
mv $PKG7/usr/libexec/gcc/$TARGET/$GCC_VERS/cc1plus usr/libexec/gcc/$TARGET/$GCC_VERS/cc1plus
mkdir -p usr/man/man1
mv $PKG7/usr/man/man1/*++* usr/man/man1
) || exit 1
# Filter all .la files (thanks much to Mark Post for the sed script):
( cd $TMP
for file in $(find . -type f -name "*.la") ; do
cat $file | sed -e 's%-L/gcc-[[:graph:]]* % %g' > $TMP/tmp-la-file
cat $TMP/tmp-la-file > $file
done
rm $TMP/tmp-la-file
)
## Strip bloated binaries and libraries:
for dir in $PKG{7,8}; do
( cd $dir
find . -name "lib*so*" -exec strip --strip-unneeded "{}" \;
find . -name "lib*a" -exec strip -g "{}" \;
strip --strip-unneeded usr/bin/* 2> /dev/null
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
done
rm -rf $PKG7/tmp || exit 1
rm -rf $PKG8/tmp || exit 1
( cd $PKG7
makepkg -l y -c n $TMP/gcc-$GCC_VERS-$ARCH-$GCC_BUILD.txz )
( cd $PKG8
makepkg -l y -c n $TMP/gcc-g++-$GCC_VERS-$ARCH-$GCC_BUILD.txz )
echo
echo "Slackware GCC package build complete!"
echo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.