Bug 182952 - [PATCH] lang/python wrong cflags in python-config on systems where cc = clang
Summary: [PATCH] lang/python wrong cflags in python-config on systems where cc = clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-13 19:50 UTC by Pawel Pekala
Modified: 2013-11-24 14:13 UTC (History)
0 users

See Also:


Attachments
file.diff (1.99 KB, patch)
2013-10-13 19:50 UTC, Pawel Pekala
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Pekala freebsd_committer freebsd_triage 2013-10-13 19:50:00 UTC
This issue affects FreeBSD 10 with clang as primary compiler (cc).

When compiling python configure script wrongly detects that system compiler
supports -OPT:Olimit=0 flag:

checking whether cc accepts -fno-strict-aliasing... yes
checking whether cc accepts -OPT:Olimit=0... yes

clang seems to ignore this flags and configure script comes to bad conclusion.

This breaks consumers using python-config scripts to get python cflags:

[corn:~]> python-config --cflags
-I/usr/local/include/python2.7 -I/usr/local/include/python2.7 -fno-strict-aliasing -OPT:Olimit=0 -O2 -pipe -fno-strict-aliasing -DNDEBUG

Olimit is there, while clang will be happy to ignore it, gcc will fail. I
discovered this trying to build print/lilypond.

Upstream bug: http://bugs.python.org/issue877121

lang/python32 and lang/python33 appears to be unaffected by this

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-13 19:50:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2013-10-19 06:12:07 UTC
Responsible Changed
From-To: freebsd-python->koobs

I'll take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-11-24 13:22:48 UTC
Author: koobs
Date: Sun Nov 24 13:22:40 2013
New Revision: 334723
URL: http://svnweb.freebsd.org/changeset/ports/334723

Log:
  lang/python27: Update to 2.7.6
  
  - Update to 2.7.6
  - Update pkg-plist
  - Temporarily override OPT:Olimit using CONFIGURE_ENV (ports/182952) [1]
  - Replace patch: extra-patch-configure-pth with CONFIGURE_ENV instead
  - Remove patch: patch-Modules-_ctypes-libffi_fficonfig.py.in [2]
  - QA: Clean up and group related USE_*, WRKSRC and CONFIGURE entries
  - QA: Whitespace alignment
  
  Changes: 2.7.6 - November 10, 2013
  
  http://www.python.org/download/releases/2.7.6/
  
  [1] Python removed OPT:Olimit in 3.2+, requested backport or
      alternative upstream patch: http://bugs.python.org/issue877121
  [2] Upstreamed: http://bugs.python.org/issue18178
  
  PR:		ports/182952
  PR:		ports/156759
  Reviewed by:	antoine, mva

Deleted:
  head/lang/python27/files/extra-patch-configure-pth
  head/lang/python27/files/patch-Modules-_ctypes-libffi_fficonfig.py.in
Modified:
  head/Mk/bsd.python.mk
  head/lang/python27/Makefile
  head/lang/python27/distinfo   (contents, props changed)
  head/lang/python27/pkg-plist

Modified: head/Mk/bsd.python.mk
==============================================================================
--- head/Mk/bsd.python.mk	Sun Nov 24 13:05:25 2013	(r334722)
+++ head/Mk/bsd.python.mk	Sun Nov 24 13:22:40 2013	(r334723)
@@ -378,9 +378,9 @@ PYTHON_VER=		3.1
 
 # Python-2.7
 .elif ${PYTHON_VERSION} == "python2.7"
-PYTHON_PORTVERSION?=	2.7.5
+PYTHON_PORTVERSION?=	2.7.6
 PYTHON_PORTSDIR=	${PORTSDIR}/lang/python27
-PYTHON_REL=		275
+PYTHON_REL=		276
 PYTHON_SUFFIX=		27
 PYTHON_VER=		2.7
 

Modified: head/lang/python27/Makefile
==============================================================================
--- head/lang/python27/Makefile	Sun Nov 24 13:05:25 2013	(r334722)
+++ head/lang/python27/Makefile	Sun Nov 24 13:22:40 2013	(r334723)
@@ -2,8 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	python27
-PORTVERSION=	2.7.5
-PORTREVISION=	4
+PORTVERSION=	2.7.6
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	PYTHON
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -13,22 +12,24 @@ MAINTAINER=	python@FreeBSD.org
 COMMENT=	Interpreted object-oriented programming language
 
 DIST_SUBDIR=	python
