Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: slyich@gmail.com
To: linux-btrfs@vger.kernel.org
Cc: chris.mason@oracle.com, Sergei Trofimovich <slyfox@gentoo.org>
Subject: [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering
Date: Mon,  7 Nov 2011 10:19:33 +0300	[thread overview]
Message-ID: <1320650373-15054-1-git-send-email-slyich@gmail.com> (raw)

From: Sergei Trofimovich <slyfox@gentoo.org>

$ LDFLAGS=-static make
gcc -lpthread -g -O0 -o btrfs btrfs.o btrfs_cmds.o scrub.o \
        ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o root-tree.o dir-item.o file-item.o inode-item.o inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o volumes.o utils.o btrfs-list.o btrfslabel.o -static -luuid
scrub.o: In function `scrub_write_progress':
/home/slyfox/linux-2.6-um-x86_64-fs/btrfs-progs-unstable/scrub.c:752: undefined reference to `pthread_mutex_lock'
/home/slyfox/linux-2.6-um-x86_64-fs/btrfs-progs-unstable/scrub.c:758: undefined reference to `pthread_setcancelstate'
/home/slyfox/linux-2.6-um-x86_64-fs/btrfs-progs-unstable/scrub.c:783: undefined reference to `pthread_mutex_unlock'
/home/slyfox/linux-2.6-um-x86_64-fs/btrfs-progs-unstable/scrub.c:787: undefined reference to `pthread_setcancelstate'

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index edee1a0..4d498b9 100644
--- a/Makefile
+++ b/Makefile
@@ -36,8 +36,8 @@ version:
 	bash version.sh
 
 btrfs: $(objects) btrfs.o btrfs_cmds.o scrub.o
-	$(CC) -lpthread $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o scrub.o \
-		$(objects) $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o scrub.o \
+		$(objects) $(LDFLAGS) $(LIBS) -lpthread
 
 btrfsctl: $(objects) btrfsctl.o
 	$(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
-- 
1.7.3.4


             reply	other threads:[~2011-11-07  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07  7:19 slyich [this message]
2011-11-07 12:45 ` [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering David Sterba
2011-11-07 13:25   ` Jan Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320650373-15054-1-git-send-email-slyich@gmail.com \
    --to=slyich@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=slyfox@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox