Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog multilib-build.eclass
Date: Fri, 23 May 2014 07:47:43
Message-Id: 20140523074740.150DD2004C@flycatcher.gentoo.org
1 mgorny 14/05/23 07:47:40
2
3 Modified: ChangeLog multilib-build.eclass
4 Log:
5 Use MULTILIB_ABI_FLAG for header wrapping. Also, use explicit error when ABI is omitted in wrapper template.
6
7 Revision Changes Path
8 1.1269 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1269&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1269&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1268&r2=1.1269
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.1268
18 retrieving revision 1.1269
19 diff -u -r1.1268 -r1.1269
20 --- ChangeLog 23 May 2014 07:39:26 -0000 1.1268
21 +++ ChangeLog 23 May 2014 07:47:39 -0000 1.1269
22 @@ -1,6 +1,10 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1268 2014/05/23 07:39:26 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1269 2014/05/23 07:47:39 mgorny Exp $
27 +
28 + 23 May 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
29 + Use MULTILIB_ABI_FLAG for header wrapping. Also, use explicit error when ABI
30 + is omitted in wrapper template.
31
32 23 May 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
33 Deprecate multilib_for_best_abi() to decrease confusion.
34
35
36
37 1.52 eclass/multilib-build.eclass
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.52&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.52&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?r1=1.51&r2=1.52
42
43 Index: multilib-build.eclass
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v
46 retrieving revision 1.51
47 retrieving revision 1.52
48 diff -u -r1.51 -r1.52
49 --- multilib-build.eclass 23 May 2014 07:39:26 -0000 1.51
50 +++ multilib-build.eclass 23 May 2014 07:47:39 -0000 1.52
51 @@ -1,6 +1,6 @@
52 # Copyright 1999-2014 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.51 2014/05/23 07:39:26 mgorny Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.52 2014/05/23 07:47:39 mgorny Exp $
56
57 # @ECLASS: multilib-build.eclass
58 # @MAINTAINER:
59 @@ -411,35 +411,12 @@
60 done
61
62 if [[ ${MULTILIB_WRAPPED_HEADERS[@]} ]]; then
63 - # XXX: get abi_* directly
64 - local abi_flag
65 - case "${ABI}" in
66 - amd64|amd64_fbsd)
67 - abi_flag=abi_x86_64;;
68 - x86|x86_fbsd)
69 - abi_flag=abi_x86_32;;
70 - x32)
71 - abi_flag=abi_x86_x32;;
72 - n32)
73 - abi_flag=abi_mips_n32;;
74 - n64)
75 - abi_flag=abi_mips_n64;;
76 - o32)
77 - abi_flag=abi_mips_o32;;
78 - esac
79 -
80 - # If abi_flag is unset, then header wrapping is unsupported
81 - # on this ABI. This could mean either that:
82 - #
83 - # 1) the arch doesn't support multilib at all -- in this case,
84 - # the headers are not wrapped and everything works as expected,
85 - #
86 - # 2) someone added new ABI and forgot to update the function --
87 - # in this case, the header consistency check will notice one of
88 - # those ABIs has an extra header (compared to the header moved
89 - # for wrapping) and will fail.
90 + # If abi_flag is unset, then header wrapping is unsupported on
91 + # this ABI. This means the arch doesn't support multilib at all
92 + # -- in this case, the headers are not wrapped and everything
93 + # works as expected.
94
95 - if [[ ${abi_flag} ]]; then
96 + if [[ ${MULTILIB_ABI_FLAG} ]]; then
97 for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
98 # drop leading slash if it's there
99 f=${f#/}
100 @@ -454,10 +431,12 @@
101
102 # Some ABIs may have install less files than others.
103 if [[ -f ${root}/usr/include${f} ]]; then
104 + local wrapper=${ED}/tmp/multilib-include${f}
105 +
106 if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
107 dodir "/tmp/multilib-include${dir}"
108 # a generic template
109 - cat > "${ED}/tmp/multilib-include${f}" <<_EOF_
110 + cat > "${wrapper}" <<_EOF_
111 /* This file is auto-generated by multilib-build.eclass
112 * as a multilib-friendly wrapper. For the original content,
113 * please see the files that are #included below.
114 @@ -485,20 +464,25 @@
115 _EOF_
116 fi
117
118 + if ! grep -q "${MULTILIB_ABI_FLAG} " "${wrapper}"
119 + then
120 + die "Flag ${MULTILIB_ABI_FLAG} not listed in wrapper template. Please report a bug to https://bugs.gentoo.org."
121 + fi
122 +
123 # $CHOST shall be set by multilib_toolchain_setup
124 dodir "/tmp/multilib-include/${CHOST}${dir}"
125 mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
126
127 # Note: match a space afterwards to avoid collision potential.
128 - sed -e "/${abi_flag} /s&error.*&include <${CHOST}${f}>&" \
129 - -i "${ED}/tmp/multilib-include${f}" || die
130 + sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
131 + -i "${wrapper}" || die
132
133 # Hack for emul-linux-x86 compatibility.
134 # It assumes amd64 will come after x86, and will use amd64
135 # headers if no specific x86 headers were installed.
136 if [[ ${ABI} == amd64 ]]; then
137 sed -e "/abi_x86_32 /s&error.*&include <${CHOST}${f}>&" \
138 - -i "${ED}/tmp/multilib-include${f}" || die
139 + -i "${wrapper}" || die
140 fi
141 fi
142 done