Bug 190426 - [PATCH] net/libzmq2: fix pthread libs
Summary: [PATCH] net/libzmq2: fix pthread libs
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords:
: 190918 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-30 18:30 UTC by Dmitry Marakasov
Modified: 2014-09-30 02:26 UTC (History)
4 users (show)

See Also:


Attachments
libzmq2-2.2.0.patch (384 bytes, patch)
2014-05-30 18:30 UTC, Dmitry Marakasov
amdmi3: maintainer-approval? (gslin)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov 2014-05-30 18:30:00 UTC
More of a cosmetic fix: use PTHREAD_LIBS instead of hardcoded -pthread

Port maintainer (gslin@gslin.org) is cc'd.

Generated with FreeBSD Port Tools 1.02 (mode: change, diff: SVN)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-30 18:30:06 UTC
Maintainer of net/libzmq2,

Please note that PR ports/190426 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/190426

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-30 18:30:07 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2014-06-11 09:24:37 UTC
*** Bug 190918 has been marked as a duplicate of this bug. ***
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2014-06-11 11:30:14 UTC
It was changed to -pthread in this commit: http://svnweb.freebsd.org/ports?view=revision&revision=312209

PTHREAD_CFLAGS and PTHREAD_LIBS are deprecated.

In this case I think you can remove the entire post-patch target.  It adds -pthread to the pkgconfig file which means ports that depend on this port will also use -pthread, but this kind of propagation of -pthread hasn't been necessary since FreeBSD got rid of libc_r.  You should check if the dependent ports still build, but I'd be surprised if they don't and actually that would probably be a bug in those ports then, not in libzmq2.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2014-06-11 13:35:56 UTC
Wow, I wasn't aware of PTHREAD_LIBS deprecation. The commit was a year ago, why has it not been finished since then? Is it ok to remove -pthread replacements all over the tree now?

Regarding libzmq2, I guess I'll test depends first. Most of them need so version added to LIB_DEPENDS entry anyway.
Comment 6 Tijl Coosemans freebsd_committer freebsd_triage 2014-06-11 15:47:57 UTC
I'm not sure why it wasn't finished.  It's safe to remove PTHREAD_CFLAGS everywhere because that variable is empty nowadays.  PTHREAD_LIBS can be replaced with -pthread everywhere, but in many cases it can actually be removed.  It used to be that we had two libc's, one without threading (libc) and one with threading (libc_r).  If an executable used a library which required threading then the executable had to be linked with libc_r.  That's why many ports had PTHREAD_LIBS added when they had a dependency which used threading.  Nowadays libpthread is much more like a regular library and ports don't have to worry about such dependencies.  The only exception is dynamic loading (using dlopen) of a library that requires threading.  In that case the executable or library that calls dlopen needs to be linked with libpthread as well.  There aren't that many ports like this.  Examples are PHP and Ruby ports which can load external modules.
Comment 7 gslin 2014-06-11 18:56:43 UTC
I'm okay with this patch.
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2014-06-11 20:05:33 UTC
(In reply to gslin from comment #7)
> I'm okay with this patch.

What do you think about removing -pthread? What reason was it added for?