* [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering
@ 2011-11-07 7:19 slyich
2011-11-07 12:45 ` David Sterba
0 siblings, 1 reply; 3+ messages in thread
From: slyich @ 2011-11-07 7:19 UTC (permalink / raw)
To: linux-btrfs; +Cc: chris.mason, Sergei Trofimovich
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering
2011-11-07 7:19 [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering slyich
@ 2011-11-07 12:45 ` David Sterba
2011-11-07 13:25 ` Jan Schmidt
0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2011-11-07 12:45 UTC (permalink / raw)
To: slyich; +Cc: linux-btrfs, chris.mason, Sergei Trofimovich
On Mon, Nov 07, 2011 at 10:19:33AM +0300, slyich@gmail.com wrote:
> 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
No, it's "-pthread", adds both preprocessor and linker flags.
david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering
2011-11-07 12:45 ` David Sterba
@ 2011-11-07 13:25 ` Jan Schmidt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Schmidt @ 2011-11-07 13:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: slyich, chris.mason, Sergei Trofimovich
Hi David,
On 07.11.2011 13:45, David Sterba wrote:
> On Mon, Nov 07, 2011 at 10:19:33AM +0300, slyich@gmail.com wrote:
>> 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
>
> No, it's "-pthread", adds both preprocessor and linker flags.
It seems to do the right thing on x86_64, although...
If I'm reading my gcc manpage right, it is telling me to use -pthread
only for ia64 on HPUX, powerpc and sparc. (gcc 4.4.5 that is)
-Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-07 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 7:19 [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering slyich
2011-11-07 12:45 ` David Sterba
2011-11-07 13:25 ` Jan Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox