sh-elf-vhex - v2.0.0-dev12 : review all scripts

*fix*
> [project]
  | [readme] review content
> [scripts]
  | [all] review all strings and help message
This commit is contained in:
YannMagnin 2023-12-17 11:06:14 +01:00
parent 372f425935
commit da8dfe3861
No known key found for this signature in database
GPG Key ID: D82629D933EADC59
9 changed files with 36 additions and 35 deletions

View File

@ -17,10 +17,10 @@ project and I need this functionality. I had discovered, thanks to
[Lephenixnoir](https://silent-tower.net/research/),
that we could generate 'shared' libraries by using directly `ld` with a custom
linker script, but this workaround was of short duration. Indeed, we are
dependent on a library called `libgcc`, which provide some useful critical
primitives and which is generated only statically (therefore with
non-relocatable code), which broke all shared object file generated with this
dependencie (and a lot of cases can involve this librarie).
dependent on a library called `libgcc`, which provides some useful critical
primitives and is generated only in static (therefore with
non-relocatable code) which breaks all shared object files generated with this
dependency (and a lot of cases can involve this library).
With the help of Lephenixnoir, we tried to add a target for the
superH architecture called `sh-elf-vhex`, allowing us to enable these features
@ -34,13 +34,13 @@ particular GCC.
* only C is supported
* only big endian encoding is supported
* we use the stdint header from `newlib`. Otherwise, the generation of `stdint.h` is incomplete
* we use the `stdint` header from `newlib`. Otherwise, the generation of `stdint.h` is incomplete
* we only target the `SH4A-NOFPU` processor (no backward compatibility with the SH3 assembler)
* each public symbol begins with an underscore
* by default, we link our own C library to each generation of an object file
* by default, we link our own C library to each generation of object files
* we do not provide a specialized default linker script (for the moment)
* compilation of the shared libgcc (`t-slibgcc`)
* the compilation of the libgcc in PIC (`t-libgcc-pic`)
* compilation of the libgcc in PIC (`t-libgcc-pic`)
* compilation of the library for emulated floating point numbers (`t-fdpbit`)
## Technical notes
@ -52,7 +52,7 @@ The bootstrap process will clone this repository at
* `prefix-sysroot` = `~/.local/share/sh-elf-vhex/_sysroot`
* `prefix-install` = `~/.local/bin/`
The project also automatically install
The project also automatically installs
[vxOpenLibm](https://github.com/YannMagnin/vxOpenLibm)
and [vxLibc](https://github.com/YannMagnin/vxLibc)
@ -65,7 +65,7 @@ curl -s "https://github.com/YannMagnin/sh-elf-vhex/+/HEAD/scripts/bootstrap.sh?f
```
Or by cloning the project and using the `bootstrap.sh` script, see
`./scripts/bootstrap.sh --help` for more information about possible operation
`./scripts/bootstrap.sh --help` for more information about possible operations
you can do with it (like uninstalling the compiler)
```bash
@ -79,10 +79,11 @@ It takes about twenty minutes for the build.
## Supported version list
Note that GCC `12.x` will never be supported since many critical bugs has been
Note that GCC `12.x` will never be supported since many critical bugs have been
found for the superh backend
(https://gcc.gnu.org/bugzilla/show\_bug.cgi?id=106609)
- GCC `13.2.0` and binutils `2.41`
- GCC `11.2.0` and binutils `2.31`
## Special thanks

View File

@ -50,13 +50,13 @@ source ./_utils.sh
if [[ ! -f "$prefix_sysroot/bin/sh-elf-vhex-gcc" ]]
then
echo "error: Are you sure to have built sh-elf-vhex ? it seems that" >&2
echo " the 'as' tool is missing..." >&2
echo " the 'sh-elf-vhex-gcc' tool is missing..." >&2
exit 1
fi
if [[ "$cache" == 'false' ]]
then
echo "$TAG Cleaning up build files..."
echo "$TAG Cleaning up built files..."
rm -rf ../../build
fi

View File

@ -16,7 +16,7 @@ Configurations:
--prefix-install Installation (bin) prefix
--prefix-sysroot Sysroot (lib, header, ...) prefix
--prefix-clone Clone prefix
--purge Remove the clonned folder
--purge Remove the cloned folder
EOF
exit 0
}
@ -37,7 +37,7 @@ for arg
--prefix-sysroot=*) prefix_sysroot=${arg#*=};;
--prefix-clone=*) prefix_clone=${arg#*=};;
*)
echo "error: unreconized argument '$arg', giving up." >&2
echo "error: unrecognized argument '$arg', giving up." >&2
exit 1
esac
done
@ -48,14 +48,14 @@ done
if [[ -z "$prefix_install" || -z "$prefix_sysroot" || -z "$prefix_clone" ]]
then
echo 'Missing prefix information, abord' >&2
echo 'Missing prefix information, abort' >&2
exit 1
fi
if [[ ! -f "$prefix_sysroot/bin/sh-elf-vhex-as" ]]
then
echo 'error: Are you sure to have built sh-elf-vhex ? it seems that' >&2
echo ' Missing '\''sh-elf-vhex-as'\'' tool...' >&2
echo 'error: Are you sure to have built sh-elf-vhex ?' >&2
echo ' Missing '\''sh-elf-vhex-as'\'' tool' >&2
exit 1
fi

View File

@ -98,7 +98,7 @@ function utils_archive_download()
if [[ -d "$output/archive" ]]
then
echo "$TAG Found archive, skipping download"
echo "$TAG Archive found, skipping download"
exit 0
fi

View File

@ -24,7 +24,7 @@ for arg;
do case "$arg" in
--help | -h) help;;
*)
echo "error: unreconized argument '$arg', giving up." >&2
echo "error: unrecognized argument '$arg', giving up." >&2
exit 1
esac
done
@ -41,7 +41,7 @@ source ../_utils.sh
if [[ -f ../../_build/binutils/.fini ]]
then
echo "$TAG already build, skipping rebuild"
echo "$TAG already built, skipping rebuild"
exit 0
fi
@ -66,6 +66,6 @@ echo "$TAG Installing binutils to sysroot..."
utils_makecmd install-strip
# Indicate that the build is finished
# Indicate that the construction is finished
touch ../.fini

