Skip to content

Commit b86ab1c

Browse files
committed
README.md: Update for arc-2025.06 release
1. Update information for RHEL/AlmaLinux 8 and Ubuntu 22.04 host systems. 2. Remove examples and provide links to corresponding pages in documentation. 3. Remove outdated parts. Signed-off-by: Yuriy Kolerov <[email protected]>
1 parent 1daf90d commit b86ab1c

File tree

1 file changed

+51
-216
lines changed

1 file changed

+51
-216
lines changed

README.md

Lines changed: 51 additions & 216 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,14 @@ This is the main Git repository for the ARC GNU toolchain. It contains
44
documentation & various supplementary materials required for development,
55
verification & releasing of pre-built toolchain artifacts.
66

7-
Branches in this repository are:
8-
9-
* `arc-releases` is the stable branch for the toolchain release. Head of
10-
this branch is a latest stable release. It is a branch recommended for most
11-
users
12-
* `arc-dev` is the development branch for the current toolchain release
13-
14-
While the top of *development* branches should build and run reliably, there
15-
is no guarantee of this. Users who encountered an error are welcomed to create
16-
a new bug report at GitHub Issues for this `toolchain` project.
17-
187
## Documentation
198

209
There are several documentation sites for ARC GNU toolchain:
2110

2211
1. [GNU toolchain documentation site](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation) - the documentation site for ARC Classic targets.
2312
2. [ARC-V Processors Getting Started](https://foss-for-synopsys-dwc-arc-processors.github.io/arc-v-getting-started) - the documentation for ARC-V targets.
2413
3. [Old GNU toolchain documentation site](https://foss-for-synopsys-dwc-arc-processors.github.io/toolchain/) - the documentation site for ARC Classic targets
25-
for release 2023.03 and earlier.
14+
for release `arc-2023.03` and earlier.
2615

2716
## Build environment
2817

@@ -64,71 +53,25 @@ execution of a prebuilt toolchain it's necessary to use up-to-date Linux distrib
6453

6554
As of today, the oldest supported distributions are:
6655

67-
* CentOS/RHEL 7
68-
* Ubuntu 18.04 LTS
56+
* Ubuntu 22.04 LTS
57+
* RHEL/AlmaLinux 8
6958

7059
## Prerequisites
7160

7261
GNU toolchain for ARC has the same standard prerequisites as an upstream GNU
7362
toolchain as documented in the GNU toolchain user guide or on the [GCC
7463
website](http://gcc.gnu.org/install/prerequisites.html)
7564

76-
### Autoconf
77-
78-
Starting from version 2023.03, Crosstool-NG which is used for building toolchains, requires Autoconf 2.71
79-
instead of 2.67. It may not be available on old Linux distributions. In this case you can build it manually
80-
(use your own prefix):
81-
82-
```shell
83-
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz
84-
tar -xf autoconf-2.71.tar.gz
85-
cd autoconf-2.71
86-
./configure --prefix=/tools/autoconf2.71
87-
make
88-
make install
89-
```
90-
91-
Then configure your environment:
92-
93-
```shell
94-
export PATH="/tools/autoconf2.71/bin:$PATH"
95-
```
96-
97-
### Ubuntu 18.04 and newer
65+
### Ubuntu 22.04
9866

9967
```shell
10068
sudo apt update
10169
sudo apt install -y autoconf help2man libtool libtool-bin texinfo byacc flex libncurses5-dev zlib1g-dev \
10270
libexpat1-dev texlive build-essential git wget gawk libncursesw5 \
103-
bison xz-utils make python3 rsync locales
104-
```
105-
106-
### CentOS/RHEL 7.x
107-
108-
```shell
109-
sudo yum install -y autoconf bison bzip2 file flex gcc-c++ git gperf \
110-
help2man libtool make ncurses-devel patch \
111-
perl-Thread-Queue python3 rsync texinfo unzip wget \
112-
which xz
71+
bison xz-utils make python3 rsync locales meson ninja-build
11372
```
11473

115-
The latest Crosstool-NG may require building tools newer than tools which are shipped
116-
with CentOS 7 by default (for example, there are GCC 4.8.5 and Make 3.82). At least
117-
it's not enough anymore for building ARC toolchain for Windows hosts. In this
118-
case consider using `centos-release-scl` repository to install the latest tools:
119-
120-
```shell
121-
# Install fresh tools
122-
sudo yum install centos-release-scl
123-
sudo yum install devtoolset-9
124-
125-
# Enable them in a new Bash session
126-
scl enable devtoolset-9 bash
127-
```
128-
129-
### Fedora & CentOS/RHEL 8.x
130-
131-
#### Enabling "PowerTools" repository for CentOS/RHEL 8.x
74+
### RHEL/AlmaLinux 8
13275

13376
Some packages like `gperf`, `help2man` & `texinfo` are not available in a base
13477
package repositories, instead they are distributed via so-called "PowerTools Repository",
@@ -139,16 +82,32 @@ sudo dnf -y install dnf-plugins-core
13982
sudo dnf config-manager --set-enabled powertools
14083
```
14184

142-
Then install all the packages in the same way as it is done for Fedora in the next
143-
section.
144-
145-
#### Packages installation in Fedora, CentOS/RHEL 8.x
85+
Then install all necessary packages:
14686

14787
```shell
14888
sudo dnf install -y autoconf bison bzip2 diffutils file flex gcc-c++ git \
14989
gperf help2man libtool make ncurses-devel patch \
15090
perl-Thread-Queue python3 rsync texinfo unzip wget \
151-
which xz
91+
which xz meson ninja-build
92+
```
93+
94+
Autoconf 2.71 is required for configuring Crosstool-NG instead of 2.67. By default,
95+
RHEL/AlmaLinux 8 is shipped with Autoconf 2.67. In this case you should build Autoconf 2.71
96+
manually (use your own prefix):
97+
98+
```shell
99+
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz
100+
tar -xf autoconf-2.71.tar.gz
101+
cd autoconf-2.71
102+
./configure --prefix=/tools/autoconf2.71
103+
make
104+
make install
105+
```
106+
107+
Then configure your environment:
108+
109+
```shell
110+
export PATH="/tools/autoconf2.71/bin:$PATH"
152111
```
153112

154113
### Locale installation for building uClibc
@@ -183,11 +142,13 @@ git clone https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng.g
183142
# Step into the just obtained source tree
184143
cd crosstool-ng
185144

186-
# Optionally select its version of choice, for example the one used for creation of `arc-2021.09` release
187-
git checkout arc-2021.09-release
145+
# Optionally select its version of choice, for example the one used for creation of `arc-2024.12` release
146+
git checkout arc-2024.12-release
188147

189148
# Configure & build Crosstool-NG
190-
./bootstrap && ./configure --enable-local && make
149+
./bootstrap
150+
./configure --enable-local
151+
make
191152
```
192153

193154
## Building the Toolchain
@@ -220,7 +181,7 @@ The following pre-defined configurations (they are called "samples" on Crosstool
220181
1. `snps-arc64-snps-linux-gnu` - Linux glibc cross-toolchain for for ARC HS6x processors for 64-bit Linux hosts
221182
1. `snps-arc64-snps-native-gnu` - Linux glibc "native" toolchain from ARC HS6x processors
222183
1. `snps-arc64-unknown-elf` - Bare-metal cross-toolchain for ARC HS6x processors for 64-bit Linux hosts
223-
1. `snps-riscv64-unknown-elf` - Bare-metal cross-toolchain for ARC-V processors for 64-bit Linux hosts
184+
1. `snps-riscv64-unknown-elf` - Bare-metal cross-toolchain for ARC-V processors with Newlib standard library for 64-bit Linux hosts
224185
1. `snps-riscv64-win-elf` - Bare-metal cross-toolchain for ARC-V processors for 64-bit Windows hosts
225186

226187
And to get Crosstool-NG configured with either of those samples just say: `./ct-ng sample_name`. For example, to get bare-metal toolchain for ARCompact/ARCv2 processors say: `./ct-ng snps-arc-multilib-elf32`.
@@ -280,8 +241,8 @@ Some limitations apply:
280241
To do a canadian-cross toolchain on Linux, MinGW toolchain must be installed on the build host.
281242
There're muliple ways to get MinGW installed:
282243

283-
* On Ubuntu 18.04 & 20.04 that can be done with: `sudo apt install mingw-w64`
284-
* On CentOS/RHEL 8.x it's a bit more challenging:
244+
* On Ubuntu 22.04 that can be done with: `sudo apt install mingw-w64`
245+
* On RHEL/AlmaLinux 8.x it's a bit more challenging:
285246

286247
```shell
287248
sudo dnf -y install dnf-plugins-core
@@ -328,154 +289,28 @@ For example:
328289
* With `snps-arc-multilib-elf32` sample built toolchain will be installed in `~/x-tools/arc-snps-elf`
329290
* With `snps-arc64-unknown-elf` sample built toolchain will be installed in `~/x-tools/arc64-snps-elf`
330291

331-
Prefixes which start with `arc-` correspond to little endian toolchains. Prefixes which start with
332-
`arceb-` correspond to big endian toolchains. E.g., GDB for big endian ARCv2 baremetal toolchain is
333-
`arceb-elf32-gdb`. However, big endian tools are not available for ARCv3 yet.
334-
335-
You can find more information about variants of toolchains, `-mcpu` values
336-
and matching TCF files on [Toolchains for ARC Processors](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2024.06/toolchain/) page.
337-
338-
### Using nSIM simulator to run bare metal ARC applications
339-
340-
> Refer to [nSIM](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2024.06/simulators/nsim/)
341-
> page of the documentation for details. Refer to
342-
> [GNU tools for ARC-V](https://foss-for-synopsys-dwc-arc-processors.github.io/arc-v-getting-started/synopsys-tools/gnu.html)
343-
> for details regarding running ARC-V applications on simulators.
344-
345-
nSIM simulator supports GNU IO hostlink used by the libc library of bare metal
346-
GNU toolchain for ARC. nSIM option `nsim_emt=1` enables GNU IO hostlink. nSIM
347-
simulator also supports semihosting, which is essential for ARC-V targets, more
348-
details can be found in nSIM documentation.
349-
350-
To start nSIM in gdbserver mode for ARC EM6:
351-
352-
```shell
353-
$ $NSIM_HOME/bin/nsimdrv -gdb -port 51000 \
354-
-tcf $NSIM_HOME/etc/tcf/templates/em6_gp.tcf -on nsim_emt
355-
```
356-
357-
And in second console (GDB output is omitted):
358-
359-
```shell
360-
$ arc-elf32-gcc -mcpu=arcem -g --specs=nsim.specs hello_world.c
361-
$ arc-elf32-gdb --quiet a.out
362-
(gdb) target remote :51000
363-
(gdb) load
364-
(gdb) break main
365-
(gdb) break exit
366-
(gdb) continue
367-
(gdb) continue
368-
(gdb) quit
369-
```
370-
371-
GDB also might execute commands in a batch mode so that it could be done
372-
automatically:
373-
374-
```shell
375-
$ arc-elf32-gdb -nx --batch -ex 'target remote :51000' -ex 'load' \
376-
-ex 'break main' -ex 'break exit' \
377-
-ex 'continue' -ex 'continue' -ex 'quit' a.out
378-
```
379-
380-
If one of the HS TCFs is used, then it is required to add `-on
381-
nsim_isa_ll64_option` to nSIM options, because GCC for ARC automatically
382-
generates double-world memory operations, which are not enabled in TCFs
383-
supplied with nSIM:
292+
You can find general information about GNU ARC toolchains on the official
293+
documentation page:
384294

385-
```shell
386-
$ $NSIM_HOME/bin/nsimdrv -gdb -port 51000 \
387-
-tcf $NSIM_HOME/etc/tcf/templates/hs36.tcf -on nsim_emt \
388-
-on nsim_isa_ll64_option
389-
```
390-
391-
nSIM distribution doesn't contain big-endian TCFs, so `-on
392-
nsim_isa_big_endian` should be added to nSIM options to simulate big-endian
393-
cores:
394-
395-
```shell
396-
$ $NSIM_HOME/bin/nsimdrv -gdb -port 51000 \
397-
-tcf $NSIM_HOME/etc/tcf/templates/em6_gp.tcf -on nsim_emt \
398-
-on nsim_isa_big_endian
399-
```
400-
401-
Default linker script of GNU Toolchain for ARC is not compatible with memory
402-
maps of cores that only has CCM memory (EM4, EM5D, HS34), thus to run
403-
application on nSIM with those TCFs it is required to link application with
404-
linker script appropriate for selected core.
405-
406-
When application is simulated on nSIM gdbserver all input and output happens on
407-
the side of host that runs gdbserver, so in "hello world" example string will
408-
be printed in the console that runs nSIM gdbserver.
409-
410-
Note the usage of `nsim.specs` specification file. This file specifies that
411-
applications should be linked with nSIM IO hostlink library libnsim.a, which is
412-
implemented in libgloss - part of newlib project. libnsim provides several
413-
functions that are required to link C applications - those functions a
414-
considered board/OS specific, hence are not part of the normal libc.a. To link
415-
application without nSIM IO hostlink support use `nosys.specs` file - note that
416-
in this case system calls are either not available or have stub
417-
implementations. One reason to prefer `nsim.specs` over `nosys.specs` even when
418-
developing for hardware platform which doesn't have hostlink support is that
419-
`nsim` will halt target core on call to function "exit" and on many errors,
420-
while `exit` functions `nosys.specs` is an infinite loop. For more details
421-
please see [documentation](https://foss-for-synopsys-dwc-arc-processors.github.io/toolchain/baremetal/index.html).
422-
423-
### Using HS Development Kit to run bare metal applications
424-
425-
> Refer to [Getting OpenOCD](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2024.06/platforms/get-openocd/)
426-
> and [Using OpenOCD](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2024.06/platforms/use-openocd/)
427-
> pages of the documentation for details regarding OpenOCD. Refer to
428-
> [Baremetal Targets](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2024.06/baremetal/)
429-
> regarding building and running applications on boards.
430-
431-
To run OpenOCD:
432-
433-
```shell
434-
openocd -f board/snps_hsdk.cfg
435-
```
436-
437-
Compile test application and run:
295+
1. [GNU toolchain for ARC Classic](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/toolchain/)
296+
2. [GNU toolchain for ARC-V](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/arcv/)
438297

439-
```shell
440-
$ arc-elf32-gcc -mcpu=hs38_linux -specs=hsdk.specs -g simple.c
441-
$ arc-elf32-gdb --quiet a.out
442-
(gdb) target remote :3333
443-
(gdb) load
444-
(gdb) break main
445-
(gdb) continue
446-
(gdb) step
447-
(gdb) next
448-
(gdb) break exit
449-
(gdb) continue
450-
(gdb) quit
451-
```
452-
453-
### Debugging applications on Linux for ARC
298+
Also, detailed usage examples for various targets and platform may found on [the official
299+
documentation page](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/):
454300

455-
Compile application:
301+
Usage examples for ARC Classic:
456302

457-
```shell
458-
arc-linux-gcc -g -o hello_world hello_world.c
459-
```
303+
* [Building baremetal applications for ARC Classic and running them on nSIM](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/baremetal/simulators/nsim/)
304+
* [Building baremetal applications for ARC Classic and running them on HS Development Kit](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/baremetal/hardware/hsdk/)
305+
* [Building baremetal applications for ARC Classic and running them on EM Software Development Platform](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/baremetal/hardware/emsdp/)
306+
* [Debugging applications on Linux](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/linux/hsdk/build/#debugging-applications-using-gdbserver)
460307

461-
Copy it to the NFS share, or place it in rootfs, or make it available to target
462-
system in any way other way. Start gdbserver on target system:
308+
Usage examples for ARC-V:
463309

464-
```shell
465-
[ARCLinux] # gdbserver :51000 hello_world
466-
```
467-
468-
Start GDB on the host:
469-
470-
```shell
471-
$ arc-linux-gdb --quiet hello_world
472-
(gdb) set sysroot <buildroot/output/target>
473-
(gdb) target remote 192.168.218.2:51000
474-
(gdb) break main
475-
(gdb) continue
476-
(gdb) continue
477-
(gdb) quit
478-
```
310+
* [Building applications with Picolibc](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/arcv/building-picolibc/)
311+
* [Building applications with Newlib](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/arcv/building-newlib/)
312+
* [Running on nSIM](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/arcv/nsim/)
313+
* [Running on QEMU](https://foss-for-synopsys-dwc-arc-processors.github.io/documentation/2025.06/arcv/qemu/)
479314

480315
## Getting help
481316

0 commit comments

Comments
 (0)