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