My compiler gives me the following error on window once I try to add the setjmp commands despite me having setjmp.h in the include folder and #include <setjmp.h> in my source code:

Code:
(.text.startup+0x100): undefined reference to `_setjmp'


How can I fix this please? I also tried putting a copy of setjmp.h in my src folder with #include "setjmp.h" im my source file header instead... as well as taking a copy of setjmp.h from eigenmath project by gbl08ma but nothing fixes this...

Google seems to give results referring 64bit version problems - is it possible that I need different versions of libc.a etc files for SDK on 64-bit Windows machines? Could someone kindly help with this please
It looks like it is missing the actual library definition, not the prototype for the function in the header. You probably just need to fix your version of libc. Smile
Thanks Mateo, this makes sense especially in combination with string commands i had similar problems with.

I will ask Tari to kindly come to my rescue again. I apologise in advance for my inability to fix it myself - I'm willing to learn how to though

Thanks to everyone for kind support here
Should be in a newer copy of libc.a than you have.

http://jenkins.taricorp.net/job/libfxcg/lastSuccessful/archive/lib/
For what it's worth, I implemented setjmp/longjmp for LuaZM, so if that's helpful, feel free to use it. I suspect that's what's in Tari's latest libc.a link anyway.
Tari wrote:
Should be in a newer copy of libc.a than you have.

http://jenkins.taricorp.net/job/libfxcg/lastSuccessful/archive/lib/

Thanks, Tari, I have just tried it and it gives me the same error and also judging by the date of the files there (2015-Mar-07) it looks to be the same version I have been using for a while now so I suspect the fix escaped that version - let me know please if I am mistaken or if somehow my browser fails to see more up to date files and shows some cached files. Looking forward to your kind help on this. Kind regards

PS:
KermMartian wrote:
For what it's worth, I implemented setjmp/longjmp for LuaZM, so if that's helpful, feel free to use it. I suspect that's what's in Tari's latest libc.a link anyway.
Thanks for this, Kerm. Shall I worry about what gbl08ma wrote later in there - it seems to indicate some setjmp problems he managed to overcome somehow - a bit above my level of knowledge of compiling and such. :( Plus I'm on Windows...
Untested but should work:

1. Download https://msys2.github.io/
2. Run the mingw batch file found in X:\msys2 where X is a drive letter (which one you choose depends on if your CPU is 32 bit or 64 bit)
4. Install git using pacman -S git
5. Install mingw toolchain. Don't install msys-gcc. Use pacman -Ss to decide which package you should install.
6. Do the same for autotools and make. Start with pacman -Ss to find the package you need.
7. Download the latest version of binutils and gcc and compile that. You can use the following script but modify the paths for windows

Code:

#!/bin/bash
set -e
set -o pipefail
TMPDIR=/tmp
tar -xf binutils* -C $TMPDIR
tar -xf gcc* -C $TMPDIR
cd $TMPDIR
export PREFIX=$HOME/casio-gcc
export PATH=$PATH:$PREFIX/bin
export TARGET=sh3eb-elf
export CFLAGS="-O2 -pipe -s -fomit-frame-pointer -ffunction-sections -fdata-sections"
export CXXFLAGS=$CFLAGS && export LDFLAGS="-Wl,--gc-sections"
mkdir -p build-binutils
cd build-binutils
../binutils-2.*/configure --disable-werror --target=$TARGET --prefix=$PREFIX --disable-nls --disable-tls --disable-libssp --enable-plugin --enable-plugins --enable-gold=yes
make
make install
cd ..
mkdir -p build-gcc
cd build-gcc
../gcc-5.*/configure --target=$TARGET --prefix=$PREFIX  --without-headers --enable-plugin --enable-plugins --enable-gold=yes --enable-sjlj-exceptions --disable-hosted-libstdcxx --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --disable-tls --disable-libssp --disable-threads --disable-shared --disable-__cxa_atexit --disable-libvtv --disable-libada --with-endian=big
make all-gcc
make install-gcc
make all-target-libgcc
make install-target-libgcc

Edit: Cleaned up the script.
Save that as name.sh and run chmod +x name.sh and then ./name.sh but modify the file before running it.
8. run git clone https://github.com/Jonimoose/libfxcg --depth 1
9. run cd libfxcg
10. run mingw32-make
11. Enjoy your fresh windows toolchain using a later version of libraries. You can try one of my forks of libfxcg if you are still having issues.
Thank you very much - i will test this
amazonka wrote:
PS:
KermMartian wrote:
For what it's worth, I implemented setjmp/longjmp for LuaZM, so if that's helpful, feel free to use it. I suspect that's what's in Tari's latest libc.a link anyway.
Thanks for this, Kerm. Shall I worry about what gbl08ma wrote later in there - it seems to indicate some setjmp problems he managed to overcome somehow - a bit above my level of knowledge of compiling and such. Sad Plus I'm on Windows...
From reading his post, it looks to me like he never got to try my code. I used Windows to make all of my Prizm programs (including LuaZM), and had no problems. Smile
The setjmp used in my add-ins is the one in my libfxcg fork, which in turn has not been changed from upstream:

https://github.com/gbl08ma/libfxcg/blob/master/libc/setjmp.S

Judging by the commit message, it is KermM's implementation. I have not found any problems with it.
amazonka wrote:
Thank you very much - i will test this

I started going through the steps by Programmer Nerd - thank you very much.

So far I have installed the following (hoping it covers steps 4 to 6 - pacman -Ss gave long list so picked everything what looked relevant):

Code:
$ pacman -S git
$ pacman -Ss
$ pacman -S mingw32/mingw-w64-i686-gcc-libs
$ pacman -S mingw64/mingw-w64-x86_64-binutils
$ pacman -S mingw64/mingw-w64-x86_64-gcc
$ pacman -S mingw64/mingw-w64-x86_64-gcc-libs
$ pacman -S mingw64/mingw-w64-x86_64-gcc-objc
$ pacman -S mingw64/mingw-w64-x86_64-gdb
$ pacman -S mingw64/mingw-w64-x86_64-headers-git
$ pacman -S mingw64/mingw-w64-x86_64-libmangle-git
$ pacman -S mingw64/mingw-w64-x86_64-libwinpthread-git
$ pacman -S mingw64/mingw-w64-x86_64-make
$ pacman -S mingw64/mingw-w64-x86_64-pkg-config
$ pacman -S mingw64/mingw-w64-x86_64-tools-git
$ pacman -S mingw64/mingw-w64-x86_64-winpthreads-git
$ pacman -S msys/util-macros
$ pacman -S mingw64/mingw-w64-x86_64-cmake
$ pacman -S mingw64/mingw-w64-x86_64-dmake
$ pacman -S mingw64/mingw-w64-x86_64-extra-cmake-modules
$ pacman -S msys/automake1.9
$ pacman -S msys/automake-wrapper
$ pacman -S msys/cmake
$ pacman -S msys/make
$ pacman -S msys/make-git

... so posting it here for now in case someone else finds it useful but also in case I missed something etc - hopefully I will succeed with this all but must admit it feels quite new and difficult for a Windows user like me :o

Also judging from the script I obtained the following tar.gz:

Code:

https://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
https://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.gz

I then used 7zip to extract the tars into my C:\TEMP folder

I will start looking at how to modify the script when I get more free time.

Thanks again for all the help here
Hi Again,

I am trying to deal with step 7 script part now. As I added to the previous post already I put binutils-2.26.tar and gcc-5.3.0.tar into my C:\temp folder
and now also another copy into C:\cygwin64\tmp folder just because I hoped /tmp at the top of Programmer Nerd's may mean this.

Anyhow I first saved unmodified script as as name.sh in C:\cygwin64\ but running
chmod +x name.sh was giving the following error:

Code:
chmod: cannot access ‘name.sh’: No such file or directory

but if I run

Code:
$ chmod +x /c/cygwin64/name.sh

no error is produce but nothing happens after even after modifying the script at the top to

Code:
 
#!/bin/bash
TMPDIR=/c/temp


so I am lost now again and not getting less confused after googling it - could you kindly help me with this again please. Many thanks in advance
Amazonka,

Why are you using Cygwin64? I though that you installed msys2. As for the packages you installed those should work just fine. You got pacman working just fine. Run the same batch script that allowed you to run pacman instead of using Cygwin.

Also yes you will need to change where the temporary directory is. Make sure the folder exists before running the script.
Thanks Programmer Nerd, I must have had the other folder from before and confused them half way possibly because of trying some solutions from Google or something after getting those
Code:
$ chmod +x name.sh
chmod: cannot access ‘name.sh’: No such file or directory


So I rechecked this now and put the following script in C:\msys64 :

Code:
 
#!/bin/bash
TMPDIR=/c/temp
tar -xf binutils* -C $TMPDIR
tar -xf gcc* -C $TMPDIR
cd $TMPDIR
export PREFIX=$HOME/casio-gcc && export PATH=$PATH:$PREFIX/bin && export TARGET=sh3eb-elf && export CFLAGS="-O2 -pipe -s -fomit-frame-pointer -ffunction-sections -fdata-sections" && export CXXFLAGS=$CFLAGS && export LDFLAGS="-Wl,--gc-sections" && mkdir build-binutils && cd build-binutils && ../binutils-2.*/configure --disable-werror --target=$TARGET --prefix=$PREFIX --disable-nls --disable-tls --disable-libssp --enable-plugin --enable-plugins --enable-gold=yes && make && make install && cd .. && mkdir build-gcc && cd build-gcc && ../gcc-5.*/configure --target=$TARGET --prefix=$PREFIX  --without-headers --enable-plugin --enable-plugins --enable-gold=yes --enable-sjlj-exceptions --disable-hosted-libstdcxx --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --disable-tls --disable-libssp --disable-threads --disable-shared --disable-__cxa_atexit --disable-libvtv --disable-libada --with-endian=big && make all-gcc && make install-gcc && make all-target-libgcc && make install-target-libgcc


So the only changed line was TMPDIR=/c/temp

but still have problems running it with the following error:

Code:
$ chmod +x name.sh
chmod: cannot access ‘name.sh’: No such file or directory

changing to this

Code:
$ chmod +x /c/msys64/name.sh
gives no error but still produces nothing... Sad

Thank you so much for looking at it and helping. Kind regards
The reason you are having an issue is because you put the files in the wrong directory.
You need to put the gcc and binutils archives along with the scripts the home directory.Look for a folder that is <whatever your current username is> and put all the files in there.
ProgrammerNerd wrote:
The reason you are having an issue is because you put the files in the wrong directory.
You need to put the gcc and binutils archives along with the scripts the home directory.Look for a folder that is <whatever your current username is> and put all the files in there.

Dear Programmer Nerd, I have tried again but am very sorry to say still did not manage to move it any further... Sad
here is what I have:
C:\msys64\home\Anna
folder with a few .bash etc file and I copied the previously modified name.sh and 2 tar files binutils-2.26 and gcc-5.3.0 here too.

One thing which stopped happening is the error about not finding the name.sh file but nothing else happens after this. Would you be so kind to help me a bit further - maybe you could try modifying or explaining how to modify the script or rename something given my folder structure is stated above. Many thanks again in advance
Ok I know what the issue is. On windows there is no executable bit. Instead run the script using the following command:

Code:

sh name.sh


Also just a note. The only reason I called the script name.sh is to signify that it does not matter what the file name is. Even the extension does not really matter but sh is standard.
Thank you so much for all your time and help on this - I now suspect tar etc commands also do not exist on Windows - I wanted to investigate it a bit more to try and understand this after this error
Code:
$ sh name.sh
name.sh: line 4: tar: command not found
name.sh: line 5: tar: command not found
name.sh: line 7: ../binutils-2.*/configure: No such file or directory

but decided to see if 7zip can extract the tar file and it did so I ended up with folders

Code:
C:\msys64\home\Anna\binutils-2.26
C:\msys64\home\Anna\gcc-5.3.0

and then even deleted tar files to save space. I gave

Code:
$ sh name.sh
a couple of more tries and received errors like

Code:
mkdir: cannot create directory ‘build-binutils’: File exists
and
Code:
name.sh: line 7: ../binutils-2.*/configure: No such file or directory
but commenting out all the top lines one by one with # eventually leaving only line starting at export command helped to move it along massively and got me to the following point:

Code:
$ sh name.sh
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking target system type... sh3eb-unknown-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... no, using cp -p
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2
checking for objdir... .libs
checking for compatible ISL... yes
checking for default BUILD_CONFIG...
checking for --enable-vtable-verify... no
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... no
/home/Anna/binutils-2.26/missing: line 81: makeinfo: command not found
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... dlltool
checking for ld... (cached) C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... windres
checking for windmc... windmc
checking for objcopy... objcopy
checking for objdump... objdump
checking for readelf... readelf
checking for sh3eb-elf-cc... no
checking for sh3eb-elf-gcc... no
checking for sh3eb-elf-c++... no
checking for sh3eb-elf-g++... no
checking for sh3eb-elf-cxx... no
checking for sh3eb-elf-gxx... no
checking for sh3eb-elf-gcc... no
checking for sh3eb-elf-gcj... no
checking for sh3eb-elf-gfortran... no
checking for sh3eb-elf-gccgo... no
checking for sh3eb-elf-ar... no
checking for sh3eb-elf-as... no
checking for sh3eb-elf-dlltool... no
checking for sh3eb-elf-ld... no
checking for sh3eb-elf-lipo... no
checking for sh3eb-elf-nm... no
checking for sh3eb-elf-objcopy... no
checking for sh3eb-elf-objdump... no
checking for sh3eb-elf-ranlib... no
checking for sh3eb-elf-readelf... no
checking for sh3eb-elf-strip... no
checking for sh3eb-elf-windres... no
checking for sh3eb-elf-windmc... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... just compiled
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target ld... just compiled
checking where to find the target lipo... pre-installed
checking where to find the target nm... just compiled
checking where to find the target objcopy... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target readelf... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking where to find the target windmc... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile
make[1]: Entering directory '/home/Anna/build-binutils'
mkdir -p -- ./libiberty
Configuring in ./libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... /home/Anna/binutils-2.26/missing makeinfo --split-size=5000000
configure: WARNING:
*** Makeinfo is missing. Info documentation will not be built.
checking for perl... perl
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for x86_64-pc-mingw64-ar... ar
checking for x86_64-pc-mingw64-ranlib... ranlib
checking whether to install libiberty headers and static library... no
configure: target_header_dir =
checking for x86_64-pc-mingw64-gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking whether gcc supports -W... yes
checking whether gcc supports -Wall... yes
checking whether gcc supports -Wwrite-strings... yes
checking whether gcc supports -Wc++-compat... yes
checking whether gcc supports -Wstrict-prototypes... yes
checking whether gcc supports -pedantic ... yes
checking whether gcc and cc understand -c and -o together... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for malloc.h... yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/time.h... yes
checking for time.h... yes
checking for sys/resource.h... no
checking for sys/stat.h... (cached) yes
checking for sys/mman.h... no
checking for fcntl.h... yes
checking for alloca.h... no
checking for sys/pstat.h... no
checking for sys/sysmp.h... no
checking for sys/sysinfo.h... no
checking for machine/hal_sysinfo.h... no
checking for sys/table.h... no
checking for sys/sysctl.h... no
checking for sys/systemcfg.h... no
checking for stdint.h... (cached) yes
checking for stdio_ext.h... no
checking for process.h... yes
checking for sys/prctl.h... no
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether time.h and sys/time.h may both be included... yes
checking whether errno must be declared... no
checking size of int... 4
checking size of long... 4
checking size of size_t... 8
checking for long long... yes
checking size of long long... 8
checking for a 64-bit type... uint64_t
checking for intptr_t... yes
checking for uintptr_t... yes
checking for ssize_t... yes
checking for pid_t... yes
checking for library containing strerror... none required
checking for asprintf... yes
checking for atexit... yes
checking for basename... yes
checking for bcmp... no
checking for bcopy... no
checking for bsearch... yes
checking for bzero... no
checking for calloc... yes
checking for clock... yes
checking for ffs... no
checking for getcwd... yes
checking for getpagesize... yes
checking for gettimeofday... yes
checking for index... no
checking for insque... no
checking for memchr... yes
checking for memcmp... yes
checking for memcpy... yes
checking for memmem... no
checking for memmove... yes
checking for mempcpy... yes
checking for memset... yes
checking for mkstemps... no
checking for putenv... yes
checking for random... no
checking for rename... yes
checking for rindex... no
checking for setenv... no
checking for snprintf... yes
checking for sigsetmask... no
checking for stpcpy... no
checking for stpncpy... no
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strncasecmp... yes
checking for strndup... no
checking for strnlen... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtod... yes
checking for strtol... yes
checking for strtoul... yes
checking for strtoll... yes
checking for strtoull... yes
checking for strverscmp... no
checking for tmpnam... yes
checking for vasprintf... yes
checking for vfprintf... yes
checking for vprintf... yes
checking for vsnprintf... yes
checking for vsprintf... yes
checking for waitpid... no
checking for setproctitle... no
checking whether alloca needs Cray hooks... no
checking stack direction for C alloca... -1
checking for vfork.h... no
checking for fork... no
checking for vfork... no
checking for _doprnt... no
checking for sys_errlist... no
checking for sys_nerr... no
checking for sys_siglist... no
checking for external symbol _system_configuration... no
checking for __fsetlocking... no
checking for canonicalize_file_name... no
checking for dup3... no
checking for getrlimit... no
checking for getrusage... no
checking for getsysinfo... no
checking for gettimeofday... (cached) yes
checking for on_exit... no
checking for psignal... no
checking for pstat_getdynamic... no
checking for pstat_getstatic... no
checking for realpath... no
checking for setrlimit... no
checking for sbrk... no
checking for spawnve... yes
checking for spawnvpe... yes
checking for strerror... yes
checking for strsignal... no
checking for sysconf... no
checking for sysctl... no
checking for sysmp... no
checking for table... no
checking for times... no
checking for wait3... no
checking for wait4... no
checking whether basename is declared... no
checking whether ffs is declared... no
checking whether asprintf is declared... yes
checking whether vasprintf is declared... yes
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking whether calloc is declared... yes
checking whether getenv is declared... yes
checking whether getopt is declared... yes
checking whether malloc is declared... yes
checking whether realloc is declared... yes
checking whether sbrk is declared... no
checking whether strtol is declared... yes
checking whether strtoul is declared... yes
checking whether strtoll is declared... yes
checking whether strtoull is declared... yes
checking whether strverscmp is declared... no
checking whether canonicalize_file_name must be declared... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... no
checking for working strncmp... yes
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
Makefile:7992: recipe for target 'configure-libiberty' failed
make[1]: *** [configure-libiberty] Error 1
Makefile:852: recipe for target 'all' failed
make: *** [all] Interrupt


So because of this

Code:
Makefile:7992: recipe for target 'configure-libiberty' failed
make[1]: *** [configure-libiberty] Error 1
Makefile:852: recipe for target 'all' failed
make: *** [all] Interrupt
I'm not sure if this step worked basically.

Git step works.

But the one after complains about prizm-gcc:

Code:
~/libfxcg
$ mingw32-make
make -C libfxcg
make[1]: Entering directory '/home/Anna/libfxcg/libfxcg'
prizm-gcc -c -ffunction-sections -fdata-sections -Os -Lr -I../include -mhitachi -m4a-nofpu -flto -std=c99 -Wall -Wextra syscalls/Bdisp_GetPoint_VRAM.S -o syscalls/Bdisp_GetPoint_VRAM.o
make[1]: prizm-gcc: Command not found
Makefile:21: recipe for target 'syscalls/Bdisp_GetPoint_VRAM.o' failed
make[1]: *** [syscalls/Bdisp_GetPoint_VRAM.o] Error 127
make[1]: Leaving directory '/home/Anna/libfxcg/libfxcg'
Makefile:2: recipe for target 'all' failed
mingw32-make: *** [all] Error 2


Many thanks for looking at this again and hope you can help me to fix it. Please let me know if I need to provide any more info. Kind regards
There will never be a prizm-gcc. You replace instances of prizm- with sh3eb-elf-. So prizm-gcc becomes sh3eb-elf-gcc.

Also you need to install tar before it works.


Code:

pacman -S tar


Also the reason mkdir fails is because the directory already exists. Change mkdir to mkdir -p to suppress the error.

First of all there are extra lines due to wordwrapping. I think this may be causing issues. Second of all do not just comment out lines without considering the side effects (you most likely commented out more than just directory creation).

I cleaned up the script and resolved the mkdir issues.

Code:

#!/bin/bash
set -e
set -o pipefail
TMPDIR=/tmp
tar -xf binutils* -C $TMPDIR
tar -xf gcc* -C $TMPDIR
cd $TMPDIR
export PREFIX=$HOME/casio-gcc
export PATH=$PATH:$PREFIX/bin
export TARGET=sh3eb-elf
export CFLAGS="-O2 -pipe -s -fomit-frame-pointer -ffunction-sections -fdata-sections"
export CXXFLAGS=$CFLAGS && export LDFLAGS="-Wl,--gc-sections"
mkdir -p build-binutils
cd build-binutils
../binutils-2.*/configure --disable-werror --target=$TARGET --prefix=$PREFIX --disable-nls --disable-tls --disable-libssp --enable-plugin --enable-plugins --enable-gold=yes
make
make install
cd ..
mkdir -p build-gcc
cd build-gcc
../gcc-5.*/configure --target=$TARGET --prefix=$PREFIX  --without-headers --enable-plugin --enable-plugins --enable-gold=yes --enable-sjlj-exceptions --disable-hosted-libstdcxx --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --disable-tls --disable-libssp --disable-threads --disable-shared --disable-__cxa_atexit --disable-libvtv --disable-libada --with-endian=big
make all-gcc
make install-gcc
make all-target-libgcc
make install-target-libgcc


README important: To prevent issues with Cemetech's word wrapping run the following command.


Code:

echo 'H4sIAK0S1VYCA51RTU/cMBC9769wacQBmESi6qWSDytYPiQQaFmpe1s59iQxOLYVO5D++zrJJpts
D4hebL83H5735vu3JJU6SZkrFg49AewvQ6y0mDGpFpvH5+v7NU18aReeVQSajISa2kvlzghckajP
GIM55zOei/GJjTWVJ8/r1c39lkZ3T4+rhDMnDYSiMbrc3NGoPX9FfWY74xDdLNe3qw11xQ9MAVU2
8Fc3D8vbF3oCT5cE2uEJOAKZKaWHrGIlgjVSewwzZlmtuZdGg8PubhMF82zEJ2PX7bbvG/X9yekp
2Ycerocff6sLCAIm1eWbkOEjS9JaKgGDXa0VR0wcJ8MbLuOzhBudybyuwvggpGOpQvjAqjKhHQSH
c/Q06j0IhK0wkw3d2zQp0cpNkJ8hJVPnbCBQd9iqOpf6GLsDkRsl6B90i5K9YXeQEPdMqVZQHB/L
bXc5Km1BEBku+Hmk7zM5gfmQvjC1hwKZwMr9x9AHxr2qV8CGo93vfHSkMM6j6IzxgjfN/mPIdQ3M
TZESh36K6bxmOTrKL/j5+VfdH8NFFcRNU1zBKhQTYrfjDdsxj43081bv/n1OMMGGeVELyTRNZd7v
LOyr28Z0gQeiBf1C2jb/5M1DfwEKVoZpNwQAAA==' | base64 -d | gunzip > compileSh3eb-elf.sh

And then run the script using the sh command. You can paste into the terminal by holding shift and pressing the insert key.
That helped a lot and I think I was able to follow your suggestion well Smile but got the following errors:

Code:
Makefile:443: recipe for target 'bfd.info' failed
make[3]: *** [bfd.info] Error 127
make[3]: Leaving directory '/tmp/build-binutils/bfd/doc'
Making info in po
make[3]: Entering directory '/tmp/build-binutils/bfd/po'
( if test 'x../../../binutils-2.26/bfd/po' != 'x.'; then \
    posrcprefix='../../../binutils-2.26/bfd/'; \
  else \
    posrcprefix="../"; \
  fi; \
  rm -f SRC-POTFILES-t SRC-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   $posrcprefix& \\\\@" < ../../../binutils-2.26/bfd/po/SRC-POTFILES.in \
        | sed -e '$s/\\$//') > SRC-POTFILES-t \
    && chmod a-w SRC-POTFILES-t \
    && mv SRC-POTFILES-t SRC-POTFILES )
( rm -f BLD-POTFILES-t BLD-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   ../& \\\\@" < ../../../binutils-2.26/bfd/po/BLD-POTFILES.in \
        | sed -e '$s/\\$//') > BLD-POTFILES-t \
    && chmod a-w BLD-POTFILES-t \
    && mv BLD-POTFILES-t BLD-POTFILES )
cd .. \
  && CONFIG_FILES=po/Makefile.in:po/Make-in \
     CONFIG_HEADERS= /bin/sh ./config.status
config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
./config.status: line 2654: cmp: command not found
config.status: executing default commands
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/tmp/build-binutils/bfd/po'
make[3]: Entering directory '/tmp/build-binutils/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/tmp/build-binutils/bfd'
Makefile:1673: recipe for target 'info-recursive' failed
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory '/tmp/build-binutils/bfd'
Makefile:2718: recipe for target 'all-bfd' failed
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory '/tmp/build-binutils'
Makefile:852: recipe for target 'all' failed
make: *** [all] Error 2
towards the end of the prompts after running the new script.

I tried to include the entire printout of them but the post seems to cut off at some point and even the end of my post was not showing. So I am retyping it for a third time now Sad

I thank you very much for all your help and teaching me all those new things and looking forward to getting this also fixed with your kind help please.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement