[Ocfs2-users] Compiling ocfs2-tools-1.6.3 on slackware64-13.1

pica pica pica6667 at aeiou.pt
Tue Nov 30 19:47:07 PST 2010


Some progress: I added -lpthread my build script (see bellow) and I got past fsck.ocfs2, but now get stuck at o2image :(
It seems that -lpthread was not used here, but I could see that it was everywhere else. Is this right?

make[1]: Entering directory `/root/ocfs2/ocfs2-tools/ocfs2-tools/tmp/SBo/ocfs2-tools-1.6.3/o2image'                                                                                 
gcc  -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes -Wmissing-declarations    -I../include -I. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DVERSION=\"1.6.3\"  -MD -MP -MF ./.o2image.d -o o2image.o -c o2image.c                                      
gcc  -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes -Wmissing-declarations  -o o2image o2image.o ../libocfs2/libocfs2.a -lglib-2.0   -L../libocfs2 -locfs2 -L/lib -lcom_err                                                                                       
/lib/libcom_err.a(error_message.o): In function `et_list_unlock':                         
error_message.c:(.text+0x1b0): undefined reference to `sem_post'                          
/lib/libcom_err.a(error_message.o): In function `fini_et_lock':                           
error_message.c:(.text+0x1ce): undefined reference to `sem_destroy'                       
/lib/libcom_err.a(error_message.o): In function `setup_et_lock':
error_message.c:(.text+0x1fe): undefined reference to `sem_init'
/lib/libcom_err.a(error_message.o): In function `et_list_lock':
error_message.c:(.text+0x22d): undefined reference to `sem_wait'
collect2: ld returned 1 exit status
make[1]: *** [o2image] Error 1
make[1]: Leaving directory `/root/ocfs2/ocfs2-tools/ocfs2-tools/tmp/SBo/ocfs2-tools-1.6.3/o2image'
make: *** [o2image] Error 2


Here is my build script:

#!/bin/sh

# Slackware build script for ocfs2-tools

# Copyright (c) 2010  Jose Leal <pica6667 at aeiou.pt>
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
#   notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
#   copyright notice, this list of conditions and the following disclaimer
#   in the documentation and/or other materials provided with the
#   distribution.
# * Neither the name of the {company} nor the names of its
#   contributors may be used to endorse or promote products derived from
#   this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "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 COPYRIGHT
# OWNER OR CONTRIBUTORS 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.

PRGNAM=ocfs2-tools
VERSION=1.6.3
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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

CWD=$(pwd)
TMP=./tmp/SBo
#TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT  
cd $TMP
rm -rf $TMP/$PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
cd $PRGNAM-$VERSION
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 {} \;

CFLAGS="$SLKCFLAGS -lpthread" \
CXXFLAGS="$SLKCFLAGS -lpthread" \
./configure \
  --sbindir=/sbin \
  --bin=/bin \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --datadir=/etc/ocfs2 \
  --sharedstatedir=/var/ocfs2 \
  --libexecdir=/usr/libexec \
  --localstatedir=/var \
  --mandir=/usr/man \
  --build=$ARCH-slackware-linux


make 
make install DESTDIR=$PKG

find $PKG | xargs file | grep -e "executable" -e "shared object"| grep ELF | \
  cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

( 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
)

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING CREDITS MAINTAINERS README README.O2CB $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $CWD/../$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}



----- Mensagem Original -----
De: Sunil Mushran <sunil.mushran at oracle.com>
Para: pica pica <pica6667 at aeiou.pt>
Cc: ocfs2-users at oss.oracle.com
Enviado: Wed, 1 Dec 2010 02:29:33 +0000 (WET)
Assunto: Re: [Ocfs2-users] Compiling ocfs2-tools-1.6.3 on slackware64-13.1

>It looks ok as far as the ocfs2-tools build scripts are concerned.
>Note no -static. But I don't know anything about slackware build
>environment.

>Easiest would be to rerun the same command with -lpthread. See if
>that works.

