summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--meta/recipes-devtools/gcc/libgcc-common.inc135
-rw-r--r--meta/recipes-devtools/gcc/libgcc.inc133
2 files changed, 137 insertions, 131 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
new file mode 100644
index 0000000000..c4ab885cc3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -0,0 +1,135 @@
1BPN = "libgcc"
2
3INHIBIT_DEFAULT_DEPS = "1"
4
5do_configure () {
6 target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
7 install -d ${D}${base_libdir} ${D}${libdir}
8 hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
9 mkdir -p ${B}/${BPN}
10 cd ${B}/${BPN}
11 chmod a+x ${S}/${BPN}/configure
12 ${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
13}
14
15do_compile () {
16 target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
17 cd ${B}/${BPN}
18 oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
19}
20
21do_install () {
22 target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
23 cd ${B}/${BPN}
24 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
25
26 # Move libgcc_s into /lib
27 mkdir -p ${D}${base_libdir}
28 if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
29 mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
30 else
31 mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
32 fi
33
34 # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
35 # so that cross-gcc can find it in the sysroot
36
37 mv ${D}${libdir}/gcc/* ${D}${libdir}
38 rm -rf ${D}${libdir}/gcc/
39 # unwind.h is installed here which is shipped in gcc-cross
40 # as well as target gcc and they are identical so we dont
41 # ship one with libgcc here
42 rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
43}
44
45BBCLASSEXTEND = "nativesdk"
46
47addtask multilib_install after do_install before do_package do_populate_sysroot
48# this makes multilib gcc files findable for target gcc
49# e.g.
50# /usr/lib/i586-pokymllib32-linux/4.7/
51# by creating this symlink to it
52# /usr/lib64/x86_64-poky-linux/4.7/32
53
54python do_multilib_install() {
55 import re
56
57 multilibs = d.getVar('MULTILIB_VARIANTS', True)
58 if not multilibs or bb.data.inherits_class('nativesdk', d):
59 return
60
61 binv = d.getVar('BINV', True)
62
63 mlprefix = d.getVar('MLPREFIX', True)
64 if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
65 return
66
67 if mlprefix:
68 orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
69 orig_tune_params = get_tune_parameters(orig_tune, d)
70 orig_tune_baselib = orig_tune_params['baselib']
71 orig_tune_bitness = orig_tune_baselib.replace('lib', '')
72 if not orig_tune_bitness:
73 orig_tune_bitness = '32'
74
75 src = '../../../' + orig_tune_baselib + '/' + \
76 d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
77
78 dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
79 d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
80
81 if os.path.lexists(dest):
82 os.unlink(dest)
83 os.symlink(src, dest)
84 return
85
86
87 for ml in multilibs.split():
88 tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
89 if not tune:
90 bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
91 continue
92
93 tune_parameters = get_tune_parameters(tune, d)
94 tune_baselib = tune_parameters['baselib']
95 if not tune_baselib:
96 bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
97 continue
98
99 tune_arch = tune_parameters['arch']
100 tune_bitness = tune_baselib.replace('lib', '')
101 if not tune_bitness:
102 tune_bitness = '32' # /lib => 32bit lib
103
104 src = '../../../' + tune_baselib + '/' + \
105 tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
106 '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
107
108 dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
109 d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
110
111 if os.path.lexists(dest):
112 os.unlink(dest)
113 os.symlink(src, dest)
114}
115
116addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
117python do_extra_symlinks() {
118 targetsysnoext = d.getVar('TARGET_SYS_NO_EXTENSION', True)
119
120 if targetsysnoext != d.getVar('TARGET_SYS', True):
121 dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsysnoext
122 src = d.getVar('TARGET_SYS', True)
123 if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
124 os.symlink(src, dest)
125}
126
127python () {
128 targetsysnoext = d.getVar('TARGET_SYS', True)
129
130 for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
131 if suffix and targetsysnoext.endswith(suffix):
132 targetsysnoext = targetsysnoext[:-len(suffix)]
133
134 d.setVar('TARGET_SYS_NO_EXTENSION', targetsysnoext)
135}
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}