Known patches are listed below. Those not marked with strikethrough have been applied to the code in this respository.
Unapplied patches might be specific to a particular distribution or duplicate patches from other sources.
Please note that these patches do not reflect the only changes to the code. Other changes were made as needed to address various build issues and can be reviewed in the commit history.
With two minor tweaks to binutil’s bfd (adding BFD_HOSTPTR_T and bfd_fopen()), GDB 6.8 can also be included in this combined build. Both of these have been backported from the version of bfd that shipped with GDB 6.8.
Debian provides a binutils-h8300-hms package
based on binutils 2.16.1 that bundles several patches.
From the patches/series file in that archive (c.f. release versions here),
available Debian patches include those lised below.
Use this link to be redirected to the latest collection of stable patches.
Generally, unapplied patches are more Debian specific.
Patches maintained up through Debian release 2.16.1-10, with patch descriptions available here.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | ||
| ✔ | 002_gprof_profile_arcs | |
| ✔ | 003_gprof_see_also_monitor | |
| ✔ | 006_better_file_error | |
| ✔ | 012_check_ldrunpath_length | |
| ❌ | ||
| ❌ | ||
| ✔ | 128_ln_s_makefiles | |
| ✔ | 129_gas_h8300 | |
| ✔ | 130_coff_arm | |
| ✔ | 131_sprintf | |
| ✔ | 132_texinfo_fixes | |
| ❌ |
Patches maintained commencing with Debian release 2.16.1-11, with patch descriptions available here.
TODO:
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| ❌ | Was also included in v-10 | |
| 133-configure-signatures.patch | New subsequent to v-10 | |
| ✔ | 134-texinfo-fixes.patch | New subsequent to v-10 |
| 135-update-autotools.patch | New subsequent to v-10 | |
| 136-ld-libdir.patch | New subsequent to v-10 | |
| 137-abort-on-invalid-header.patch | New subsequent to v-10 | |
| 138-ldflags.patch | New subsequent to v-10 | |
| 139-spacepad.patch | New subsequent to v-10 | |
| ❌ | New with v-13 |
This patch was posted to the GCC mailing list on February 10, 2024, by Christophe Lyon (link), with the intent of always checking info dependencies. Within this project, that patch was leveraged in conjunction with addtional changes (c.f. commit: “Provide for skipping the build and install of info files”) to prevent the installation of (outdated) info files that would conflict with info files installed by newer GCC versions.
If desired, these info files may still be installed as a separate step via make install-info.
| Applied? | Patch File Name |
|---|---|
| ✔ | gcc-no-build-info.patch |
Subsequent to the final release of GCC 3 (v3.4.6 on March 6, 2006), four additional patches were pushed to the releases/gcc-3.4 branch. Patch files are available in both *.diff and *.patch forms.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | Three patches—all released later in 2006—pertain to m32r support but are superseded by more comprehensive patches from Debian (c.f. the Debian patch section). | |
| ❌ | The fourth patch—from 2009—provides a fix for compatibility with bison 2.4.1. Superseded by the more recent pair of Bison patches from the Red Hat compatibility patches and Debian patches. |
- ✔ Convert
struct ucontexttoucontext_tstruct ucontexthas been replaced byucontext_tin more recent releases.- GCC 3.4.6 needs to be updated accordingly in order to build for impacted targeted systems (e.g. not needed for targeting h8300-hitachi-coff but is needed for targeting x86-64).
- Patches
Red Hat provided backwards compatibility patches for GCC 3.4.
- Patch Sources (c.f. GitHub clone, which includes an additional Bison patch)
- Patch Ordering (spec file)
update-siginfo.shscript extracted from the spec file
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | Sparc optimization hack | |
| ✔ | 002-gcc34-ice-hack.patch | GCC compiler exit codes |
| ✔ | 003-gcc34-ppc64-m32-m64-multilib-only.patch | Config |
| ✔ | 004-gcc34-ia64-lib64.patch | Config |
| ✔ | 005-gcc34-java-nomulti.patch | Java |
| ❌ | Red Hat specific | |
| ✔ | 007-gcc34-pr16104.patch | GCC |
| 008-gcc34-var-tracking-fix.patch | Dwarf2 | |
| ✔ | 009-gcc34-i386-movsi-insv.patch | Config |
| ❌ | C++ vars – creates undefined reference to “determine_visibility” | |
| ✔ | 011-gcc34-pr14084.patch | GCC emit |
| ✔ | 012-gcc34-hashtab-recursion.patch | GCC vars |
| ✔ | 013-gcc34-java-jnilink.patch | Java |
| ❌ | libstdc++-v3 – Missing files referenced in Makefile | |
| ❌ | GCC – auto-patching failed | |
| ✔ | 016-gcc34-pr18300.patch | Config |
| ✔ | 017-gcc34-rh156291.patch | GCC |
| ✔ | 018-gcc34-weakref.patch | WeakRef |
| 019-gcc34-dwarf2-usefbreg.patch | Dwarf2 | |
| 020-gcc34-dwarf2-prefer-1elt-vartracking.patch | Dwarf2 | |
| 021-gcc34-dwarf2-pr20268.patch | Dwarf2 | |
| 022-gcc34-dwarf2-inline-details.patch | Dwarf2 | |
| 023-gcc34-dwarf2-frame_base.patch | Dwarf2 | |
| 024-gcc34-dwarf2-i386-multreg1.patch | Dwarf2 | |
| 025-gcc34-dwarf2-i386-multreg2.patch | Dwarf2 | |
| 026-gcc34-rh176182.patch | Dwarf2 | |
| ✔ | 027-gcc34-pr11953.patch | Config |
| ❌ | libstdc++-v3 – Unsupported on H8/300 | |
| 029-gcc34-pr26208.patch | Unwind, impacting multiple: Config, Java, libstdc++-v3, GCC | |
| ✔ | 030-gcc34-pr8788.patch | GCC |
| ✔ | 031-gcc34-rh137200.patch | GCC |
| ✔ | 032-gcc34-rh172117.patch | GCC |
| 033-gcc34-rh172876.patch | Dwarf2 | |
| ✔ | 034-gcc34-rh178062.patch | GCC vars |
| ✔ | 035-gcc34-pr21412.patch | Config |
| ❌ | GCC vars – auto-patching failed | |
| 037-gcc34-pr26208-workaround.patch | Unwind | |
| ✔ | 038-gcc34-libgcc_eh-hidden.patch | libgcc |
| 039-gcc34-frame-base-loclist.patch | Dwarf2 + Unwind | |
| ✔ | 040-gcc34-CVE-2006-3619.patch | Java |
| 041-gcc34-dwarf2-inline-details-fix.patch | Dwarf2 | |
| ✔ | 042-gcc34-CXXABI131.patch | libstdc++-v3 |
| ✔ | 043-gcc34-rh205919.patch | GCC |
| ✔ | 044-gcc34-rh207277.patch | GCC |
| ❌ | GCC vars – a file to patch (var-tracking.c) does not exist | |
| ✔ | 046-gcc34-java-zoneinfo.patch | Java |
| ✔ | 047-gcc34-libgcc-additions.patch | libgcc |
| ✔ | 048-gcc34-pr24975.patch | libstdc++-v3 |
| ✔ | 049-gcc34-rh233941.patch | GCC/g77 |
| ✔ | 050-gcc34-rh234515.patch | libstdc++-v3 |
| ✔ | 051-gcc34-rh235008.patch | GCC |
| ✔ | 052-gcc34-rh235255.patch | GCC |
| ✔ | 053-gcc34-rh242685.patch | libstdc++-v3 |
| ❌ | libstdc++-v3 | |
| ✔ | 101-gcc34-makeinfo.patch | Config (for Makeinfo 4.10+) |
| ✔ | 102a-gcc34-bison4.patch | Fixes for Bison breaking changes |
| ✔ | 102b-gcc34-bison.patch | Fixes for Bison breaking changes |
| ✔ | 103-gcc34-pr56258.patch | Address Makeinfo v5+ documentation errors |
| dummylib.sh | ||
| ✔ | update-siginfo.sh | struct siginfo to siginfo_t |
Debian provides a gcc-h8300-hms package
based on gcc 3.4.6 that bundles several patches.
From the patches/series file in that archive (c.f. release versions here),
available Debian patches include those lised below. Use this link to be redirected to the latest collection of stable patches.
Generally, unapplied patches are more Debian specific.
Numerous patches were maintained up through Debian release dfsg2-4.2, with patch descriptions available here.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | ||
| ✔ | 001_h8300_64bit | |
| ✔ | gcc-textdomain.dpatch | |
| ❌ | ||
| ✔ | libstdc++-doclink.dpatch | |
| ✔ | libstdc++-doxygen-syntax.dpatch | |
| ✔ | amd64-specs.dpatch | |
| ✔ | gccbug.dpatch | |
| ✔ | gccbug-posix.dpatch | |
| ✔ | gcc-textdomain.dpatch | |
| ✔ | hppa-toplevel.dpatch | |
| ✔ | m68k-update.dpatch | |
| ✔ | arm-bigendian.dpatch | |
| ✔ | cpu-default-i486.dpatch | |
| ✔ | deb-protoize.dpatch | |
| ✔ | hurd-changes.dpatch | |
| ✔ | m32r-gotoff.dpatch | |
| ✔ | m32r-stack.dpatch | |
| ✔ | m32r-fixes.dpatch | |
| ✔ | m32r-limits.dpatch | |
| ✔ | m32r-pie.dpatch | |
| ✔ | m32r-remove-addsi3.dpatch | |
| ✔ | m32r-auto.dpatch | |
| ✔ | alpha-ieee.dpatch | |
| ✔ | libstdc++-mips-atomic.dpatch | |
| ✔ | bin_false_fixup | |
| ❌ | ||
| ❌ | ||
| ✔ | fix_ftbs.diff |
Commencing with Debian release dfsg2-5, the number of patches was reduced, while a few new ones were added. Patch descriptions for these are available here.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | Was also included in dfsg2-4.2 | |
| ❌ | New subsequent to dfsg2-4.2 | |
| ✔ | 0030-Add-now-mandatory-parameter-to-AM_GNU_GETTEXT.patch | New subsequent to dfsg2-4.2 |
| 0032-Fix-format-not-a-string-literal.patch | New subsequent to dfsg2-4.2 | |
| 0033-Remove-AC_CONFIG_AUX_DIR-in-libiberty-configure-temp.patch | New subsequent to dfsg2-4.2 | |
| ✔ | 0034-Fix-c-parse.y-build-error.patch | New subsequent to dfsg2-4.2 |
The GNU Pascal Compiler (GPC) patch most applicable to this particular GCC version were also applied. The other patches for more general GCC modernization (such as for multiarch and ucontext, as noted in the GPC ReadMe) are covered by other patches and updates.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ✔ | gcc-3.4.4.diff |
The GCC front end for the Common Language Infrastructure (CLI) Common Intermediate Language (CIL) was a project to take compiled CIL as input and generate machine-executable code as output. After the front end was separated, the code was originally written against GCC 4.3 and then later updated to GCC 4.5.
Unfortunately, GCC 4.3 has internal compiler error (ICE) issues (causing builds of GCC targeting h8300-hitachi-coff to fail), and GCC 4.5 is after “generic coff” support was dropped from GCC. The patching done here attempts to get the Common Intermediate Language Front End (CIL FE) working with that skipped version—GCC 4.4.
An extract of this CIL FE from the GCC repositories is at BrickBot/gcc-cli-fe, and the patches and files here are based on that code, and the branches in that respository cover the following:
| Branch Name | Description |
|---|---|
| master | The original, unedited branch with all files |
| h8300-coff-base | Branch of the last commit against GCC 4.3 before GCC was updated to 4.5 |
| h8300-coff | Starting from branch h8300-coff-base, apply updates to make it buildable (but excluding libcilsupport) |
| h8300-coff-libcilsupport | Adds updates to libcilsupport from where branch h8300-coff left off |
| post-h8300-cli-fe-squash | Branch created for collapsing updates subsequent to the GCC 4.5 update into a single squash commit, from which patch files could then be generated |
Starting with the migration from GCC 4.3 to 4.5,
all subsequent CIL-specific commits have been captured as patch files. This complete set of patches can
be found in the file post-h8300-cli-fe-squash.patch; however, to make it easier to work with the patches,
this single file was split into several separate files based on the impacted functionality.
From these, updates were make to GCC 4.4.7, working forward from the GCC 4.3-based code to the 4.5-based code.
| Individual Patch Files | Description |
|---|---|
post-h8300-cli-fe-squash-just-cil.patch |
Changes to code under gcc/cil |
post-h8300-cli-fe-squash-just-cil-parser.patch |
Changes specific to gcc/cil/parser.c |
post-h8300-cli-fe-squash-just-gcc-common.patch |
Changes to “common” files (e.g. Makefile, configure, gcc/common.opt, gcc/config/*) |
post-h8300-cli-fe-squash-just-libcilsupport.patch |
Changes specific to libcilsupport |
Additionally, there are several auto-generated *.h files that unfortunately aren’t all fully autogenerated under GCC 4.4. In particular, the following files contained incomplete definitions when autogenerated under GCC 4.4, so “static” copies were capture from a build of the version based on GCC 4.5 and then referenced statically within the updates for GCC 4.4.
| Incomplete Dynamically-Generated File | #include’d by |
|---|---|
gt-cil-bindings.h |
gcc/cil/bindings.c |
gt-cil-stack.h |
gcc/cil/stack.c |
gtype-cil.h |
gcc/cil/cil1.c |
Red Hat provided backwards compatibility patches for GCC 4.4.
TODO: This set for GCC 4.4.7 includes 37 patches to be reviewed and (potentially) applied.
Debian provided sets patches for GCC 4.4.7, with the last set being versioned 4.4.7-8. Patches are embedded as a patch file itself (solely containing all new files, with no file edits) in gcc-4.4_4.4.7-8.diff.gz.
TODO: This set for GCC 4.4.7 includes 171 patches to be reviewed and (potentially) applied.
From the GCC mailing list in February 2024, this small patch enables skipping the building and installing of info files.
While newlib-1.20.0 was technically the last version to support h8300-*-coff, version 1.20.0 introduces incompatibilities with version of libiberty used by the other tools supporting h8300-*-coff (c.f. gcc list), so newlib-1.19.0 is effectively the last version of NewLib to support h8300-*-coff.
While Debian did not provide a newlib-1.19.0 package, all patches from Debian’s packaging of newlib-1.18.0 appear applicable to newlib-1.19.0 as well.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ✔ | 60_newlib-libgloss-eabi.patch | |
| ✔ | 61_newlib_arm_include.patch | |
| ✔ | 62_long_double_infinity.patch | |
| ✔ | 65_multiarch-headers.patch |
Although GDB 6 is best suited to be built together as part of a combined GCC build with GCC 3.4.6 and GCC 4.4.7, the GDB server built into BrickEmu is based on the GDB 5 specifications, and so builds of GDB 5 a needed to be able to utilize the debugging capabilities of BrickEmu.
While Debian did not provide a gdb-5.3 package, some patches from Debian’s packaging of gdb-5.2 appear applicable to gdb-5.3 as well. No series file appears to exist for these patches, so order is based on the diff dates in the respective patch files.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ✔ | 05_gdb-hppa.patch | HPPA |
| ❌ | Patch from 5.2 not applicable to 5.3 | |
| ❌ | Readline | |
| ❌ | Readline | |
| ❌ | Readline | |
| ❌ | Patch from 5.2 not applicable to 5.3 | |
| ❌ | Readline | |
| ❌ | Readline | |
| ✔ | 45_java-testsuite-jmisc.patch | Test for jmisc |
| ❌ | Patch from 5.2 not applicable to 5.3 | |
| ❌ | Patch from 5.2 not applicable to 5.3 | |
| ✔ | 60_hppa-core.patch | HPPA |
GDB 6.8 is able to be built together with the rest of the GNU toolchain as part of a combined build.
The patches listed below are from Debian’s packing of gdb-6.8. Patch order is based on the “series” file.
| Applied? | Patch File Name | Notes |
|---|---|---|
| ✔ | 05_member-field-symtab.patch | Patch for Debian bug #239535 |
| ✔ | 10_thread-db-multiple-libraries.patch | Support loading two libthread_db DSOs |
| ❌ | Eliminate “noisy” CIE warning; not suitable for upstream | |
| ❌ | gdbinit; while concept seemed acceptable, implementation was not popular upstream | |
| ✔ | 25_gdb-pascal-support.patch | Pascal support |
| ✔ | 30_gdb-fortran-main.patch | Set the main function in Fortran programs to "MAIN__" to help with recognizing as Fortran |
| 35_linux-clear-thread-list.patch | Patch for Debian bug #303736, but the change might not be in the right place? | |
| ✔ | 40_man-page-args.patch | Man page updates for arguments |
| ✔ | 45_bfd-get-mtime-less.patch | Updates for bfd mtime; applied upstream after GBD 6.8 |
| ✔ | 50_gdb-rbreak-quoting.patch | Quote symbol name before passing it to break_command; backported from trunk after GDB 6.8 |
| ✔ | 55_ia64-array-bound.patch | Correct array access |
| ✔ | 60_cp-support-uninit.patch | Initialize storage |
| ✔ | 65_m68k-nat-build-fix.patch | Fix typo |
The last version of GDB to technically support the h8300-hitachi-coff was 7.12.1. While GDB 7.12.1 seems to indicate that h8300-*-*-coff targets are supported (note lack of support for h8300-*-*-coff [covered by the "h8300-*-*-*" case] in bfd/config.bfd in later versions), in practice this is broken and will trigger various malloc errors on attempting to initiate a debug session. GDB 6 has not exhibited this issue.
Additionally, GDB 7 is incompatible with the shared libraries that are part of the GNU toolchain and must be built separately, but GDB 6 does maintain that compatibility and is able to built together with the rest of the GNU toolchain.
Debian never released a corresponding package for GDB 7.12.1 (c.f. list), but it did maintain a package for version 7.12 which included a number of patches (c.f. patch descriptions and patch ordering (series file)).
| Applied? | Patch File Name | Notes |
|---|---|---|
| ✔ | gdb-fortran-main.patch | |
| ✔ | solve_PATH_MAX_issue.patch | |
| ✔ | gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch | |
| ✔ | python-config.patch | |
| ✔ | gdb-glibc-vdso-workaround.patch | |
| ❌ | ||
| Hurd Support – Upstream Backports | ||
| ✔ | 0001-Hurd-Adjust-to-Per-inferior-Inferior-qualified-threa.patch | |
| ❌ | Commented out in series file | |
| ✔ | 0004-Hurd-C-Avoid-GNU-C-nested-functions.patch | |
| ✔ | 0005-Hurd-C-Avoid-const-char-to-char-casts.patch | |
| ✔ | 0006-Hurd-C-kern_return_t-vs.-error_t.patch | |
| ✔ | 0007-Hurd-C-Mach-Hurd-headers-and-MIG-stubs-are-not-yet-f.patch | |
| ✔ | 0008-Hurd-In-the-CLI-use-parse_thread_id-instead-of-globa.patch | |
| ✔ | 0021-Avoid-PATH_MAX-usage.patch | |
| ✔ | 0022-Hurd-Adjust-to-changes-to-push-pruning-old-threads-d.patch | |
| ✔ | explicit-cast-void.patch | |
| ✔ | hurd-backport-for-7.12-branch.patch | |
| From gdb-7.12-branch | ||
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 | |
| ❌ | Patch already incorporated in release 7.12.1 |