Skip to content

Commit

Permalink
update patch to gcc 13.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Jan 22, 2025
1 parent 9639f1f commit 4b1211e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 29 deletions.
2 changes: 1 addition & 1 deletion local_patch/patch-rsb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ set -xe
mkdir -p $RSB/rtems/patches
cp $THIS/gcc.patch $RSB/rtems/patches

cp $THIS/rtems-gcc-13.2-newlib-head.cfg $RSB/rtems/config/tools/rtems-gcc-13.2-newlib-head.cfg
cp $THIS/rtems-gcc-13.3-newlib-head.cfg $RSB/rtems/config/tools
23 changes: 0 additions & 23 deletions local_patch/rtems-gcc-13.2-newlib-head.cfg

This file was deleted.

34 changes: 34 additions & 0 deletions local_patch/rtems-gcc-13.3-newlib-head.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg

%define gcc_version 13.3.0
%source set gcc https://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.xz
%hash sha512 gcc-%{gcc_version}.tar.xz \
7V8vTG7Sx5b88sk3BxWenb092xugY9VJgE3WjNq7ttVQmFrhyEZa6aM2z+KSdKbrD0LiGSQ2BXTr2OXVx8moAQ==

%patch add gcc -p1 https://gitlab.rtems.org/-/project/26/uploads/5c21ed0a5ada4d4dc57a19e3b97d3e10/gcc-13.3.0-RTEMS-riscv-multilib.patch
%hash sha512 gcc-13.3.0-RTEMS-riscv-multilib.patch \
cb8815d02e9d9d51074daa262b95b2288083a6683676c38a27e304cd8479fc3db347e54a4f937e50e232d90da5742fd99d93612de7356bb7fa0bbc98e4938491

# C++ filesystem support
%patch add gcc -p1 https://gitlab.rtems.org/-/project/7/uploads/cc2fab985ed0ea695d333fbabd2b2887/v2-0001-libstdc-v3-Enable-features-for-RTEMS.patch
%hash sha512 v2-0001-libstdc-v3-Enable-features-for-RTEMS.patch \
bu6DuVp4StljkSpA4/rv3Mygi42+LR/ca9s9mLFS/ybTufVm91XYnDB9GF3mU/9h48jf66U9PvrOP0V+Ovb+RQ==

%define newlib_version 1b3dcfd
%define newlib_external 1
%define newlib_expand_name sourceware-mirror-newlib-cygwin-%{newlib_version}
%source set newlib --rsb-file=newlib-%{newlib_version}.tar.gz https://codeload.github.com/RTEMS/sourceware-mirror-newlib-cygwin/tar.gz/%{newlib_version}
%hash sha512 newlib-%{newlib_version}.tar.gz \
VBoijuKCbmakL74eYKJgt7AZYyGZYI0rgvnb5rNpaoR7Doh0dcqToEg9MStkw2waai63bJshO7RC6q0SdZVgXQ==

%define gcc_pre_install %include tools/rtems-install-stdcxx.cfg

%patch add gcc file:///local_patch/gcc.patch
%hash sha256 gcc.patch 9c2b548cf4c2b4dd202993b221afef14bd1ce9b799b2209755507190648fdffe

%define with_threads 1
%define with_plugin 0
%define with_iconv 1

%include %{_configdir}/gcc-13.cfg
20 changes: 15 additions & 5 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Motivation: keep the containers small.
- The gcc config for this is
- `rtems/config/tools/rtems-gcc-13.2-newlib-head.cfg`
- The tar file it gets is
- `https://ftp.rtems.org/pub/rtems/releases/6/rc/6.1-rc2/sources/gcc-13.2.0.tar.xz`
- `https://ftp.rtems.org/pub/rtems/releases/6/rc/6.1-rc2/sources/gcc-13.3.0.tar.xz`
- Which ends up in
- `sources/gcc-13.2.0.tar.xz`
- `sources/gcc-13.3.0.tar.xz`

It looks like we need to add something like this:
```
%patch add gcc %{rtems_gcc_patches}/gcc-core-4.4.7-rtems4.10-20120314.diff
%hash md5 gcc-core-4.4.7-rtems4.10-20120314.diff 084c9085c255b1f6a9204e239dde0579
%patch add gcc file:///local_patch/gcc.patch
%hash sha256 gcc.patch 9c2b548cf4c2b4dd202993b221afef14bd1ce9b799b2209755507190648fdffe
```
to `rtems-gcc-13.2-newlib-head.cfg` in order to patch the gcc build.
to `rtems-gcc-13.3-newlib-head.cfg` in order to patch the gcc build.

Note the value of %{rtems_gcc_pathces} gets set here:
- `rtems/config/rtems-urls.bset`
Expand All @@ -38,3 +38,13 @@ The above tar file is expanded into
- `rtems/build/powerpc-rtems6-gcc-13.2.0-newlib-3cacedb-x86_64-linux-gnu-1`

So just need to look through that and work out a patch! :-O

## UPDATE Jan 2024

So what needs patching is defined in local_patch/gcc.patch.
BUT NOTE: this essentially overriding the two Make MACROS:-
- MULTILIB_OPTIONS
- MULTILIB_DIRNAMES

Surely it would be better to work out how to pass overrides for these to the
make command line.

0 comments on commit 4b1211e

Please sign in to comment.