-WRKSRC=		${PYTHON_WRKSRC}/portbld.static
-PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	SVNVERSION="echo freebsd" ac_cv_opt_olimit_ok=no
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
-USE_LDCONFIG=	yes
 INSTALL_TARGET=	altinstall
 MAN1=		${PYTHON_VERSION}.1
 
+USE_LDCONFIG=	yes
 USE_PYTHON=	yes
 USE_XZ=		yes
-PYTHON_VERSION=	python2.7
+
+PYTHON_VERSION=		python2.7
 PYTHON_NO_DEPENDS=	yes
 
+WRKSRC=		${PYTHON_WRKSRC}/portbld.static
 SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.shared
+PATCH_WRKSRC=	${PYTHON_WRKSRC}
+
 PLIST=		${WRKDIR}/PLIST
 PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
@@ -87,7 +88,7 @@ SUB_LIST=	SEM=${SEM_MSG}
 PLIST_SUB+=	THREADS=""
 .if ${PORT_OPTIONS:MPTH}
 CONFIGURE_ARGS+=	--with-pth --with-system-ffi
-EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-configure-pth
+CONFIGURE_ENV+=		ac_cv_pthread=no
 LIB_DEPENDS+=		pth:${PORTSDIR}/devel/pth \
 			ffi:${PORTSDIR}/devel/libffi
 _PTH_CPPFLAGS=		"-I${LOCALBASE}/include/pth"

Modified: head/lang/python27/distinfo
==============================================================================
--- head/lang/python27/distinfo	Sun Nov 24 13:05:25 2013	(r334722)
+++ head/lang/python27/distinfo	Sun Nov 24 13:22:40 2013	(r334723)
@@ -1,2 +1,2 @@
-SHA256 (python/Python-2.7.5.tar.xz) = f33c4cab167dc69e10962e1cebf1c0768e2d0e8575648130c20e6bda84551db1
-SIZE (python/Python-2.7.5.tar.xz) = 10252148
+SHA256 (python/Python-2.7.6.tar.xz) = 1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1
+SIZE (python/Python-2.7.6.tar.xz) = 10431288

Modified: head/lang/python27/pkg-plist
==============================================================================
--- head/lang/python27/pkg-plist	Sun Nov 24 13:05:25 2013	(r334722)
+++ head/lang/python27/pkg-plist	Sun Nov 24 13:22:40 2013	(r334723)
@@ -812,6 +812,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/bom.py
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/crlf.py
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/different_encoding.py
+%%PYTHON_LIBDIR%%/lib2to3/tests/data/false_encoding.py
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/fixers/bad_order.py
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/fixers/myfixes/__init__.py
 %%PYTHON_LIBDIR%%/lib2to3/tests/data/fixers/myfixes/fix_explicit.py
@@ -1061,6 +1062,20 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/185test.db
 %%PYTHON_LIBDIR%%/test/Sine-1000Hz-300ms.aif
 %%PYTHON_LIBDIR%%/test/__init__.py
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm24.aiff
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm24.wav
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm16.aiff
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm16.au
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm16.wav
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm32.aiff
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm32.au
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm32.wav
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm8.aiff
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm8.au
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-pcm8.wav
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-ulaw.aifc
+%%PYTHON_LIBDIR%%/test/audiodata/pluck-ulaw.au
+%%PYTHON_LIBDIR%%/test/audiotests.py
 %%PYTHON_LIBDIR%%/test/audiotest.au
 %%PYTHON_LIBDIR%%/test/autotest.py
 %%PYTHON_LIBDIR%%/test/bad_coding.py
@@ -1275,6 +1290,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/mapping_tests.py
 %%PYTHON_LIBDIR%%/test/math_testcases.txt
 %%PYTHON_LIBDIR%%/test/mp_fork_bomb.py
+%%PYTHON_LIBDIR%%/test/nullbytecert.pem
 %%PYTHON_LIBDIR%%/test/nullcert.pem
 %%PYTHON_LIBDIR%%/test/outstanding_bugs.py
 %%PYTHON_LIBDIR%%/test/pickletester.py
@@ -1478,6 +1494,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/test_htmlparser.py
 %%PYTHON_LIBDIR%%/test/test_httplib.py
 %%PYTHON_LIBDIR%%/test/test_httpservers.py
+%%PYTHON_LIBDIR%%/test/test_idle.py
 %%PYTHON_LIBDIR%%/test/test_imageop.py
 %%PYTHON_LIBDIR%%/test/test_imaplib.py
 %%PYTHON_LIBDIR%%/test/test_imgfile.py
