blob: 699a1ce8c78dd4ddb124f32af7f27e58c40e8aeb (
plain)
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
|
name: baserock
aliases:
upstream: git://git.baserock.org/delta/
baserock: git://git.baserock.org/baserock/
gnomesdk: https://sdk.gnome.org/
# All the elements go here
element-path: ./elements
variables:
cpu: "%{bst-target-arch}"
abi: gnu
target-stage1: "%{cpu}-bootstrap-linux-%{abi}"
target: "%{cpu}-baserock-linux-%{abi}"
# This should match the %{strip-binaries} variable in BuildStream's default
# project config. But when doing a cross-build of stage2.bst we need to force
# use the cross binutils; the native binutils from the base sysroot will
# ignore the non-native binaries and leave them unstripped.
stage2-strip-binaries: |
find "%{install-root}" -type f \
'(' -perm -111 -o -name '*.so*' \
-o -name '*.cmxs' -o -name '*.node' ')' \
-exec sh -ec \
'read -n4 hdr <"$1" # check for elf header
if [ "$hdr" != "$(printf \\x7fELF)" ]; then
exit 0
fi
debugfile="%{install-root}%{debugdir}/$(basename "$1")"
mkdir -p "$(dirname "$debugfile")"
%{target-stage1}-objcopy --only-keep-debug "$1" "$debugfile"
chmod 644 "$debugfile"
%{target-stage1}-strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
%{target-stage1}-objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
# BuildStream passes `--compress-debug-sections` to objcopy; this would be
# great if it worked but in stage3 builds I see errors like this:
#
# BFD: /buildstream/install/usr/bin/gcc-ranlib: unable to initialize compress status for section .debug_aranges
# objcopy:/buildstream/install/usr/bin/gcc-ranlib: Invalid operation
#
# This causes debug stripping to just not happen, which makes the stage3
# sysroot huge. I haven't investigated the cause, but I guess we need to
# build zlib in stage2 for the feature to work.
stage3-strip-binaries: |
find "%{install-root}" -type f \
'(' -perm -111 -o -name '*.so*' \
-o -name '*.cmxs' -o -name '*.node' ')' \
-exec sh -ec \
'read -n4 hdr <"$1" # check for elf header
if [ "$hdr" != "$(printf \\x7fELF)" ]; then
exit 0
fi
debugfile="%{install-root}%{debugdir}/$(basename "$1")"
mkdir -p "$(dirname "$debugfile")"
objcopy --only-keep-debug "$1" "$debugfile"
chmod 644 "$debugfile"
strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
artifacts:
pull-url: https://ostree.baserock.org/cache/
# Resolve the cpu and ABI portions of the host triple based
# on architecture names.
arches:
x86_32:
variables:
cpu: i686
armv5l:
variables:
abi: gnueabi
armv7b:
variables:
abi: gnueabi
armv7l:
variables:
abi: gnueabi
armv7lhf:
variables:
abi: gnueabi
armv8l64:
variables:
cpu: aarch64
armv8b64:
variables:
cpu: aarch64_be
mips64b:
variables:
cpu: mips64
abi: gnuabi64
mips64l:
variables:
cpu: mips64el
mips32b:
variables:
cpu: mips
mips32l:
variables:
cpu: mipsel
ppc64b:
variables:
cpu: powerpc64
ppc64l:
variables:
cpu: powerpc64le
|