Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 21:50:22 +0200 (CEST)
From:      Marcus von Appen <mva@freebsd.org>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        freebsd-python@freebsd.org
Subject:   [PATCH]: lang/python26+ must not set OPT
Message-ID:  <201206061950.q56JoMlq080679@medusa.sysfault.org>

next in thread | raw e-mail | index | archive | help

>Submitter-Id:	current-users
>Originator:	Marcus von Appen
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH]: lang/python26+ must not set OPT
>Severity:	non-critical
>Priority:	medium
>Category:	ports
>Class:		sw-bug
>Release:	FreeBSD 9.0-STABLE amd64
>Environment:
System: FreeBSD medusa.sysfault.org 9.0-STABLE FreeBSD 9.0-STABLE #0: Mon May 14 15:08:44 CEST 2012 root@medusa.sysfault.org:/usr/obj/usr/src/sys/MEDUSA amd64


	
>Description:
	Python 2.6 and newer implicitly uses the environment's CFLAGS
        settings for the build of all binaries and modules.

        The CFLAGS are stored in
        ${LOCALBASE}/lib/pythonX.X*/config*/Makefile and picked up by
        distutils for building extension modules.

        Assigning CFLAGS to OPTS in CONFIGURE_ENV leads to the following
        issues:

        * not fully debug clean, since -DNDEBUG is not propagated,
          although OPT= is a user option, but not a full debug build
          either
        * duplicate CFLAGS for extension module, complicating CFLAGS
          debugging for users
        * OPT is not for CFLAGS

        lang/python25- use OPT and other environment variables to
        influence the build for the target platform, so for the time
        being OPT needs to receive ${CFLAGS} on those.

>How-To-Repeat:
	Build any of lang/python26+

        # sed -n -e '/^CFLAGS=/p' -e '/^OPT=/p' \
              /usr/local/lib/pythonX.X/config/Makefile
        OPT=		-DNDEBUG -O2 -fno-strict-aliasing -pipe -march=nocona
        CFLAGS=		$(BASECFLAGS) -O2 -fno-strict-aliasing -pipe -march=nocona  $(OPT) $(EXTRA_CFLAGS)

>Fix:

Index: python26/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python26/Makefile,v
retrieving revision 1.185
diff -u -r1.185 Makefile
--- python26/Makefile	31 May 2012 15:17:32 -0000	1.185
+++ python26/Makefile	6 Jun 2012 17:00:00 -0000
@@ -21,7 +21,7 @@
 PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	OPT="${CFLAGS}" SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd"
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
 USE_LDCONFIG=	yes
 MAKE_JOBS_SAFE=	yes
Index: python27/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python27/Makefile,v
retrieving revision 1.188
diff -u -r1.188 Makefile
--- python27/Makefile	31 May 2012 15:17:32 -0000	1.188
+++ python27/Makefile	6 Jun 2012 17:00:00 -0000
@@ -21,7 +21,7 @@
 PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	OPT="${CFLAGS}" SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd"
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
 USE_LDCONFIG=	yes
 MAKE_JOBS_SAFE=	yes
Index: python31/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python31/Makefile,v
retrieving revision 1.182
diff -u -r1.182 Makefile
--- python31/Makefile	31 May 2012 10:13:55 -0000	1.182
+++ python31/Makefile	6 Jun 2012 17:00:00 -0000
@@ -21,7 +21,7 @@
 PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	OPT="${CFLAGS}" SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd"
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
 MAKE_JOBS_SAFE=	yes
 USE_LDCONFIG=	yes
Index: python32/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python32/Makefile,v
retrieving revision 1.186
diff -u -r1.186 Makefile
--- python32/Makefile	31 May 2012 10:13:55 -0000	1.186
+++ python32/Makefile	6 Jun 2012 17:00:00 -0000
@@ -21,7 +21,7 @@
 PATCH_WRKSRC=	${PYTHON_WRKSRC}
 GNU_CONFIGURE=	yes
 CONFIGURE_SCRIPT=	../configure # must be relative
-CONFIGURE_ENV=	OPT="${CFLAGS}" SVNVERSION="echo freebsd"
+CONFIGURE_ENV=	OPT="" SVNVERSION="echo freebsd"
 MAKE_ENV=	VPATH="${PYTHON_WRKSRC}"
 MAKE_JOBS_SAFE=	yes
 USE_LDCONFIG=	yes



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206061950.q56JoMlq080679>