@@ -1510,6 +1527,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/test_macos.py
 %%PYTHON_LIBDIR%%/test/test_macostools.py
 %%PYTHON_LIBDIR%%/test/test_macpath.py
+%%PYTHON_LIBDIR%%/test/test_macurl2path.py
 %%PYTHON_LIBDIR%%/test/test_mailbox.py
 %%PYTHON_LIBDIR%%/test/test_marshal.py
 %%PYTHON_LIBDIR%%/test/test_math.py
@@ -1533,6 +1551,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/test_netrc.py
 %%PYTHON_LIBDIR%%/test/test_new.py
 %%PYTHON_LIBDIR%%/test/test_nis.py
+%%PYTHON_LIBDIR%%/test/test_nntplib.py
 %%PYTHON_LIBDIR%%/test/test_normalization.py
 %%PYTHON_LIBDIR%%/test/test_ntpath.py
 %%PYTHON_LIBDIR%%/test/test_old_mailbox.py
@@ -1613,6 +1632,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/test_sqlite.py
 %%PYTHON_LIBDIR%%/test/test_ssl.py
 %%PYTHON_LIBDIR%%/test/test_startfile.py
+%%PYTHON_LIBDIR%%/test/test_stat.py
 %%PYTHON_LIBDIR%%/test/test_str.py
 %%PYTHON_LIBDIR%%/test/test_strftime.py
 %%PYTHON_LIBDIR%%/test/test_string.py
@@ -1624,6 +1644,7 @@ lib/lib%%PYTHON_VERSION%%.so.1
 %%PYTHON_LIBDIR%%/test/test_structmembers.py
 %%PYTHON_LIBDIR%%/test/test_structseq.py
 %%PYTHON_LIBDIR%%/test/test_subprocess.py
+%%PYTHON_LIBDIR%%/test/test_sunau.py
 %%PYTHON_LIBDIR%%/test/test_sunaudiodev.py
 %%PYTHON_LIBDIR%%/test/test_sundry.py
 %%PYTHON_LIBDIR%%/test/test_support.py
@@ -2367,6 +2388,7 @@ lib/libpython2.7.a
 @dirrm %%PYTHON_LIBDIR%%/wsgiref
 @dirrm %%PYTHON_LIBDIR%%/unittest/test
 @dirrm %%PYTHON_LIBDIR%%/unittest
+@dirrm %%PYTHON_LIBDIR%%/test/audiodata
 @dirrm %%PYTHON_LIBDIR%%/test/cjkencodings
 @dirrm %%PYTHON_LIBDIR%%/test/data
 @dirrm %%PYTHON_LIBDIR%%/test/decimaltestdata
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-11-24 14:03:51 UTC
Author: koobs
Date: Sun Nov 24 14:03:44 2013
New Revision: 334727
URL: http://svnweb.freebsd.org/changeset/ports/334727

Log:
  lang/python26: Fix CFLAGS in python-config where cc = clang
  
  - Temporarily override OPT:Olimit using CONFIGURE_ENV (ports/182952) [1]
  - Replace patch: extra-patch-configure-pth with CONFIGURE_ENV instead
  - QA: Clean up and group related USE_*, WRKSRC and CONFIGURE entries
  - QA: Whitespace alignment
  - QA: Clarify DEPRECATED message
  
  [1] Python removed OPT:Olimit in 3.2+, requested backport or
      alternative upstream patch: http://bugs.python.org/issue877121
  
  PR:		ports/182952
  Submitted by:	pawel
  Reviewed by:	antoine

Deleted:
  head/lang/python26/files/extra-patch-configure-pth
Modified:
  head/lang/python26/Makefile

Modified: head/lang/python26/Makefile
==============================================================================
--- head/lang/python26/Makefile	Sun Nov 24 13:47:48 2013	(r334726)
+++ head/lang/python26/Makefile	Sun Nov 24 14:03:44 2013	(r334727)
@@ -3,6 +3,7 @@
 
 PORTNAME=	python26
 PORTVERSION=	2.6.9
+PORTREVISION=	1
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	PYTHON
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -11,26 +12,28 @@ DISTFILES=	${PYTHON_DISTFILE}
 MAINTAINER=	python@FreeBSD.org
 COMMENT=	Interpreted object-oriented programming language
 
-DEPRECATED=	This port reached its EoL upstream, please migrate to lang/python27
+DEPRECATED=	Python 2.6 is now end-of-life, please migrate to lang/python27
 EXPIRATION_DATE=2014-01-01
 
 DIST_SUBDIR=	python
