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: Tue, 29 Apr 2014 20:59:46
Message-Id: 20140429205941.6E2AA20036@flycatcher.gentoo.org
1 mgorny 14/04/29 20:59:41
2
3 Modified: ChangeLog multilib-build.eclass
4 Log:
5 Disable header wrapping on unsupported ABIs.
6
7 Revision Changes Path
8 1.1232 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1232&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1232&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1231&r2=1.1232
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.1231
18 retrieving revision 1.1232
19 diff -u -r1.1231 -r1.1232
20 --- ChangeLog 29 Apr 2014 20:59:00 -0000 1.1231
21 +++ ChangeLog 29 Apr 2014 20:59:41 -0000 1.1232
22 @@ -1,6 +1,9 @@
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.1231 2014/04/29 20:59:00 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1232 2014/04/29 20:59:41 mgorny Exp $
27 +
28 + 29 Apr 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
29 + Disable header wrapping on unsupported ABIs.
30
31 29 Apr 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
32 Reorder the operations in multilib_prepare_wrappers for easier reading.
33
34
35
36 1.45 eclass/multilib-build.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.45&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.45&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?r1=1.44&r2=1.45
41
42 Index: multilib-build.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v
45 retrieving revision 1.44
46 retrieving revision 1.45
47 diff -u -r1.44 -r1.45
48 --- multilib-build.eclass 29 Apr 2014 20:59:00 -0000 1.44
49 +++ multilib-build.eclass 29 Apr 2014 20:59:41 -0000 1.45
50 @@ -1,6 +1,6 @@
51 # Copyright 1999-2014 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.44 2014/04/29 20:59:00 mgorny Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.45 2014/04/29 20:59:41 mgorny Exp $
55
56 # @ECLASS: multilib-build.eclass
57 # @MAINTAINER:
58 @@ -342,22 +342,52 @@
59 fi
60 done
61
62 - for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
63 - # drop leading slash if it's there
64 - f=${f#/}
65 + if [[ ${MULTILIB_WRAPPED_HEADERS[@]} ]]; then
66 + # XXX: get abi_* directly
67 + local abi_flag
68 + case "${ABI}" in
69 + amd64|amd64_fbsd)
70 + abi_flag=abi_x86_64;;
71 + x86|x86_fbsd)
72 + abi_flag=abi_x86_32;;
73 + x32)
74 + abi_flag=abi_x86_x32;;
75 + n32)
76 + abi_flag=abi_mips_n32;;
77 + n64)
78 + abi_flag=abi_mips_n64;;
79 + o32)
80 + abi_flag=abi_mips_o32;;
81 + esac
82 +
83 + # If abi_flag is unset, then header wrapping is unsupported
84 + # on this ABI. This could mean either that:
85 + #
86 + # 1) the arch doesn't support multilib at all -- in this case,
87 + # the headers are not wrapped and everything works as expected,
88 + #
89 + # 2) someone added new ABI and forgot to update the function --
90 + # in this case, the header consistency check will notice one of
91 + # those ABIs has an extra header (compared to the header moved
92 + # for wrapping) and will fail.
93 +
94 + if [[ ${abi_flag} ]]; then
95 + for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
96 + # drop leading slash if it's there
97 + f=${f#/}
98
99 - if [[ ${f} != usr/include/* ]]; then
100 - die "Wrapping headers outside of /usr/include is not supported at the moment."
101 - fi
102 - # and then usr/include
103 - f=${f#usr/include}
104 + if [[ ${f} != usr/include/* ]]; then
105 + die "Wrapping headers outside of /usr/include is not supported at the moment."
106 + fi
107 + # and then usr/include
108 + f=${f#usr/include}
109
110 - local dir=${f%/*}
111 + local dir=${f%/*}
112
113 - if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
114 - dodir "/tmp/multilib-include${dir}"
115 - # a generic template
116 - cat > "${ED}/tmp/multilib-include${f}" <<_EOF_
117 + if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
118 + dodir "/tmp/multilib-include${dir}"
119 + # a generic template
120 + cat > "${ED}/tmp/multilib-include${f}" <<_EOF_
121 /* This file is auto-generated by multilib-build.eclass
122 * as a multilib-friendly wrapper. For the original content,
123 * please see the files that are #included below.
124 @@ -383,38 +413,21 @@
125 # error "No ABI matched, please report a bug to bugs.gentoo.org"
126 #endif
127 _EOF_
128 - fi
129 + fi
130
131 - # Some ABIs may have install less files than others.
132 - if [[ -f ${root}/usr/include${f} ]]; then
133 - # $CHOST shall be set by multilib_toolchain_setup
134 - dodir "/tmp/multilib-include/${CHOST}${dir}"
135 - mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
136 -
137 - # XXX: get abi_* directly
138 - local abi_flag
139 - case "${ABI}" in
140 - amd64|amd64_fbsd)
141 - abi_flag=abi_x86_64;;
142 - x86|x86_fbsd)
143 - abi_flag=abi_x86_32;;
144 - x32)
145 - abi_flag=abi_x86_x32;;
146 - n32)
147 - abi_flag=abi_mips_n32;;
148 - n64)
149 - abi_flag=abi_mips_n64;;
150 - o32)
151 - abi_flag=abi_mips_o32;;
152 - *)
153 - die "Header wrapping for ${ABI} not supported yet";;
154 - esac
155 -
156 - # Note: match a space afterwards to avoid collision potential.
157 - sed -e "/${abi_flag} /s&error.*&include <${CHOST}${f}>&" \
158 - -i "${ED}/tmp/multilib-include${f}" || die
159 + # Some ABIs may have install less files than others.
160 + if [[ -f ${root}/usr/include${f} ]]; then
161 + # $CHOST shall be set by multilib_toolchain_setup
162 + dodir "/tmp/multilib-include/${CHOST}${dir}"
163 + mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
164 +
165 + # Note: match a space afterwards to avoid collision potential.
166 + sed -e "/${abi_flag} /s&error.*&include <${CHOST}${f}>&" \
167 + -i "${ED}/tmp/multilib-include${f}" || die
168 + fi
169 + done
170 fi
171 - done
172 + fi
173 }
174
175 # @FUNCTION: multilib_install_wrappers