From 03045ced0cf593571875e418f853aec5576a7bbb Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 22 Jan 2025 14:13:29 +0000 Subject: [PATCH] fix legacy networking --- Dockerfile.beatnik | 5 ++- local_patch/patch-rsb.sh | 2 +- local_patch/rtems-default-tools.bset | 29 -------------- local_patch/rtems-gcc-13.2-newlib-head.cfg | 23 ----------- local_patch/rtems-gcc-13.3-newlib-head.cfg | 34 +++++++++++++++++ notes.md | 44 +++++++++++++++++++--- 6 files changed, 77 insertions(+), 60 deletions(-) delete mode 100644 local_patch/rtems-default-tools.bset delete mode 100644 local_patch/rtems-gcc-13.2-newlib-head.cfg create mode 100644 local_patch/rtems-gcc-13.3-newlib-head.cfg diff --git a/Dockerfile.beatnik b/Dockerfile.beatnik index 2d5f0de..062973a 100644 --- a/Dockerfile.beatnik +++ b/Dockerfile.beatnik @@ -66,11 +66,12 @@ RUN git apply VMEConfig.patch && \ RUN ./waf && \ ./waf install -RUN curl https://ftp.rtems.org/pub/rtems/releases/${RTEMS_MAJOR}/${RTEMS_VERSION}/sources/rtems-net-legacy-${RTEMS_VERSION}.tar.xz \ +RUN cd ${RTEMS_TOP} && \ + curl https://ftp.rtems.org/pub/rtems/releases/${RTEMS_MAJOR}/${RTEMS_VERSION}/sources/rtems-net-legacy-${RTEMS_VERSION}.tar.xz \ | tar -xJ # add in the legacy network stack -WORKDIR ${RTEMS_TOP}/rtems-net-legacy +WORKDIR ${RTEMS_TOP}/rtems-net-legacy-${RTEMS_VERSION} RUN ./waf configure --prefix=${RTEMS_PREFIX} --rtems-bsps=${RTEMS_ARCH}/${RTEMS_BSP} && \ ./waf && \ ./waf install diff --git a/local_patch/patch-rsb.sh b/local_patch/patch-rsb.sh index 2a94c0c..a49af27 100755 --- a/local_patch/patch-rsb.sh +++ b/local_patch/patch-rsb.sh @@ -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 diff --git a/local_patch/rtems-default-tools.bset b/local_patch/rtems-default-tools.bset deleted file mode 100644 index 35c9235..0000000 --- a/local_patch/rtems-default-tools.bset +++ /dev/null @@ -1,29 +0,0 @@ -# -# Default tools build -# - -# GCC requires a GNU sed so build an internal version if one is not -# available -# -%define _internal_gsed_path %{_tmpinternal} -%defineifnot with_rtems_gsed textproc/gsed-internal - -# GNU tools need texinfo for makeinfo to build documentation -%define _internal_texinfo_path %{_tmpinternal} -%defineifnot with_rtems_texinfo print/texinfo-internal - -# -# Build gdb first to raise the Python install error as early as -# possible. -# -# GCC and GDB need GMP. -# -%{with_rtems_dtc} -%{with_rtems_expat} -%{with_rtems_gmp} -%{with_rtems_gsed} -%{with_rtems_texinfo} -%{with_rtems_gdb} -%{with_rtems_binutils} -%{with_rtems_gcc} -%{with_rtems_tools} diff --git a/local_patch/rtems-gcc-13.2-newlib-head.cfg b/local_patch/rtems-gcc-13.2-newlib-head.cfg deleted file mode 100644 index 8eb8d2c..0000000 --- a/local_patch/rtems-gcc-13.2-newlib-head.cfg +++ /dev/null @@ -1,23 +0,0 @@ -%include %{_configdir}/checks.cfg -%include %{_configdir}/base.cfg - -%define gcc_version 13.2.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 \ - 2Z5IJqcNsEUERn40np+67apYcHZs2nxcq1DN6+3EvnVevKW3ieEjKjSiC+GgtgCX3pKA7+R723HHMlHjCwhiog== - -%define newlib_version 3cacedb -%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 \ - ia0ce+bdENUO3qYj00jrZB8FjSejmTWuRqEdNE8nI2llf30mh8leUn5fCoHB0Oa7rRVBjEu3n0F12ZK9skuegQ== - -%patch add gcc file:///local_patch/gcc.patch -%hash sha256 gcc.patch f3fd225acc18ddd16543e02d014a2cc1541216c9d9e9dd0143aa5cf74c09b54b - -%define with_threads 1 -%define with_plugin 0 -%define with_iconv 1 - -%include %{_configdir}/gcc-13.cfg diff --git a/local_patch/rtems-gcc-13.3-newlib-head.cfg b/local_patch/rtems-gcc-13.3-newlib-head.cfg new file mode 100644 index 0000000..8f956c8 --- /dev/null +++ b/local_patch/rtems-gcc-13.3-newlib-head.cfg @@ -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 diff --git a/notes.md b/notes.md index 094db39..58e1c25 100644 --- a/notes.md +++ b/notes.md @@ -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` @@ -38,3 +38,37 @@ 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. + +--- + +# Notes on attempts to change compiler options + +https://docs.rtems.org/docs/4.11.0/rsb + +To run the source builder manually (NOT IN TMP! due to executable permissions): +```bash +curl -O https://ftp.rtems.org/pub/rtems/releases/6/6.1/sources/rtems-source-builder-6.1.tar.xz +tar -xJf rtems-source-builder-6.1.tar.xz +cd rtems-source-builder-6.1/rtems +# Note that the 6 directory is found in rtems-source-builder-6.1/rtems/config +# Note that no-clean allows us to make changes and test re-running the build quickly +../source-builder/sb-set-builder --prefix=../rtems-build 6/rtems-powerpc.bset --no-clean +``` + + +../source-builder/sb-set-builder can be passed --dry-run and other args +see [debugging](https://docs.rtems.org/docs/4.11.0/rsb/configuration.html#debugging). +Also note that the log file appears in cwd as +``` +rsb-log-202xxxxx-xxxxx.txt +``` \ No newline at end of file