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