Skip to content

Commit 97798da

Browse files
authored
Merge pull request #259 from jkloetzke/toolchain-updates
Toolchain updates
2 parents 4395277 + c009f29 commit 97798da

39 files changed

Lines changed: 1744 additions & 106 deletions

.codespellrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[codespell]
22
skip = */config.guess,*.diff,*.patch
3+
ignore-words-list = SME, sme

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ which use the `basement` layer. They act as smoke tests for this project.
4141
First you need to add the `basement` layer to your project. To do so, add a
4242
`layers` entry to `config.yaml`:
4343

44-
bobMinimumVersion: "0.25"
44+
bobMinimumVersion: "1.0"
4545
layers:
4646
- name: basement
4747
scm: git
@@ -86,6 +86,8 @@ as you like.
8686
* `devel::cross-toolchain-arm-none-eabi`: ARMv7 bare metal toolchain with
8787
newlib libc.
8888
* `devel::cross-toolchain-x86_64-linux-gnu`: x86_64 toolchain for Linux with glibc.
89+
* `devel::cross-toolchain-riscv64-linux-gnu`: RISC-V toolchain targeting the GC
90+
profile.
8991

9092
To use a cross compiling toolchain include it where needed via:
9193

aliases/libs/libc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
multiPackage:
2+
tgt: "libs::libc-$(libc-flavour,$(get-tool-env,target-toolchain,AUTOCONF_HOST))-tgt"

classes/sandbox-toolchain.yaml renamed to classes/basement/bits/sandbox-toolchain.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ provideTools:
5151
host-toolchain: "."
5252
target-toolchain: &target-toolchain
5353
path: "."
54+
environment:
55+
# Default tool names.
56+
AR: "ar"
57+
AS: "as"
58+
CC: "gcc"
59+
CPP: "cpp"
60+
CXX: "g++"
61+
GDB: "gdb"
62+
LD: "ld"
63+
NM: "nm"
64+
OBJCOPY: "objcopy"
65+
OBJDUMP: "objdump"
66+
RANLIB: "ranlib"
67+
READELF: "readelf"
68+
STRIP: "strip"
5469
fingerprintIf: True
5570
fingerprintScript: |
5671
# required for sandbox where gcc is not in PATH
@@ -61,8 +76,7 @@ provideTools:
6176
host-native-toolchain: *target-toolchain
6277

6378
provideVars:
64-
# Define our own build- and host-architecture. They are distinct from the
65-
# host environment so that the "right thing"(tm) is done even though the
66-
# architecture is the same.
79+
# Define our own build-architecture. It is distinct from the host
80+
# environment so that our toolchain is used and nothing is mixed with the
81+
# host compiler.
6782
AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD}"
68-
AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST}"

classes/cpackage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ buildSetup: |
4343
${VS_PATH:+export PATH="$PATH:$VS_PATH"}
4444
4545
# Gather all include and library paths.
46-
if [[ $AUTOCONF_HOST == *-win32 ]] ; then
46+
if [[ ${AUTOCONF_HOST:-$AUTOCONF_BUILD} == *-win32 ]] ; then
4747
for i in "${@:2}" ; do
4848
if [[ -d "$i/usr/include" ]] ; then
4949
CPPFLAGS+=" -I $(cygpath -w "$i/usr/include")"

classes/kconfig.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
buildSetup: |
2+
# $1: option (e.g. ENABLE_FOO)
3+
# $2: replacement (e.g. "ENABLE_FOO=y" or "# ENABLE_FOO is not set")
4+
# $3: kconfig-file (optional, defaults to ".config")
5+
kconfigUpdate()
6+
{
7+
sed -e "/^# $1 is not set/d" -e "/^$1=/d" -i "${3:-.config}"
8+
echo "$2" >> "${3:-.config}"
9+
}
10+
11+
# $1: option
12+
# $2: kconfig-file (optional, defaults to ".config")
13+
kconfigEnable()
14+
{
15+
kconfigUpdate "$1" "$1=y" "${2:-.config}"
16+
}
17+
18+
# $1: option
19+
# $2: kconfig-file (optional, defaults to ".config")
20+
kconfigDisable()
21+
{
22+
kconfigUpdate "$1" "# $1 is not set" "${2:-.config}"
23+
}
24+
25+
# $1: option
26+
# $2: value ("n" or "0" -> disable, "y" or "1" -> enable)
27+
# $3: kconfig-file (optional, defaults to ".config")
28+
kconfigSetBool()
29+
{
30+
case "$2" in
31+
n|0)
32+
kconfigDisable "$1" "${3:-.config}"
33+
;;
34+
y|1)
35+
kconfigEnable "$1" "${3:-.config}"
36+
;;
37+
*)
38+
echo "kconfigSetBool: invalid value '$2'" >&2
39+
exit 1
40+
esac
41+
}

classes/meson.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ buildSetup: |
5555
MESON_CPU_FAMILY=x86
5656
: ${MESON_CPU=i686}
5757
;;
58+
riscv32-*)
59+
MESON_CPU_FAMILY=riscv32
60+
: ${MESON_CPU=rv32gc}
61+
;;
62+
riscv64-*)
63+
MESON_CPU_FAMILY=riscv64
64+
: ${MESON_CPU=rv64gc}
65+
;;
5866
x86_64-*)
5967
MESON_CPU_FAMILY=x86_64
6068
: ${MESON_CPU=x86_64}

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bobMinimumVersion: "0.25"
1+
bobMinimumVersion: "1.0"
22

33
plugins:
44
- multiarch

default.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,13 @@ environment:
1414
# should not be overridden by the user.
1515
##########################################################################
1616

17-
# The default build (i.e. the system that the build runs on) and host
18-
# system (i.e. the system where the produced executables run on)
17+
# The default build system triplet (i.e. the system that the build runs on)
1918
# definition.
2019
ARCH: "$(host-arch)"
2120
AUTOCONF_BUILD: "$(host-autoconf)"
22-
AUTOCONF_HOST: "$(host-autoconf)"
23-
24-
# Default tool names.
25-
AR: "ar"
26-
AS: "as"
27-
CC: "gcc"
28-
CPP: "cpp"
29-
CXX: "g++"
30-
GDB: "gdb"
31-
LD: "ld"
32-
NM: "nm"
33-
OBJCOPY: "objcopy"
34-
OBJDUMP: "objdump"
35-
RANLIB: "ranlib"
36-
READELF: "readelf"
37-
STRIP: "strip"
3821

3922
# Default host compilation flags. Only cross-compiling target toolchains
40-
# will override these based on the BASEMENT_OPTIMIZE and BASEMENT_OPTIMIZE
23+
# will override these based on the BASEMENT_DEBUG and BASEMENT_OPTIMIZE
4124
# settings above.
4225
#
4326
# We build everything static on host builds without debug symbols. Some
@@ -50,6 +33,7 @@ environment:
5033

5134
archiveAppend:
5235
backend: http
36+
name: ci.bobbuildtool.dev
5337
url: http://ci.bobbuildtool.dev/artifacts/
5438
flags: [download]
5539

0 commit comments

Comments
 (0)