># cd .../fsck.ocfs2
># gcc -O2 -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -pipe  -o fsck.ocfs2 fsck.o dirblocks.o dirparents.o extent.o icount.o journal.o pass0.o pass1.o pass1b.o pass2.o pass3.o pass4.o pass5.o problem.o refcount.o slot_recovery.o strings.o util.o xattr.o ../libocfs2/libocfs2.a ../libo2dlm/libo2dlm.a ../libo2cb/libo2cb.a -L../libocfs2 -locfs2 -L../libo2dlm -lo2dlm  -L../libo2cb -lo2cb -L/lib64 -lcom_err -lpthread



>On 11/30/2010 06:15 PM, pica pica wrote:
>> Hello Sunil,
>>
>> Any clues as to what could be wrong?
>> Would the las 2 flags not force a dynamic build?
>> Also, and sorry for asking but I'm new at this, where exactly should I add -lpthread to?
>>
>>
>> ----- Mensagem Original -----
>> De: Sunil Mushran<sunil.mushran at oracle.com>
>> Para: pica pica<pica6667 at aeiou.pt>
>> Cc: ocfs2-users at oss.oracle.com
>> Enviado: Tue, 30 Nov 2010 20:47:17 +0000 (WET)
>> Assunto: Re: [Ocfs2-users] Compiling ocfs2-tools-1.6.3 on slackware64-13.1
>>
>>> Something is not right in your setup. It appears to be forcing a static build. Try adding -lpthread.
>>> On 11/30/2010 10:03 AM, pica pica wrote:
>>>> Hello all,
>>>>
>>>> I'm having trouble compiling ocfs2-tools-1.6.3 on slackware64-13.1
>>>>
>>>> These are my configure flags (the last 2 I added after googling this problem, but didn't help):
>>>>
>>>> ./configure \
>>>>     --sbindir=/sbin \
>>>>     --bin=/bin \
>>>>     --libdir=/usr/lib${LIBDIRSUFFIX} \
>>>>     --sysconfdir=/etc \
>>>>     --datadir=/etc/ocfs2 \
>>>>     --sharedstatedir=/var/ocfs2 \
>>>>     --libexecdir=/usr/libexec \
>>>>     --localstatedir=/var \
>>>>     --mandir=/usr/man \
>>>>     --build=$ARCH-slackware-linux \
>>>>     --enable-dynamic-fsck \
>>>>     --enable-dynamic-ctl
>>>>
>>>> I get this error:
>>>>
>>>> gcc -O2 -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -pipe  -o fsck.ocfs2 fsck.o dirblocks.o dirparents.o extent.o icount.o journal.o pass0.o pass1.o pass1b.o pass2.o pass3.o pass4.o pass5.o problem.o refcount.o slot_recovery.o strings.o util.o xattr.o ../libocfs2/libocfs2.a ../libo2dlm/libo2dlm.a ../libo2cb/libo2cb.a -L../libocfs2 -locfs2 -L../libo2dlm -lo2dlm  -L../libo2cb -lo2cb -L/lib64 -lcom_err
>>>> /lib64/libcom_err.a(error_message.o): In function `setup_et_lock':
>>>> error_message.c:(.text+0x1a3): undefined reference to `sem_init'
>>>> /lib64/libcom_err.a(error_message.o): In function `fini_et_lock':
>>>> error_message.c:(.text+0x1cc): undefined reference to `sem_destroy'
>>>> /lib64/libcom_err.a(error_message.o): In function `et_list_lock':
>>>> error_message.c:(.text+0x1ff): undefined reference to `sem_wait'
>>>> /lib64/libcom_err.a(error_message.o): In function `et_list_unlock':
>>>> error_message.c:(.text+0x228): undefined reference to `sem_post'
>>>> collect2: ld returned 1 exit status
>>>> make[1]: *** [fsck.ocfs2] Error 1
>>>> make[1]: Leaving directory `/tmp/SBo/ocfs2-tools-1.6.3/fsck.ocfs2'
>>>> make: *** [fsck.ocfs2] Error 2

---------------------------------------------------

Venha conhecer o novo AEIOU: http://www.aeiou.pt



More information about the Ocfs2-users mailing list