From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2341613877A for ; Sun, 22 Jun 2014 09:41:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0BAFFE08EA; Sun, 22 Jun 2014 09:41:12 +0000 (UTC) Received: from mo4-p05-ob.smtp.rzone.de (mo4-p05-ob.smtp.rzone.de [81.169.146.180]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EC022E08DD for ; Sun, 22 Jun 2014 09:41:10 +0000 (UTC) X-RZG-AUTH: :IW0NeWCpcPchHrcnS4ebzBgQnKHTmUiSF2JlOcyz+57jTVMtVX7771jWiJc= X-RZG-CLASS-ID: mo05 Received: from pinacolada.localnet (95-130-165-192.hsi.glasfaser-ostbayern.de [95.130.165.192]) by smtp.strato.de (RZmta 34.5 AUTH) with ESMTPSA id R074f8q5M9f98jm (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) for ; Sun, 22 Jun 2014 11:41:09 +0200 (CEST) From: "Andreas K. Huettel" To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] perl-module.eclass: respect CFLAGS, LDFLAGS - please review Date: Sun, 22 Jun 2014 11:41:01 +0200 User-Agent: KMail/1.13.7 (Linux/3.12.21-gentoo-r1; KDE/4.13.1; x86_64; ; ) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3233010.MB4rubBX9S"; protocol="application/pgp-signature"; micalg=pgp-sha512 Content-Transfer-Encoding: 7bit Message-Id: <201406221141.08772.dilfridge@gentoo.org> X-Archives-Salt: 44442986-1d22-4841-9d3b-e2101e938c81 X-Archives-Hash: 57f56ee0238bf843b89c0bf33e1d8c1a --nextPart3233010.MB4rubBX9S Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable TL;DR:=20 Please review and test (also in exotic settings, arches, prefix?) the patch= =20 below for perl-module.eclass Sending this to the list since perl is pretty deep down in the system, and= =20 since I'm not 100% sure of this stuff. Needs review. Also people familiar with Perl have voiced doubts if we should meddle with = the=20 perl-module CFLAGS and LDFLAGS at all, maybe making these changes condition= al=20 on something like I_KNOW_WHAT_I_AM_DOING. Hoping for comments. Detail discussion and test results follows below the patch. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: perl-module.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v retrieving revision 1.139 diff -u -B -r1.139 perl-module.eclass =2D-- perl-module.eclass 30 Mar 2014 19:25:14 -0000 1.139 +++ perl-module.eclass 22 Jun 2014 09:35:16 -0000 @@ -139,6 +139,8 @@ --libdoc=3D \ --destdir=3D"${D}" \ --create_packlist=3D0 \ + --config "optimize=3D${CFLAGS}" \ + --config "lddlflags=3D-shared ${LDFLAGS}" \ "${myconf_local[@]}" einfo "perl Build.PL" "$@" perl Build.PL "$@" <<< "${pm_echovar}" \ @@ -150,6 +152,8 @@ INSTALLDIRS=3Dvendor \ INSTALLMAN3DIR=3D'none' \ DESTDIR=3D"${D}" \ + OPTIMIZE=3D"${CFLAGS}" \ + LDDLFLAGS=3D"-shared ${LDFLAGS}" \ "${myconf_local[@]}" einfo "perl Makefile.PL" "$@" perl Makefile.PL "$@" <<< "${pm_echovar}" \ @@ -178,12 +182,12 @@ || die "Compilation failed" elif [[ -f Makefile ]] ; then set -- \ =2D OTHERLDFLAGS=3D"${LDFLAGS}" \ + OPTIMIZE=3D"${CFLAGS}" \ + LDDLFLAGS=3D"-shared ${LDFLAGS}" \ "${mymake_local[@]}" einfo "emake" "$@" emake "$@" \ || die "Compilation failed" =2D# OPTIMIZE=3D"${CFLAGS}" \ fi } =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The details:=20 Right now, if you build perl modules, e.g. ExtUtils::MakeMaker imports the= =20 CFLAGS and LDFLAGS used when building dev-lang/perl. They are stored for=20 example in /usr/lib*/perl5/*/*/Config_heavy.pl in the "optimize" and=20 "lddlflags" variable.=20 The CFLAGS variable from the environment is not used at all; the cause for= =20 this is so far unknown. (If things were working "according to spec", they=20 would be appended behind the "optimize" values... which is not really what = we=20 want either.) Once OPTIMIZE=3D"${CFLAGS}" is set, it overwrites the value from=20 Config_heavy.pl. This means modules get built with the current CFLAGS.=20 We can also overwrite lddlflags with the make.conf LDFLAGS by setting the=20 mystic environment variable LDDLFLAGS (there's more than one way to do it!)= ,=20 but for this to work I have to manually add the parameter "-shared".=20 ** I'm assuming here that Perl wants to have shared library objects everywh= ere=20 and that this parameter is accepted everywhere. If that is not true, please= =20 suggest an improvement or cry "foul" ... :| ** https://bugs.gentoo.org/show_bug.cgi?id=3D261375 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Testing done=20 (in a chroot, amd64, stable except perl modules that are only ~arch and the= ir=20 deps):=20 1) built a module using ExtUtils::MakeMaker against "perl with wrong flags"= =20 and checked log for flags (perl-core/Encode) 2) built a module using ModUtils::Build against "perl with wrong flags" and= =20 checked log for flags (dev-perl/Class-Load-XS) 3) built (nearly) everything using perl-modules.eclass (~1400 packages, eit= her=20 newest stable or if no stable ebuild newest ~arch) and checked for obvious= =20 problems by grepping the logs Test results from 1) All good. Test results from 2) Both CFLAGS and LDFLAGS are (still) inserted double. Reason so far unclear,= =20 odd but not problematic. Test results from 3) Before patching eclass: 240 packages throwing CFLAGS QA warning After modification, the following packages still throw CFLAGS QA warning: app-mobilephone/obexftp-0.23-r2 dev-perl/Wx-Scintilla-0.390.0 media-libs/ming-0.4.4 net-analyzer/net-snmp-5.7.3_pre3 net-analyzer/rrdtool-1.4.8 www-apache/libapreq2-2.13 www-apache/mod_perl-2.0.7 After modification, *IN ADDITION TO THOSE ABOVE* the "bad" flags occur in t= he=20 logs of the following packages: app-pda/pilot-link-0.12.5 dev-libs/stfl-0.22-r1 dev-perl/Text-BibTeX-0.690.0 dev-perl/math-pari-2.10.806.50 dev-vcs/subversion-1.7.14 games-arcade/frozen-bubble-2.2.1_beta1 sci-biology/vienna-rna-1.8.5 sci-libs/gdal-1.10.1 sys-fs/owfs-2.7_p21-r2 sys-libs/libapparmor-2.8.3 No additional build failures. =2D-=20 Andreas K. Huettel Gentoo Linux developer=20 dilfridge@gentoo.org http://www.akhuettel.de/ --nextPart3233010.MB4rubBX9S Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQJ8BAABCgBmBQJTpqS0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwNzlCRDk4QzA4RENBRkYzQUEwRjQzMDlF QkU2QTMzNkJFMTkwMzlDAAoJEOvmoza+GQOcMacQALnBIW3bzp3TdeA0RqVnXAQv WX/BaxYSm+Yv0Wjx2T8UpX7DSg8kP4GTK4UGERKCZXc99yNPF48UVVhY5BdFjLut 8lVnTj+8ejcJCW6avoxGpKnWBNQsfx1J9N1PPZgO49pmLkWFLJ0rXRUC9p5KO/0R EK4AGJMAxTJ8ZXmmXlX+dBx7LIzi9V4jih7cWUhF7XQZk8+7FhbKfe+XyG4twCpF QZPv8szNwoJaIBCbQ4ptF1sMvdFt3M1zbGHYtfcdp43xr1KSPJmhwuyBXXvhCCBB k/9/0Mx7OTRNpyPN7gKWhmBtYPZzUN2Y67W9/Qhjl6KeXwCxcLzYNYBFFkwum1Jh zScTk/OOsXVYmESqQiVpzGLcx3vWiDQs3yCn7PzMzt0Pdz609zrlqYWMiXRrou0f thibRI31nIivygTz7bn0T17vNtGB8Lu/WBpy/3Zc8aLk64YDMF/J4qMZE4sXxK4l ZdiBcmtu+o0Xvw89AhvUNpQkcKyrO3zFRKJQ5oaO0jdj7c55FzDf+bS86Kk6iCm+ Ct05eNUASmjAY1VcE+VzCHiaYVfUyXi3Lqipu8dxNGlzHlY/hIH2cA/xjUqlYcNS RX3zZJZ5zKrH05Xsc6zgGNxpIClA9lIyfdSBpfePESFv1hE/HgO93scgMsNSgFpr tIUqb8CeshWdQwbLtK78 =z/AR -----END PGP SIGNATURE----- --nextPart3233010.MB4rubBX9S--