View File

@ -70,7 +70,7 @@ then
as_version=$($as_bin --version | head -n 1 | grep -Eo '[0-9.]+$')
if [[ "$as_version" == "$version" ]]
then
echo "$TAG Version '$version' already installed, skipping rebuild" >&2
echo "$TAG Version '$version' already installed, skipping rebuilding" >&2
mkdir -p ../../_build/binutils/
touch ../../_build/binutils/.fini
exit 0
@ -160,9 +160,9 @@ cd ../../_build/binutils || exit 1
# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92008
touch ./archive/intl/plural.c
# Apply binutils patchs for Vhex
# Apply binutils patches for Vhex
echo "$TAG Apply Vhex patchs..."
echo "$TAG Apply Vhex patches..."
cp -r "$_src/../../patches/binutils/$version"/* ./archive/
# Create build folder

View File

@ -21,8 +21,8 @@ Options:
Notes:
This project will automatically install the vxLibc. You can use the
VERBOSE env var to enable the verbose mode without explicit the '--verbose'
option.
VERBOSE env var to enable the verbose mode without explicit use of the
'--verbose' option.
EOF
exit 0
}
@ -69,7 +69,7 @@ then
then
echo -e \
"It seems that the project is already existing :pouce:\n" \
'If you realy want to install this project use the "--overwrite"' \
'If you really want to install this project use the "--overwrite"' \
'option.'
exit 1
fi
@ -153,7 +153,7 @@ else
--prefix-clone="$prefix_clone" \
--purge
} || {
echo 'Error during unstallation step, abort' >&2
echo 'Error during uninstallation step, abort' >&2
exit 1
}
echo 'Successfully uninstalled sh-elf-vhex'

View File

@ -24,7 +24,7 @@ for arg;
do case "$arg" in
--help | -h) help;;
*)
echo "error: unreconized argument '$arg', giving up." >&2
echo "error: unrecognized argument '$arg', giving up." >&2
exit 1
esac
done
@ -48,7 +48,7 @@ prefix_sysroot=$(cat ../../_build/gcc/sysroot_info.txt)
if [[ -f ../../_build/gcc/.fini ]]
then
echo "$TAG already build, skipping rebuild"
echo "$TAG already built, skipping rebuilding"
exit 0
fi
@ -142,7 +142,7 @@ echo "$TAG Install libsanitizer..."
utils_makecmd install-strip-target-libsanitizer
#---
# Indicate that the build is finished
# Indicate that the building up is finished
#---
touch ../.fini

View File

@ -58,7 +58,7 @@ echo "$TAG Target gcc version -> $version"
echo "$TAG Sysroot found -> $prefix_sysroot"
#---
# Avoid rebuilds of the same version
# Avoid rebuilding of the same version
#---
gcc_bin="$prefix_sysroot/bin/sh-elf-vhex-gcc"
@ -68,7 +68,7 @@ then
gcc_version=$($gcc_bin --version | head -n 1 | grep -Eo '[0-9.]+$')
if [[ "$gcc_version" == "$version" ]]
then
echo "$TAG Version $version already installed, skipping rebuild"
echo "$TAG Version $version already installed, skipping rebuilding"
mkdir -p ../../_build/gcc/
touch ../../_build/gcc/.fini
exit 0
@ -92,7 +92,7 @@ utils_archive_download \
cd ../../_build/gcc || exit 1
echo "$TAG Apply Vhex patchs..."
echo "$TAG Apply Vhex patches..."
cp -r "../../patches/gcc/$version"/* ./archive/
# Store the sysroot prefix to avoid different CLI between binutils and gcc
@ -113,7 +113,7 @@ echo "$TAG install dependencies..."
cd ./archive || exit 1
if ! utils_warn_callcmd ./contrib/download_prerequisites
then
echo "The installation of GCC's prerequisites have failed"
echo "The installation of GCC's prerequisites has failed"
read -p 'Do you want to continue the installation ? [yN]: ' -r valid
if [[ "$valid" != 'y' ]]; then
echo 'Operation aborted o(x_x)o'