The dd-rescue build fails immediately, since 'gcc' doesn't exist on the target system. The best fix seems to be: --- Makefile +++ Makefile @@ -6,9 +6,6 @@ DESTDIR = -CC = gcc -RPM_OPT_FLAGS = -O2 -Wall -g -CFLAGS = $(RPM_OPT_FLAGS) $(EXTRA_CFLAGS) DEFINES = -DVERSION=\"$(VERSION)\" INSTALL = install INSTALLFLAGS = -s ... and additionally, IRIX doesn't seem to like the O_DIRECT code-path and posix_memalign() isn't very portable, so this helps: --- dd_rescue.c +++ dd_rescue.c @@ -55,6 +55,10 @@ #include <sys/time.h> #include <sys/stat.h> +#ifdef __sgi +#undef O_DIRECT +#endif + int softbs, hardbs, syncfreq; int maxerr, nrerr, reverse, dotrunc, abwrerr, sparse, nosparse; int verbose, quiet, interact, force; @@ -742,7 +746,12 @@ int main(int argc, char* argv[]) ipos = 0; #ifdef O_DIRECT - if (posix_memalign(mp, sysconf(_SC_PAGESIZE), softbs)) { +#ifdef linux +#define my_valloc(a, b, c) posix_memalign((a), (b), (c)) +#else +#define my_valloc(a, b, c) (*(a) = valloc((c))) +#endif + if (my_valloc(mp, sysconf(_SC_PAGESIZE), softbs)) { fplog(stderr, "dd_rescue: (fatal): allocation of aligned buffer failed!\n"); cleanup(); exit(18); } ... finally, for IRIX-specific problems, MIPSpro doesn't like certain pointer-addition, failing with "The expression must be a pointer to a complete object type.": --- dd_rescue.c +++ dd_rescue.c @@ -328,10 +328,11 @@ ssize_t readblock(const int toread) { - ssize_t err, rd = 0; + ssize_t err, tmp, rd = 0; //errno = 0; /* should not be necessary */ do { - rd += (err = mypread(ides, buf+rd, toread-rd, ipos+rd-reverse*toread)); + tmp = (ssize_t)buf+rd; + rd += (err = mypread(ides, (void *)tmp, toread-rd, ipos+rd-reverse*toread)); if (err == -1) rd++; } while ((err == -1 && (errno == EINTR || errno == EAGAIN)) @@ -342,10 +343,11 @@ ssize_t writeblock(const int towrite) { - ssize_t err, wr = 0; + ssize_t err, tmp, wr = 0; //errno = 0; /* should not be necessary */ do { - wr += (err = mypwrite(odes, buf+wr, towrite-wr, opos+wr-reverse*towrite)); + tmp = (ssize_t)buf+wr; + wr += (err = mypwrite(odes, (void *)tmp, towrite-wr, opos+wr-reverse*towrite)); if (err == -1) wr++; } while ((err == -1 && (errno == EINTR || errno == EAGAIN)) ... and lastly, IRIX lacks a strsignal function, so I used this (which may be inefficient or broken, but works for me): --- dd_rescue.c +++ dd_rescue.c @@ -661,6 +663,53 @@ */ } +char * strsignal(int sig) +{ + const char * const sys_siglist[] = { + "unknown signal" + , "Hangup" + , "Interrupt" + , "Quit" + , "Illegal Instruction" + , "Trace, Breakpoint, Range Error, Divide by Zero, or Overflow Trap" + , "Abort" + , "Emulation Trap" + , "Arithmetic Exception" + , "Killed" + , "Bus Error" + , "Segmentation Fault" + , "Bad System Call" + , "Broken Pipe" + , "Alarm Clock" + , "Terminated" + , "User Signal 1" + , "User Signal 2" + , "Child Status Changed" + , "Power Fail/Restart" + , "Window Size Change" + , "Urgent Socket Condition" + , "Pollable Event" + , "Stopped (signal)" + , "Stopped (user)" + , "Continued" + , "Stopped (tty input)" + , "Stopped (tty output)" + , "Virtual Timer Expired" + , "Profiling Timer Expired" + , "CPU time limit exceeded" + , "File size limit exceeded" + , "unknown signal" + , "Checkpoint warning" + , "Restart warning" + }; + + if (sig > 0 && sig < 65 && sys_siglist[sig] != NULL) { + return (char*)sys_siglist[sig]; + } else { + return "unknown signal"; + }; +} + void breakhandler(int sig) { fplog(stderr, "dd_rescue: (fatal): Caught signal %i \"%s\". Exiting!\n",
Stuart, Thanks for reporting. Can you please attach a physical patch then we can examine it and apply/commit. Thanks!
we can use CC=$(tc-getCC), would that work with the current IRIX setup?
It seems to be used extensively elsewhere - so I'd think so, yes.
Sorry for stumping in your backgarden guys; I'll fix the hardcoded gcc in 1.23, but I suppose it's still better to keep this around for the IRIX problems.
We are sorry to close this bug. We lack the man-power and devotion to support mips-irix in the tree.