Accepting request 121244 from filesystems

Fix -pthread in fuse.pc [bnc#761117] (forwarded request 121243 from mszeredi)

OBS-URL: https://build.opensuse.org/request/show/121244
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fuse?expand=0&rev=50
This commit is contained in:
Stephan Kulow 2012-05-21 06:02:46 +00:00 committed by Git OBS Bridge
commit 5170d92518
3 changed files with 116 additions and 8 deletions

View File

@ -0,0 +1,83 @@
From 384496dd02cfd9a74b95d62ce0d23a31a7af3730 Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi@suse.cz>
Date: Wed, 16 May 2012 16:45:27 +0200
Subject: [PATCH] Fix -pthread in fuse.pc
Linking to a library that uses threads requires the application to be linked
with -pthreads otherwise some pthread functions will be linked to stubs in
glibc. So move -pthread from Libs.private to Libs in fuse.pc.
Reported by Werner Fink
---
ChangeLog | 7 +++++++
configure.in | 5 ++---
fuse.pc.in | 2 +-
lib/Makefile.am | 2 +-
4 files changed, 11 insertions(+), 5 deletions(-)
Index: fuse-2.9.0/ChangeLog
===================================================================
--- fuse-2.9.0.orig/ChangeLog 2012-04-20 16:29:19.000000000 +0200
+++ fuse-2.9.0/ChangeLog 2012-05-16 17:51:34.000000000 +0200
@@ -1,3 +1,10 @@
+2012-05-16 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Linking to a library that uses threads requires the application
+ to be linked with -pthreads otherwise some pthread functions will
+ be linked to stubs in glibc. So move -pthread from Libs.private
+ to Libs in fuse.pc. Reported by Werner Fink
+
2012-04-20 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.9.0
Index: fuse-2.9.0/configure.in
===================================================================
--- fuse-2.9.0.orig/configure.in 2012-05-16 17:51:33.000000000 +0200
+++ fuse-2.9.0/configure.in 2012-05-16 17:51:34.000000000 +0200
@@ -62,11 +62,10 @@ AC_CHECK_FUNCS([fork setxattr fdatasync
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec])
-libfuse_libs="-pthread"
LIBS=
AC_SEARCH_LIBS(dlopen, [dl])
AC_SEARCH_LIBS(clock_gettime, [rt])
-libfuse_libs="$libfuse_libs $LIBS"
+libfuse_libs=$LIBS
LIBS=
AC_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
@@ -76,7 +75,7 @@ AC_ARG_WITH([libiconv-prefix],
done
])
AM_ICONV
-libfuse_libs="$libfuse_libs $LTLIBICONV"
+libfuse_libs=$libfuse_libs $LTLIBICONV
AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = yes)
AC_SUBST(libfuse_libs)
Index: fuse-2.9.0/fuse.pc.in
===================================================================
--- fuse-2.9.0.orig/fuse.pc.in 2012-04-10 15:28:55.000000000 +0200
+++ fuse-2.9.0/fuse.pc.in 2012-05-16 17:51:34.000000000 +0200
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: fuse
Description: Filesystem in Userspace
Version: @VERSION@
-Libs: -L${libdir} -lfuse
+Libs: -L${libdir} -lfuse -pthread
Libs.private: @libfuse_libs@
Cflags: -I${includedir}/fuse -D_FILE_OFFSET_BITS=64
Index: fuse-2.9.0/lib/Makefile.am
===================================================================
--- fuse-2.9.0.orig/lib/Makefile.am 2012-04-20 12:01:56.000000000 +0200
+++ fuse-2.9.0/lib/Makefile.am 2012-05-16 17:51:34.000000000 +0200
@@ -36,7 +36,7 @@ libfuse_la_SOURCES = \
$(iconv_source) \
$(mount_source)
-libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:9:0 \
+libfuse_la_LDFLAGS = -pthread @libfuse_libs@ -version-number 2:9:0 \
-Wl,--version-script,$(srcdir)/fuse_versionscript
if NETBSD

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed May 16 17:52:11 CEST 2012 - mszeredi@suse.cz
- Fix -pthread in fuse.pc [bnc#761117]
-------------------------------------------------------------------
Thu Apr 26 19:31:47 UTC 2012 - rschweikert@suse.com
- place binaries in /usr tree (UsrMerge project)
-------------------------------------------------------------------
Sun Apr 22 10:31:21 UTC 2012 - puzel@suse.com

View File

@ -29,6 +29,7 @@ Source3: baselibs.conf
Patch: fuse-install-fix.diff
Patch3: fuse-gnu_source.patch
Patch4: fusermount-compile-as-pie.patch
Patch5: fix-pthread-in-fuse.pc.patch
Url: http://fuse.sourceforge.net
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1130
@ -268,34 +269,39 @@ Authors:
%patch
%patch3
%patch4 -p1
%patch5 -p1
%build
autoreconf -fiv
export CFLAGS="$RPM_OPT_FLAGS -g -fno-strict-aliasing"
export MOUNT_FUSE_PATH=%{_sbindir}
%configure --with-pic \
--with-pkgconfigdir=%{_libdir}/pkgconfig \
--exec-prefix=/ \
--libdir=/%{_lib} \
--enable-lib \
--enable-util \
--enable-example
%{__make} %{?jobs:-j%jobs}
%install
make DESTDIR="$RPM_BUILD_ROOT" install
%make_install
rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
# Needed for OpenSUSE buildservice
%if %suse_version <= 1020
install -m644 -D util/udev.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/99-fuse.rules
%endif
for libname in libfuse libulockmgr;do
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/$libname.so) %{buildroot}%{_libdir}/$libname.so
%{__rm} -v %{buildroot}/%{_lib}/$libname.{so,la}
%{__mv} -v %{buildroot}/%{_lib}/$libname.a %{buildroot}%{_libdir}
done
%{__rm} -f %{buildroot}%{_libdir}/*.la
# not needed for fuse, might reappar in separate package:
%{__rm} -f %{buildroot}/%{_libdir}/libulockmgr.a
#UsrMerge
mkdir $RPM_BUILD_ROOT/sbin
mkdir $RPM_BUILD_ROOT/%{_lib}
%{__ln_s} -v %{_sbindir}/mount.fuse $RPM_BUILD_ROOT/sbin
pushd $RPM_BUILD_ROOT/%{_libdir}
for libname in $(ls *.so.*);do
%{__ln_s} -v /%{_libdir}/$libname %{buildroot}/%{_lib}
done
popd
#EndUsrMerge
(cd example && %{__make} clean)
%{__rm} -rf example/.deps example/Makefile.am example/Makefile.in
@ -330,7 +336,10 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/udev/rules.d/99-fuse.rules
%endif
%verify(not mode) %attr(4750,root,trusted) %{_bindir}/fusermount
#UsrMerge
/sbin/mount.fuse
#EndUsrMerge
%{_sbindir}/mount.fuse
%{_bindir}/ulockmgr_server
%{_mandir}/man1/fusermount.1.*
%{_mandir}/man1/ulockmgr_server.1.*
@ -338,11 +347,17 @@ rm -rf $RPM_BUILD_ROOT
%files -n libfuse2
%defattr(-,root,root)
#UsrMerge
/%{_lib}/libfuse.so.2*
#EndUsrMerge
%{_libdir}/libfuse.so.2*
%files -n libulockmgr1
%defattr(-,root,root)
#UsrMerge
/%{_lib}/libulockmgr.so.*
#EndUsrMerge
%{_libdir}/libulockmgr.so.*
%files devel
%defattr(-,root,root)