GNU/Linux on SuperH Development tools GENERAL RPMS in this release include cross development environments for SH/Linux. I have build these packages so that the result of GNU/Linux on SuperH Project may be easy to use. These are based on binutils-2.11.2, gcc-3.0.3, glibc-2.2.4. CAUTION: ABSOLUTELY NO WARRANTY. Systems Required I tested these packages on RedHat 7.1J system. It also works on RedHat 6.2. Other distributions which use rpm may be OK, but if binutils or gcc do not run then try to rebuild them from SRPMS as described later. If you already installed previous versions of these packages, it is highly recommended that you should uninstall all of them before install these packages. And then remove /usr/sh[34]*-linux/include as follows. # rm -rf /usr/sh[34]*-linux/include INSTALL (host) Root access is required when install these packages. Install packages like this. # rpm -Uvh rpm/RPMS/i386/Redhat7.1/*.rpm # rpm -Uvh rpm/RPMS/noarch/host/*.rpm SH/Linux kernel is not included in the package. At least, we need kernel header files in order to cross development, install linux-2.4.x kernel under /usr/src/linux-sh-2.4 as follows. # cd /tmp # tar xzf linux-2.4.9.tar.gz # mv linux /usr/src/linux-sh-2.4 # cd /usr/src/linux-sh-2.4 # make ARCH=sh menuconfig After install, following directories are created. usr --+-- bin binaries, shell scripts +-- lib ---- gcc-lib --+--- sh-linux cross compiler | +--- sh3-linux | +--- sh3eb-linux | +--- sh4-linux | +--- sh4eb-linux | +-- sh-linux --+-- bin binary executables (binutils) | +-- include include files | +-- lib libraries for sh3-linux (symlinks) | +-- m4 libraries for sh4-linux (symlinks) | +-- mb libraries for sh3eb-linux (symlinks) | +-- m4 libraries for sh4eb-linux (symlinks) | +-- sh3-linux --+-- bin symlink, shell script | +-- include symlink to /usr/sh-linux/include | +-- lib libraries for sh3-linux | +-- sh3eb-linux ... +-- sh4-linux ... +-- sh4eb-linux ... | +-- src --- linux-sh-2.4 --- include kernel include files Installed commands are as follows. binutils(assembler, linker, etc) sh-linux-as, sh-linux-ld, etc ... executable binaries sh3-linux-as, sh3-linux-ld, etc ... for sh3-linux sh3eb-linux-as, sh3eb-linux-ld, etc ... for sh3eb-linux sh4-linux-as, sh4-linux-ld, etc ... for sh4-linux sh4eb-linux-as, sh4eb-linux-ld, etc ... for sh4eb-linux gcc(c,c++ compiler) sh-linux-gcc --- multilibed cross compiler for sh-linux sh3-linux-gcc --- non-multilib cross compiler for sh3-linux sh3eb-linux-gcc --- non-multilib cross compiler for sh3eb-linux sh4-linux-gcc --- non-multilib cross compiler for sh4-linux sh4eb-linux-gcc --- non-multilib cross compiler for sh4eb-linux INSTALL (target¡Ë Install packages for target(sh3-linux) under /home/foo/export as follows. Root access is required. Initialize rpm data base. # mkdir -p /home/foo/export/var/lib/rpm # rpm --root /home/foo/export --initdb Install all packages # rpm --root /home/foo/export -ivh --force --nodeps --ignorearch --noscripts rpm/RPMS/noarch/target/*.rpm # rpm --root /home/foo/export -ivh --force --nodeps --ignorearch --noscripts rpm/RPMS/sh3/*.rpm Copy /dev/* from host. # cp -a /dev /home/foo/export Edit /home/foo/export/etc/* as you like. Run NFSD on that host and mount /home/foo/export as root file system of the target Compatibility Problem This release of glibc package uses different version number of the shared library from older release based on glibc-2.2.2, older binary executable does not run after install new glibc package on the target system. To avoid this problem, relink all binaries or create symlinks on the target system as follows. /lib/libc.so.6.1 -> libc.so.6 /lib/libm.so.6.1 -> libm.so.6 /lib/libBrokenLocale.so.1.1 -> libBrokenLocale.so.1 Rebuild from SRPM Create ~/.rpmmacros which contains %_topdir macro in order to build RPMS as normal(non root) user (foo). --- cut here --- %_topdir /home/foo/rpm --- cut here --- Create working directories. $ mkdir -p rpm/RPMS $ mkdir rpm/BUILD $ mkdir rpm/SRPMS $ mkdir rpm/SPECS $ mkdir rpm/SOURCES Install SRPM $ rpm -ivh xxx.src.rpm Here, spec file and source files are expanded in rpm/SPECS, rpm/SOURCES. Build binutils, gcc as follows. (Install glibc-sh*-linux-*.noarch.rpm before rebuilding gcc) $ cd rpm/SPECS $ rpm -bb --target=i386-linux binutils-sh-linux.spec $ rpm -bb --target=i386-linux gcc-sh-linux.spec If successful, rpm files are generated in rpm/RPMS/i386/, and then install them. Rebuild library packages for the host from SRPM After install SRPM, do as follows. $ rpm -bb --target=noarch xxx-sh-linux.spec Rebuild binary packages for the target from SRPM After install SRPM, do as follows. $ rpm -bb --target=sh3-linux xxx-sh-linux.spec SUGIOKA Toshinobu