Bug 198116 - [patch] graphics/gdal : don't substitute -lpthread with -pthread anymore
Summary: [patch] graphics/gdal : don't substitute -lpthread with -pthread anymore
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-03-01 10:01 UTC by John Marino
Modified: 2015-03-22 20:13 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
removal of -pthread substitution (506 bytes, patch)
2015-03-01 10:01 UTC, John Marino
no flags Details | Diff
updated patch (725 bytes, patch)
2015-03-01 14:40 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino freebsd_committer freebsd_triage 2015-03-01 10:01:12 UTC
Created attachment 153637 [details]
removal of -pthread substitution

There is no reason to use -pthread anymore.  At best there is no difference and at worst it can break the build in some cases.

The simple attached patch should be applied to gdal.  I don't see a reason for a revbump though.  I didn't thoroughly test this on all releases though.
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2015-03-01 10:11:57 UTC
Remark: ${PTHREAD_LIBS} is still defined in ports/Mk/bsd.port.mk as:

PTHREAD_LIBS?=            -pthread

I've never seen a case where it would break the build, but in that case, it should be modified too.
Comment 2 John Marino freebsd_committer freebsd_triage 2015-03-01 10:14:30 UTC
good catch!

I'll CC portmgr.

Portmgr, does removing -pthread from bsd.port.mk require a second PR?
Comment 3 John Marino freebsd_committer freebsd_triage 2015-03-01 10:15:55 UTC
I'll also CC tijl because if I recall correctly, he's the resident expert on this topic.
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2015-03-01 12:18:06 UTC
FreeBSD used to have two libc, one without threading (libc.so) and one with (libc_r.so).  With -pthread the compiler would link with libc_r instead of libc.  Nowadays there's only one libc and -pthread tells the compiler to link with libpthread, exactly like -lpthread does.  Both work and patches that change -lpthread into -pthread or vice versa are redundant.
Comment 5 John Marino freebsd_committer freebsd_triage 2015-03-01 14:40:21 UTC
Created attachment 153641 [details]
updated patch

The first patch missed one -pthread to change
Comment 6 John Marino freebsd_committer freebsd_triage 2015-03-22 16:35:07 UTC
sunpoet -- this PR timed out.  I am authorized to commit the patch at any time.  I'll leave it for a couple more days though.
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-03-22 20:11:32 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Mar 22 20:11:18 UTC 2015
New revision: 381955
URL: https://svnweb.freebsd.org/changeset/ports/381955

Log:
  - Use -lpthread instead of -pthread

  PR:		198116
  Submitted by:	marino

Changes:
  head/graphics/gdal/Makefile
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2015-03-22 20:13:32 UTC
Committed. Thanks!