1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
PACKAGES = "\
${PN} \
${PN}-dev \
${PN}-dbg \
libgcov-dev \
"
FILES_${PN} = "${base_libdir}/libgcc*.so.*"
FILES_${PN}-dev = " \
${base_libdir}/libgcc*.so \
${libdir}/${TARGET_SYS}/${BINV}/*crt* \
${libdir}/${TARGET_SYS}/${BINV}/64 \
${libdir}/${TARGET_SYS}/${BINV}/32 \
${libdir}/${TARGET_SYS}/${BINV}/x32 \
${libdir}/${TARGET_SYS}/${BINV}/n32 \
${libdir}/${TARGET_SYS}/${BINV}/libgcc* \
${@base_conditional('TARGET_SYS_NO_EXTENSION', '${TARGET_SYS}', '', '${libdir}/${TARGET_SYS_NO_EXTENSION}', d)}"
FILES_libgcov-dev = " \
${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
"
FILES_${PN}-dbg += "${base_libdir}/.debug/"
do_configure () {
target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
install -d ${D}${base_libdir} ${D}${libdir}
cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
mkdir -p ${B}/${BPN}
cd ${B}/${BPN}
chmod a+x ${S}/${BPN}/configure
${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
}
do_compile () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
cd ${B}/${BPN}
oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
}
do_install () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
cd ${B}/${BPN}
oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
# Move libgcc_s into /lib
mkdir -p ${D}${base_libdir}
if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
else
mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
fi
# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
# so that cross-gcc can find it in the sysroot
mv ${D}${libdir}/gcc/* ${D}${libdir}
rm -rf ${D}${libdir}/gcc/
# unwind.h is installed here which is shipped in gcc-cross
# as well as target gcc and they are identical so we dont
# ship one with libgcc here
rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
}
do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
BBCLASSEXTEND = "nativesdk"
INSANE_SKIP_${PN}-dev = "staticdev"
INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev"
addtask multilib_install after do_install before do_package do_populate_sysroot
# this makes multilib gcc files findable for target gcc
# e.g.
# /usr/lib/i586-pokymllib32-linux/4.7/
# by creating this symlink to it
# /usr/lib64/x86_64-poky-linux/4.7/32
python do_multilib_install() {
import re
multilibs = d.getVar('MULTILIB_VARIANTS', True)
if not multilibs or bb.data.inherits_class('nativesdk', d):
return
binv = d.getVar('BINV', True)
mlprefix = d.getVar('MLPREFIX', True)
if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
return
if mlprefix:
orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
orig_tune_params = get_tune_parameters(orig_tune, d)
orig_tune_baselib = orig_tune_params['baselib']
orig_tune_bitness = orig_tune_baselib.replace('lib', '')
if not orig_tune_bitness:
orig_tune_bitness = '32'
src = '../../../' + orig_tune_baselib + '/' + \
d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
if os.path.lexists(dest):
os.unlink(dest)
os.symlink(src, dest)
return
for ml in multilibs.split():
tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
if not tune:
bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
continue
tune_parameters = get_tune_parameters(tune, d)
tune_baselib = tune_parameters['baselib']
if not tune_baselib:
bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
continue
tune_arch = tune_parameters['arch']
tune_bitness = tune_baselib.replace('lib', '')
if not tune_bitness:
tune_bitness = '32' # /lib => 32bit lib
src = '../../../' + tune_baselib + '/' + \
tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
'-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
if os.path.lexists(dest):
os.unlink(dest)
os.symlink(src, dest)
}
addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
python do_extra_symlinks() {
targetsysnoext = d.getVar('TARGET_SYS_NO_EXTENSION', True)
if targetsysnoext != d.getVar('TARGET_SYS', True):
dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsysnoext
src = d.getVar('TARGET_SYS', True)
if not os.path.lexists(dest):
os.symlink(src, dest)
}
python () {
targetsysnoext = d.getVar('TARGET_SYS', True)
for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
if suffix and targetsysnoext.endswith(suffix):
targetsysnoext = targetsysnoext[:-len(suffix)]
d.setVar('TARGET_SYS_NO_EXTENSION', targetsysnoext)
}
|