Gentoo Archives: gentoo-dev

From: "Andreas K. Huettel" <dilfridge@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] perl-module.eclass: respect CFLAGS, LDFLAGS - please review
Date: Sun, 22 Jun 2014 09:41:17
Message-Id: 201406221141.08772.dilfridge@gentoo.org
1 TL;DR:
2
3 Please review and test (also in exotic settings, arches, prefix?) the patch
4 below for perl-module.eclass
5
6 Sending this to the list since perl is pretty deep down in the system, and
7 since I'm not 100% sure of this stuff. Needs review.
8
9 Also people familiar with Perl have voiced doubts if we should meddle with the
10 perl-module CFLAGS and LDFLAGS at all, maybe making these changes conditional
11 on something like I_KNOW_WHAT_I_AM_DOING. Hoping for comments.
12
13 Detail discussion and test results follows below the patch.
14
15 =======================================
16
17 Index: perl-module.eclass
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v
20 retrieving revision 1.139
21 diff -u -B -r1.139 perl-module.eclass
22 --- perl-module.eclass 30 Mar 2014 19:25:14 -0000 1.139
23 +++ perl-module.eclass 22 Jun 2014 09:35:16 -0000
24 @@ -139,6 +139,8 @@
25 --libdoc= \
26 --destdir="${D}" \
27 --create_packlist=0 \
28 + --config "optimize=${CFLAGS}" \
29 + --config "lddlflags=-shared ${LDFLAGS}" \
30 "${myconf_local[@]}"
31 einfo "perl Build.PL" "$@"
32 perl Build.PL "$@" <<< "${pm_echovar}" \
33 @@ -150,6 +152,8 @@
34 INSTALLDIRS=vendor \
35 INSTALLMAN3DIR='none' \
36 DESTDIR="${D}" \
37 + OPTIMIZE="${CFLAGS}" \
38 + LDDLFLAGS="-shared ${LDFLAGS}" \
39 "${myconf_local[@]}"
40 einfo "perl Makefile.PL" "$@"
41 perl Makefile.PL "$@" <<< "${pm_echovar}" \
42 @@ -178,12 +182,12 @@
43 || die "Compilation failed"
44 elif [[ -f Makefile ]] ; then
45 set -- \
46 - OTHERLDFLAGS="${LDFLAGS}" \
47 + OPTIMIZE="${CFLAGS}" \
48 + LDDLFLAGS="-shared ${LDFLAGS}" \
49 "${mymake_local[@]}"
50 einfo "emake" "$@"
51 emake "$@" \
52 || die "Compilation failed"
53 -# OPTIMIZE="${CFLAGS}" \
54 fi
55 }
56
57
58 =======================================
59
60 The details:
61
62 Right now, if you build perl modules, e.g. ExtUtils::MakeMaker imports the
63 CFLAGS and LDFLAGS used when building dev-lang/perl. They are stored for
64 example in /usr/lib*/perl5/*/*/Config_heavy.pl in the "optimize" and
65 "lddlflags" variable.
66
67 The CFLAGS variable from the environment is not used at all; the cause for
68 this is so far unknown. (If things were working "according to spec", they
69 would be appended behind the "optimize" values... which is not really what we
70 want either.)
71
72 Once OPTIMIZE="${CFLAGS}" is set, it overwrites the value from
73 Config_heavy.pl. This means modules get built with the current CFLAGS.
74
75 We can also overwrite lddlflags with the make.conf LDFLAGS by setting the
76 mystic environment variable LDDLFLAGS (there's more than one way to do it!),
77 but for this to work I have to manually add the parameter "-shared".
78
79 ** I'm assuming here that Perl wants to have shared library objects everywhere
80 and that this parameter is accepted everywhere. If that is not true, please
81 suggest an improvement or cry "foul" ... :| **
82
83 https://bugs.gentoo.org/show_bug.cgi?id=261375
84
85 =======================================
86
87 Testing done
88 (in a chroot, amd64, stable except perl modules that are only ~arch and their
89 deps):
90
91 1) built a module using ExtUtils::MakeMaker against "perl with wrong flags"
92 and checked log for flags (perl-core/Encode)
93 2) built a module using ModUtils::Build against "perl with wrong flags" and
94 checked log for flags (dev-perl/Class-Load-XS)
95 3) built (nearly) everything using perl-modules.eclass (~1400 packages, either
96 newest stable or if no stable ebuild newest ~arch) and checked for obvious
97 problems by grepping the logs
98
99 Test results from 1)
100 All good.
101
102 Test results from 2)
103 Both CFLAGS and LDFLAGS are (still) inserted double. Reason so far unclear,
104 odd but not problematic.
105
106 Test results from 3)
107
108 Before patching eclass:
109 240 packages throwing CFLAGS QA warning
110
111 After modification, the following packages still throw CFLAGS QA warning:
112 app-mobilephone/obexftp-0.23-r2
113 dev-perl/Wx-Scintilla-0.390.0
114 media-libs/ming-0.4.4
115 net-analyzer/net-snmp-5.7.3_pre3
116 net-analyzer/rrdtool-1.4.8
117 www-apache/libapreq2-2.13
118 www-apache/mod_perl-2.0.7
119
120 After modification, *IN ADDITION TO THOSE ABOVE* the "bad" flags occur in the
121 logs of the following packages:
122 app-pda/pilot-link-0.12.5
123 dev-libs/stfl-0.22-r1
124 dev-perl/Text-BibTeX-0.690.0
125 dev-perl/math-pari-2.10.806.50
126 dev-vcs/subversion-1.7.14
127 games-arcade/frozen-bubble-2.2.1_beta1
128 sci-biology/vienna-rna-1.8.5
129 sci-libs/gdal-1.10.1
130 sys-fs/owfs-2.7_p21-r2
131 sys-libs/libapparmor-2.8.3
132
133 No additional build failures.
134
135 --
136
137 Andreas K. Huettel
138 Gentoo Linux developer
139 dilfridge@g.o
140 http://www.akhuettel.de/

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies