Bug#712140: check: Missing dependency for static linking (libpthread)
Le Tue, 12 Nov 2013 21:56:48 +0100, Sebastian Ramacher sramac...@debian.org a écrit : Hi On 2013-11-11 18:49:01, Laurent Bigonville wrote: OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now I don't think this bug can be closed. pkg-config check --libs still doesn't include -pthread which it should. -pthread needs to in both Cflags and Libs in check's pkgconfig file. The ax_pthread macro upstream thinks otherwise, see: https://savannah.gnu.org/patch/?8081 But I can admit, I've not seen a lot of projects doing it that way. If I understood correctly, -pthread should automatically make gcc link against libpthread. So as said the CFLAGS should also be passed to gcc at linking time, in that case explicit -lpthread flag seems redundant. Of course, passing -pthread to gcc during link time does the right thing. I would still expect to get -pthread (not -lpthread) from `pkg-config check --libs`. My understanding of --libs is that it's supposed to give the required linking flags. In the case of check, -pthread is required while linking, but is not included in the output of --libs. Well -pthread is a compiler flag, not the libpthread library, so IMHO it makes sense to assign it to the CFLAGS and not to the LIBS Like I said, automake also seems to add the CFLAGS at the linking time (in addition to the LDFLAGS and LIBS), The description of the a(c)x_pthread macro is clear about this: # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS=$PTHREAD_LIBS $LIBS # CFLAGS=$CFLAGS $PTHREAD_CFLAGS # CC=$PTHREAD_CC -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#712140: check: Missing dependency for static linking (libpthread)
On 2013-11-13 11:43:06, Laurent Bigonville wrote: OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now I don't think this bug can be closed. pkg-config check --libs still doesn't include -pthread which it should. -pthread needs to in both Cflags and Libs in check's pkgconfig file. The ax_pthread macro upstream thinks otherwise, see: https://savannah.gnu.org/patch/?8081 But I can admit, I've not seen a lot of projects doing it that way. If I understood correctly, -pthread should automatically make gcc link against libpthread. So as said the CFLAGS should also be passed to gcc at linking time, in that case explicit -lpthread flag seems redundant. Of course, passing -pthread to gcc during link time does the right thing. I would still expect to get -pthread (not -lpthread) from `pkg-config check --libs`. My understanding of --libs is that it's supposed to give the required linking flags. In the case of check, -pthread is required while linking, but is not included in the output of --libs. Well -pthread is a compiler flag, not the libpthread library, so IMHO it makes sense to assign it to the CFLAGS and not to the LIBS Like I said, automake also seems to add the CFLAGS at the linking time (in addition to the LDFLAGS and LIBS), The description of the a(c)x_pthread macro is clear about this: # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS=$PTHREAD_LIBS $LIBS # CFLAGS=$CFLAGS $PTHREAD_CFLAGS # CC=$PTHREAD_CC Yes, okay, it's great that the macro does the right thing for autofoo. It's also written for autofoo. But that doesn't make the pkgconfig file correct for anything else. Unless a simple $ gcc -c $(pkg-config --cflags check) test.c -o test.o $ gcc test.o -o test $(pkg-config --libs check) does not work, the pkgconfig file is broken (which is the original problem reported in #712140). There are also packages that seem to FTBFS because of this (#713575 for example). (Also note that other libraries that require one to use -pthread have it in both Cflags and Libs (or Libs.private) in the pkgconfig file - examples of these include gmodule-2.0.pc, OpenIPMIpthread.pc, fuse.pc, librtaudio.pc and swipl.pc.) Regards -- Sebastian Ramacher signature.asc Description: Digital signature
Bug#712140: check: Missing dependency for static linking (libpthread)
Hi On 2013-11-11 18:49:01, Laurent Bigonville wrote: OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now I don't think this bug can be closed. pkg-config check --libs still doesn't include -pthread which it should. -pthread needs to in both Cflags and Libs in check's pkgconfig file. The ax_pthread macro upstream thinks otherwise, see: https://savannah.gnu.org/patch/?8081 But I can admit, I've not seen a lot of projects doing it that way. If I understood correctly, -pthread should automatically make gcc link against libpthread. So as said the CFLAGS should also be passed to gcc at linking time, in that case explicit -lpthread flag seems redundant. Of course, passing -pthread to gcc during link time does the right thing. I would still expect to get -pthread (not -lpthread) from `pkg-config check --libs`. My understanding of --libs is that it's supposed to give the required linking flags. In the case of check, -pthread is required while linking, but is not included in the output of --libs. Regards -- Sebastian Ramacher signature.asc Description: Digital signature
Bug#712140: check: Missing dependency for static linking (libpthread)
Hi, OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now Cheers Laurent Bigonville -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#712140: check: Missing dependency for static linking (libpthread)
Hi On 2013-11-11 18:09:11, Laurent Bigonville wrote: OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now I don't think this bug can be closed. pkg-config check --libs still doesn't include -pthread which it should. -pthread needs to in both Cflags and Libs in check's pkgconfig file. Regards -- Sebastian Ramacher signature.asc Description: Digital signature
Bug#712140: check: Missing dependency for static linking (libpthread)
Le Mon, 11 Nov 2013 18:29:19 +0100, Sebastian Ramacher sramac...@debian.org a écrit : Hi On 2013-11-11 18:09:11, Laurent Bigonville wrote: OK for what I understood, the A(C)X_PTHREAD is setting the -pthread flag (not the absence of l) in PTHREAD_CFLAGS and relies on gcc to do the correct thing(tm) when this flag is set, this works the cases where the CFLAGS are also passed at the linking time (autofoo are doing that). If a pkg that link against check FTBFS this need to be checked. I feel that this bug should be fixed now and could be closed, all rdeps seems to compile now I don't think this bug can be closed. pkg-config check --libs still doesn't include -pthread which it should. -pthread needs to in both Cflags and Libs in check's pkgconfig file. The ax_pthread macro upstream thinks otherwise, see: https://savannah.gnu.org/patch/?8081 But I can admit, I've not seen a lot of projects doing it that way. If I understood correctly, -pthread should automatically make gcc link against libpthread. So as said the CFLAGS should also be passed to gcc at linking time, in that case explicit -lpthread flag seems redundant. my 2¢ Laurent Bigonville -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#712140: check: Missing dependency for static linking (libpthread)
Package: check Version: 0.9.10-2 Followup-For: Bug #712140 -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi! https://buildd.debian.org/status/fetch.php?pkg=checkarch=i386ver=0.9.10-2stamp=1370900543 The bug is not related to upstream. The macro in check.pc.in is not expanded because during configure, it was determined that pthread didn't need any flag: checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes Therefore, @PTHREAD_CFLAGS@ and @PTHREAD_LIBS@ are expanded to an empty string. The first check fails because there is no libpthreads in libc. Fine. However, I don't know why the second check succeeds. When I build the package in a clean chroot, I get: checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no checking for the pthreads library -llthread... no checking whether pthreads work with -pthread... yes My chroot was updated on June 15. The log above is from June 10. I suppose that in the meantime, there was some pthread stubs present in some library. Since there is no glibc update in the timeframe, so maybe in gcc. You should be able to solve the bug by asking for a rebuild. - -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (101, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.8-2-amd64 (SMP w/2 CPU cores) Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages check depends on: ii dpkg 1.16.10 ii install-info 5.1.dfsg.1-3 ii mawk 1.3.3-17 check recommends no packages. check suggests no packages. - -- no debconf information -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJRxX7oAAoJEJWkL+g1NSX5aCsP/Ax2b0hIZGzKXHvt4RJhsI9D nHZ1urpECruGYwrbJF6At2wVT0vj99yB4lVbYmoJP76+wX1a+Rjeha1mdYqnb4yc HYrMgJ/hLH1sjVFggXAiG3cp7ykhUoi93YvzKByMpuw2nEFbuK5iAfEujtg6EUDp 1/dGQbuZh8MX6vyG+EsvRZp8UV6IsCuEBiM2MFpr6y4d4khTGMhSRxz5mMK2ooQd jsRqteUrd06k1zX71YkqM6GezUx06qrFMoMe6zmkSrXgz1ofIQLOplVPuy2plD/K KB4AuceLWwWX54WIIco62APP4OBLeCUQ77pIBRinuHVM47QE4wadSkJBAZKE8w4D EGO5CpCDPgPJJO1+081IqwKUiRsYAT4cma9y6JGPVOIN2krz0OISRqtPnw1vYsJK 9kY+Uf7+I8wzOaAHkca/h0qnvXnW8MANfracwyF4dIqc07uq02vnJ85DT80CMKFv 7g9gKzbl4QhPvnyiyucwsDD+R4//2twExwtyozKEFg2PMhlbTbDkTrsibnJRHLTC CFzfYXf4/7MQMAyfh5s7vKYAvNDkc+iPplqpwYE/ujF0hnOHR/yc4C92GWb+Rll0 eoJY/R/6X3jm9bKOhgVeJVY/mB0KKdaBQqsjOHySW3UMK/0oc4fWAnKRk8NzdSOO ZIoOcvmKBTTalhWRgCiL =E+YR -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#712140: check: Missing dependency for static linking (libpthread)
Package: check Version: 0.9.10-2 Severity: grave Hi, It seems that the .pc file is missing the dependency against the libpthread library. This is breaking the build of (the upcoming version of) the sssd package. The check.pc.in file seems to include a macro for this, but for some reasons it's not expanded. Cheers Laurent Bigonville -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.9-1-amd64 (SMP w/8 CPU cores) Locale: LANG=fr_BE.utf8, LC_CTYPE=fr_BE.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages check depends on: ii dpkg 1.16.10 ii install-info 5.1.dfsg.1-3 ii mawk 1.3.3-17 check recommends no packages. check suggests no packages. -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org