-WRKSRC=		${PYTHON_WRKSRC}/portbld.static
-PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	SVNVERSION="echo freebsd" ac_cv_opt_olimit_ok=no
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
-USE_LDCONFIG=	yes
 INSTALL_TARGET=	altinstall
 MAN1=		${PYTHON_VERSION}.1
 
+USE_LDCONFIG=	yes
 USE_PYTHON=	yes
 USE_XZ=		yes
-PYTHON_VERSION=	python2.6
+
+PYTHON_VERSION=		python2.6
 PYTHON_NO_DEPENDS=	yes
 
+WRKSRC=		${PYTHON_WRKSRC}/portbld.static
 SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.shared
+PATCH_WRKSRC=	${PYTHON_WRKSRC}
+
 PLIST=		${WRKDIR}/PLIST
 PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
@@ -53,7 +56,7 @@ BINLINKS_SUB_PYTHON_VER=	${BINLINKS_SUB_
 OPTIONS_DEFINE=		THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES NLS
 OPTIONS_DEFAULT=	THREADS UCS4 PYMALLOC IPV6
 
-OPTIONS_SINGLE=	UCS
+OPTIONS_SINGLE=		UCS
 OPTIONS_SINGLE_UCS=	UCS2 UCS4
 
 NLS_DESC=	Enable Gettext support for the locale module
@@ -92,7 +95,7 @@ SUB_LIST=	SEM=${SEM_MSG}
 PLIST_SUB+=	THREADS=""
 .if ${PORT_OPTIONS:MPTH}
 CONFIGURE_ARGS+=	--with-pth
-EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-configure-pth
+CONFIGURE_ENV+=		ac_cv_pthread=no
 LIB_DEPENDS+=		pth:${PORTSDIR}/devel/pth
 _PTH_CPPFLAGS=		"-I${LOCALBASE}/include/pth"
 _PTH_LDFLAGS=		"-L${LOCALBASE}/lib/pth"
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-11-24 14:05:38 UTC
Author: koobs
Date: Sun Nov 24 14:05:30 2013
New Revision: 334728
URL: http://svnweb.freebsd.org/changeset/ports/334728

Log:
  lang/python31: Fix CFLAGS in python-config where cc = clang
  
  - Temporarily override OPT:Olimit using CONFIGURE_ENV (ports/182952) [1]
  - QA: Clean up and group related USE_*, WRKSRC and CONFIGURE entries
  - QA: Whitespace alignment
  - QA: Clarify DEPRECATED message
  
  [1] Python removed OPT:Olimit in 3.2+, requested backport or
      alternative upstream patch: http://bugs.python.org/issue877121
  
  PR:		ports/182952
  Submitted by:	pawel
  Reviewed by:	antoine

Modified:
  head/lang/python31/Makefile

Modified: head/lang/python31/Makefile
==============================================================================
--- head/lang/python31/Makefile	Sun Nov 24 14:03:44 2013	(r334727)
+++ head/lang/python31/Makefile	Sun Nov 24 14:05:30 2013	(r334728)
@@ -2,7 +2,7 @@
 
 PORTNAME=	python31
 PORTVERSION=	3.1.5
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	PYTHON
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -11,26 +11,28 @@ DISTFILES=	${PYTHON_DISTFILE}
 MAINTAINER=	python@FreeBSD.org
 COMMENT=	Interpreted object-oriented programming language
 
-DEPRECATED=	This port will reach it's EoL upstream soon, please migrate to lang/python33
+DEPRECATED=	Python 3.1 will be end-of-life soon, please migrate to lang/python33
 EXPIRATION_DATE=2014-06-01
 
 DIST_SUBDIR=	python
-WRKSRC=		${PYTHON_WRKSRC}/portbld.static
-PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd" ac_cv_opt_olimit_ok=no
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
-USE_LDCONFIG=	yes
 INSTALL_TARGET=	altinstall
 MAN1=		${PYTHON_VERSION}.1
 
+USE_LDCONFIG=	yes
 USE_PYTHON=	yes
 USE_XZ=		yes
+
 PYTHON_VERSION=	python3.1
 PYTHON_NO_DEPENDS=	yes
 
+WRKSRC=		${PYTHON_WRKSRC}/portbld.static
 SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.shared
+PATCH_WRKSRC=	${PYTHON_WRKSRC}
+
 PLIST=		${WRKDIR}/PLIST
 PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2013-11-24 14:13:40 UTC
State Changed
From-To: open->closed

Committed, along with additional non-functional changes. Thank you 
Pawel!