Previous: Missing Extends Up: Intro
There are a few scripts in the repo for installing gcc and binutils as well as scripts to create new patches and debian packages.
I work exclusively on Linux (debian bookworm currently) and have a script to create a .deb package which can be used for debian, ubuntu and others. The .deb package installs bins, libs, etc, in /opt/tms9900-gcc by default. Many users though are on Windows or MacOS and I am relying on others to build packaged releases for those OSs since I can't.
Development
The src files are contained in the "dev" directory. Only modifications to gcc and binutils are stored in the repo. This means only storing about 50 files as opposed to over 60,000. The dev directory contains two copies of any files that have been modified. The original files for gcc are in gcc-4.4.0-orig and the modified files are in gcc-4.4.0. Similarly for binutils. New files (including "gcc/config/tms9900/tms9900.md") have a corresponding empty file in the orig directory. This allows diff to create a patch that includes all changes and all additions to the stock gcc-4.4.0 distribution.
Files to be edited are mostly in "dev/gcc-4.4.0/gcc/config/tms9900". This dir contains the md file as well as a few C and H files. It also contains some library asm functions which get included in libgcc.a
To rebuild the compiler in the dev hierarchy, from the "dev/gcc-4.4.0/build" directory, you can use the following commands to build and install gcc and libgcc:
make all-gcc |
This assumes of course this directory has previously been configured for builds, from the build directory, using:
../configure --prefix <target-dir> --target=tms9900 --enable-languages=c,c++ |
Release
The script mkpatches.sh will generate new patch files. It takes a version number as a parameter. It will update the gcc DATESTAMP and REVISION files with the current date and the supplied version number. The patch revision can be queried in code by accessing the __TMS9900_PATCH_MAJOR__ and __TMS9900_PATCH_MINOR__ macros which return integer values.
Install
The primary install tool is a script called install.sh. It downloads gcc-4.4.0 and binutils-2.19.1, applies the patches to them, builds the compiler and toolchain, and installs to the specified directory. This script will create a directory called build in the pwd and do all its work in there. It marks progress by creating progress files such as ".gcc_patched" and ".gcc_built". To do a clean build from updated patches, the easiest thing to do is "rm -rf build" or at the very least remove the progress files.
Test
Debug
#!/bin/bash INCLUDE=-I../libti99i CFLAGS="$2 $3 $4 $5 $6 -Wall -da -std=c99 -fomit-frame-pointer $INCLUDE" ../dev/gcc-4.4.0/build/gcc/cc1 $CFLAGS < $1
|
; addhi3-20 : (insn 20 4 21 <stdin>:6 (set (reg/f:HI 10 r10) ; (plus:HI (reg/f:HI 10 r10) ; (const_int -2 [0xfffffffffffffffe]))) 63 {addhi3} (nil)) dect r10 ; movhi-21 : (insn 21 20 22 <stdin>:6 (set (mem:HI (reg/f:HI 10 r10) [0 S2 A16]) ; (reg:HI 11 r11)) 12 {tms9900_movhi} (expr_list:REG_DEAD (reg:HI 11 r11) ; (nil))) mov r11, *r10
|
No comments:
Post a Comment