diff --git a/dkarm-eabi/patches/gcc-4.1.1.patch b/dkarm-eabi/patches/gcc-4.1.1.patch deleted file mode 100644 index ee570b6..0000000 --- a/dkarm-eabi/patches/gcc-4.1.1.patch +++ /dev/null @@ -1,796 +0,0 @@ -diff -Nbaur gcc-4.1.1/gcc/c-incpath.c gcc-4.1.1-arm/gcc/c-incpath.c ---- gcc-4.1.1/gcc/c-incpath.c Sat Jun 25 03:02:01 2005 -+++ gcc-4.1.1-arm/gcc/c-incpath.c Mon Jun 5 06:58:56 2006 -@@ -331,13 +331,18 @@ - cpp_dir *p; - - #if defined (HAVE_DOS_BASED_FILE_SYSTEM) -- /* Convert all backslashes to slashes. The native CRT stat() -- function does not recognize a directory that ends in a backslash -- (unless it is a drive root dir, such "c:\"). Forward slashes, -- trailing or otherwise, cause no problems for stat(). */ -- char* c; -- for (c = path; *c; c++) -- if (*c == '\\') *c = '/'; -+ /* Remove unnecessary trailing slashes. On some versions of MS -+ Windows, trailing _forward_ slashes cause no problems for stat(). -+ On newer versions, stat() does not recognise a directory that ends -+ in a '\\' or '/', unless it is a drive root dir, such as "c:/", -+ where it is obligatory. */ -+ int pathlen = strlen (path); -+ char* end = path + pathlen - 1; -+ /* Preserve the lead '/' or lead "c:/". */ -+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); -+ -+ for (; end > start && IS_DIR_SEPARATOR (*end); end--) -+ *end = 0; - #endif - - p = xmalloc (sizeof (cpp_dir)); -diff -Nbaur gcc-4.1.1/gcc/gcc.c gcc-4.1.1-arm/gcc/gcc.c ---- gcc-4.1.1/gcc/gcc.c Wed May 17 19:38:58 2006 -+++ gcc-4.1.1-arm/gcc/gcc.c Mon Jun 5 06:58:56 2006 -@@ -3250,8 +3250,6 @@ - gcc_libexec_prefix = make_relative_prefix (argv[0], - standard_bindir_prefix, - standard_libexec_prefix); -- if (gcc_exec_prefix) -- putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); - } - else - gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix, -@@ -6148,10 +6146,21 @@ - - /* We need to check standard_exec_prefix/just_machine_suffix/specs - for any override of as, ld and libraries. */ -+ if ( gcc_exec_prefix ) -+ { -+ specs_file = alloca (strlen (gcc_exec_prefix) -+ + strlen (just_machine_suffix) + sizeof ("specs")); -+ -+ strcpy (specs_file, gcc_exec_prefix); -+ } else { -+ - specs_file = alloca (strlen (standard_exec_prefix) - + strlen (just_machine_suffix) + sizeof ("specs")); - - strcpy (specs_file, standard_exec_prefix); -+ -+ } -+ - strcat (specs_file, just_machine_suffix); - strcat (specs_file, "specs"); - if (access (specs_file, R_OK) == 0) -diff -Nbaur gcc-4.1.1/gcc/prefix.c gcc-4.1.1-arm/gcc/prefix.c ---- gcc-4.1.1/gcc/prefix.c Sat Jun 25 03:02:01 2005 -+++ gcc-4.1.1-arm/gcc/prefix.c Mon Jun 5 06:58:56 2006 -@@ -246,13 +246,16 @@ - The returned string is always malloc-ed, and the caller is - responsible for freeing it. */ - -+ -+static const char *old_prefix = PREFIX; -+ - char * - update_path (const char *path, const char *key) - { - char *result, *p; -- const int len = strlen (std_prefix); -+ const int len = strlen (old_prefix); - -- if (! strncmp (path, std_prefix, len) -+ if (! strncmp (path, old_prefix, len) - && (IS_DIR_SEPARATOR(path[len]) - || path[len] == '\0') - && key != 0) -@@ -354,4 +357,6 @@ - set_std_prefix (const char *prefix, int len) - { - std_prefix = save_string (prefix, len); -+ -+ putenv (concat ("GCC_EXEC_PREFIX=", std_prefix, NULL)); - } -diff -Nbaur gcc-4.1.1/gcc/toplev.c gcc-4.1.1-arm/gcc/toplev.c ---- gcc-4.1.1/gcc/toplev.c Sat Feb 4 22:13:20 2006 -+++ gcc-4.1.1-arm/gcc/toplev.c Mon Jun 5 06:58:56 2006 -@@ -82,6 +82,7 @@ - #include "value-prof.h" - #include "alloc-pool.h" - #include "tree-mudflap.h" -+#include "prefix.h" - - #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO) - #include "dwarf2out.h" -@@ -1434,6 +1435,10 @@ - progname = p; - - xmalloc_set_program_name (progname); -+ -+ p = getenv("GCC_EXEC_PREFIX"); -+ if (p && strlen(p)) set_std_prefix (p, strlen(p)); -+ - - hex_init (); - -diff -Nbaur gcc-4.1.1/gcc/version.c gcc-4.1.1-arm/gcc/version.c ---- gcc-4.1.1/gcc/version.c Wed Mar 16 06:04:10 2005 -+++ gcc-4.1.1-arm/gcc/version.c Wed Jun 7 16:14:31 2006 -@@ -8,7 +8,7 @@ - in parentheses. You may also wish to include a number indicating - the revision of your modified compiler. */ - --#define VERSUFFIX "" -+#define VERSUFFIX " (devkitARM release 20)" - - /* This is the location of the online document giving instructions for - reporting bugs. If you distribute a modified version of GCC, -@@ -17,7 +17,7 @@ - forward us bugs reported to you, if you determine that they are - not bugs in your modifications.) */ - --const char bug_report_url[] = ""; -+const char bug_report_url[] = ""; - - /* The complete version string, assembled from several pieces. - BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ -diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c ---- gcc-4.1.1/libiberty/pex-win32.c Thu Sep 15 01:46:20 2005 -+++ gcc-4.1.1-arm/libiberty/pex-win32.c Sun Jun 4 21:04:21 2006 -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - - /* mingw32 headers may not define the following. */ - -@@ -72,115 +73,6 @@ - return; - } - --/* This is a kludge to get around the Microsoft C spawn functions' propensity -- to remove the outermost set of double quotes from all arguments. */ -- --static const char * const * --fix_argv (char * const *argvec) --{ -- char **argv; -- int i; -- char *command0; -- -- /* See whether we need to change anything. */ -- for (command0 = argvec[0]; *command0 != '\0'; command0++) -- if (*command0 == '/') -- break; -- if (*command0 == '\0') -- { -- for (i = 1; argvec[i] != NULL; i++) -- if (strpbrk (argvec[i], "\" \t") != NULL) -- break; -- -- if (argvec[i] == NULL) -- return (const char * const *) argvec; -- } -- -- for (i = 0; argvec[i] != NULL; i++) -- ; -- argv = XNEWVEC (char *, i + 2); -- -- argv++; /* Leave space at the beginning of argv -- for potential #! handling */ -- -- for (i = 0; argvec[i] != NULL; i++) -- argv[i] = xstrdup (argvec[i]); -- argv[i] = NULL; -- -- backslashify (argv[0]); -- -- for (i = 1; argv[i] != 0; i++) -- { -- int len, j; -- char *temp, *newtemp; -- -- temp = argv[i]; -- len = strlen (temp); -- for (j = 0; j < len; j++) -- { -- if (temp[j] == '"') -- { -- newtemp = XNEWVEC (char, len + 2); -- strncpy (newtemp, temp, j); -- newtemp [j] = '\\'; -- strncpy (&newtemp [j+1], &temp [j], len-j); -- newtemp [len+1] = 0; -- temp = newtemp; -- len++; -- j++; -- } -- } -- -- if (argv[i] != temp) -- { -- free (argv[i]); -- argv[i] = temp; -- } -- } -- -- for (i = 0; argv[i] != 0; i++) -- { -- if (strpbrk (argv[i], " \t")) -- { -- int len, trailing_backslash; -- char *temp; -- -- len = strlen (argv[i]); -- trailing_backslash = 0; -- -- /* There is an added complication when an arg with embedded white -- space ends in a backslash (such as in the case of -iprefix arg -- passed to cpp). The resulting quoted strings gets misinterpreted -- by the command interpreter -- it thinks that the ending quote -- is escaped by the trailing backslash and things get confused. -- We handle this case by escaping the trailing backslash, provided -- it was not escaped in the first place. */ -- if (len > 1 -- && argv[i][len-1] == '\\' -- && argv[i][len-2] != '\\') -- { -- trailing_backslash = 1; -- ++len; /* to escape the final backslash. */ -- } -- -- len += 2; /* and for the enclosing quotes. */ -- -- temp = XNEWVEC (char, len + 1); -- temp[0] = '"'; -- strcpy (temp + 1, argv[i]); -- if (trailing_backslash) -- temp[len - 2] = '\\'; -- temp[len - 1] = '"'; -- temp[len] = '\0'; -- -- free (argv[i]); -- argv[i] = temp; -- } -- } -- -- return (const char * const *) argv; --} -- - static int pex_win32_open_read (struct pex_obj *, const char *, int); - static int pex_win32_open_write (struct pex_obj *, const char *, int); - static long pex_win32_exec_child (struct pex_obj *, int, const char *, -@@ -422,8 +314,225 @@ - } - #endif - -+/* Return a Windows command-line from ARGV. It is the caller's -+ responsibility to free the string returned. */ -+ -+static char * -+argv_to_cmdline (char *const *argv) -+{ -+ char *cmdline; -+ char *p; -+ size_t cmdline_len; -+ int i, j, k; -+ -+ cmdline_len = 0; -+ for (i = 0; argv[i]; i++) -+ { -+ /* We quote every last argument. This simplifies the problem; -+ we need only escape embedded double-quotes and immediately -+ preceeding backslash characters. A sequence of backslach characters -+ that is not follwed by a double quote character will not be -+ escaped. */ -+ for (j = 0; argv[i][j]; j++) -+ { -+ if (argv[i][j] == '"') -+ { -+ /* Escape preceeding backslashes. */ -+ for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--) -+ cmdline_len++; -+ /* Escape the qote character. */ -+ cmdline_len++; -+ } -+ } -+ /* Trailing backslashes also need to be escaped because they will be -+ followed by the terminating quote. */ -+ for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--) -+ cmdline_len++; -+ cmdline_len += j; -+ cmdline_len += 3; /* for leading and trailing quotes and space */ -+ } -+ cmdline = xmalloc (cmdline_len); -+ p = cmdline; -+ for (i = 0; argv[i]; i++) -+ { -+ *p++ = '"'; -+ for (j = 0; argv[i][j]; j++) -+ { -+ if (argv[i][j] == '"') -+ { -+ for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--) -+ *p++ = '\\'; -+ *p++ = '\\'; -+ } -+ *p++ = argv[i][j]; -+ } -+ for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--) -+ *p++ = '\\'; -+ *p++ = '"'; -+ *p++ = ' '; -+ } -+ p[-1] = '\0'; -+ return cmdline; -+} -+ -+static const char *const -+std_suffixes[] = { -+ ".com", -+ ".exe", -+ ".bat", -+ ".cmd", -+ 0 -+}; -+static const char *const -+no_suffixes[] = { -+ "", -+ 0 -+}; -+ -+/* Returns the full path to PROGRAM. If SEARCH is true, look for -+ PROGRAM in each directory in PATH. */ -+ -+static char * -+find_executable (const char *program, BOOL search) -+{ -+ char *full_executable; -+ char *e; -+ size_t fe_len; -+ const char *path = 0; -+ const char *const *ext; -+ const char *p, *q; -+ size_t proglen = strlen (program); -+ int has_extension = !!strchr (program, '.'); -+ int has_slash = (strchr (program, '/') || strchr (program, '\\')); -+ HANDLE h; -+ -+ if (has_slash) -+ search = FALSE; -+ -+ if (search) -+ path = getenv ("PATH"); -+ if (!path) -+ path = ""; -+ -+ fe_len = 0; -+ for (p = path; *p; p = q) -+ { -+ q = p; -+ while (*q != ';' && *q != '\0') -+ q++; -+ if ((size_t)(q - p) > fe_len) -+ fe_len = q - p; -+ if (*q == ';') -+ q++; -+ } -+ fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5); -+ full_executable = xmalloc (fe_len); -+ -+ p = path; -+ do -+ { -+ q = p; -+ while (*q != ';' && *q != '\0') -+ q++; -+ -+ e = full_executable; -+ memcpy (e, p, q - p); -+ e += (q - p); -+ if (q - p) -+ *e++ = '\\'; -+ strcpy (e, program); -+ -+ if (*q == ';') -+ q++; -+ -+ for (e = full_executable; *e; e++) -+ if (*e == '/') -+ *e = '\\'; -+ -+ /* At this point, e points to the terminating NUL character for -+ full_executable. */ -+ for (ext = has_extension ? no_suffixes : std_suffixes; *ext; ext++) -+ { -+ /* Remove any current extension. */ -+ *e = '\0'; -+ /* Add the new one. */ -+ strcat (full_executable, *ext); -+ -+ /* Attempt to open this file. */ -+ h = CreateFile (full_executable, GENERIC_READ, -+ FILE_SHARE_READ | FILE_SHARE_WRITE, -+ 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); -+ if (h != INVALID_HANDLE_VALUE) -+ goto found; -+ } -+ p = q; -+ } -+ while (*p); -+ free (full_executable); -+ return 0; -+ -+ found: -+ CloseHandle (h); -+ return full_executable; -+} -+ -+/* Low-level process creation function. */ -+ -+static long -+win32_spawn (const char *executable, -+ BOOL search, -+ char *const *argv, -+ DWORD dwCreationFlags, -+ LPSTARTUPINFO si, -+ LPPROCESS_INFORMATION pi) -+{ -+ char *full_executable; -+ char *cmdline; -+ -+ full_executable = NULL; -+ cmdline = NULL; -+ -+ full_executable = find_executable (executable, search); -+ if (!full_executable) -+ goto error; -+ cmdline = argv_to_cmdline (argv); -+ if (!cmdline) -+ goto error; -+ -+ /* Create the child process. */ -+ if (!CreateProcess (full_executable, cmdline, -+ /*lpProcessAttributes=*/NULL, -+ /*lpThreadAttributes=*/NULL, -+ /*bInheritHandles=*/TRUE, -+ dwCreationFlags, -+ /*lpEnvironment=*/NULL, -+ /*lpCurrentDirectory=*/NULL, -+ si, -+ pi)) -+ { -+ free (full_executable); -+ return -1; -+ } -+ -+ /* Clean up. */ -+ CloseHandle (pi->hThread); -+ free (full_executable); -+ -+ return (long) pi->hProcess; -+ -+ error: -+ if (cmdline) -+ free (cmdline); -+ if (full_executable) -+ free (full_executable); -+ return -1; -+} -+ - static long --spawn_script (const char *executable, const char * const * argv) -+spawn_script (const char *executable, char *const *argv, -+ DWORD dwCreationFlags, -+ LPSTARTUPINFO si, -+ LPPROCESS_INFORMATION pi) - { - int pid = -1; - int save_errno = errno; -@@ -455,17 +564,21 @@ - executable = strrchr (executable1, '\\') + 1; - if (!executable) - executable = executable1; -- pid = _spawnvp (_P_NOWAIT, executable, argv); -+ pid = win32_spawn (executable, TRUE, argv, -+ dwCreationFlags, si, pi); - #else - if (strchr (executable1, '\\') == NULL) -- pid = _spawnvp (_P_NOWAIT, executable1, argv); -+ pid = win32_spawn (executable1, TRUE, argv, -+ dwCreationFlags, si, pi); - else if (executable1[0] != '\\') -- pid = _spawnv (_P_NOWAIT, executable1, argv); -+ pid = win32_spawn (executable1, FALSE, argv, -+ dwCreationFlags, si, pi); - else - { - const char *newex = mingw_rootify (executable1); - *avhere = newex; -- pid = _spawnv (_P_NOWAIT, newex, argv); -+ pid = win32_spawn (newex, FALSE, argv, -+ dwCreationFlags, si, pi); - if (executable1 != newex) - free ((char *) newex); - if (pid < 0) -@@ -474,7 +587,8 @@ - if (newex != executable1) - { - *avhere = newex; -- pid = _spawnv (_P_NOWAIT, newex, argv); -+ pid = win32_spawn (newex, FALSE, argv, -+ dwCreationFlags, si, pi); - free ((char *) newex); - } - } -@@ -496,149 +610,95 @@ - int in, int out, int errdes, const char **errmsg, - int *err) - { -- int org_in, org_out, org_errdes; - long pid; -- const char * const * newargv; -- -- org_in = -1; -- org_out = -1; -- org_errdes = -1; -- -- if (in != STDIN_FILE_NO) -- { -- org_in = _dup (STDIN_FILE_NO); -- if (org_in < 0) -- { -- *err = errno; -- *errmsg = "_dup"; -- return -1; -- } -- if (_dup2 (in, STDIN_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (_close (in) < 0) -- { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -- } -+ HANDLE stdin_handle; -+ HANDLE stdout_handle; -+ HANDLE stderr_handle; -+ DWORD dwCreationFlags; -+ OSVERSIONINFO version_info; -+ STARTUPINFO si; -+ PROCESS_INFORMATION pi; -+ -+ stdin_handle = INVALID_HANDLE_VALUE; -+ stdout_handle = INVALID_HANDLE_VALUE; -+ stderr_handle = INVALID_HANDLE_VALUE; -+ -+ stdin_handle = (HANDLE) _get_osfhandle (in); -+ stdout_handle = (HANDLE) _get_osfhandle (out); -+ if (!(flags & PEX_STDERR_TO_STDOUT)) -+ stderr_handle = (HANDLE) _get_osfhandle (errdes); -+ else -+ stderr_handle = stdout_handle; - -- if (out != STDOUT_FILE_NO) -- { -- org_out = _dup (STDOUT_FILE_NO); -- if (org_out < 0) -- { -- *err = errno; -- *errmsg = "_dup"; -- return -1; -- } -- if (_dup2 (out, STDOUT_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (_close (out) < 0) -+ /* Determine the version of Windows we are running on. */ -+ version_info.dwOSVersionInfoSize = sizeof (version_info); -+ GetVersionEx (&version_info); -+ if (version_info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) -+ /* On Windows 95/98/ME the CREATE_NO_WINDOW flag is not -+ supported, so we cannot avoid creating a console window. */ -+ dwCreationFlags = 0; -+ else - { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -- } -+ HANDLE conout_handle; - -- if (errdes != STDERR_FILE_NO -- || (flags & PEX_STDERR_TO_STDOUT) != 0) -- { -- org_errdes = _dup (STDERR_FILE_NO); -- if (org_errdes < 0) -- { -- *err = errno; -- *errmsg = "_dup"; -- return -1; -- } -- if (_dup2 ((flags & PEX_STDERR_TO_STDOUT) != 0 ? STDOUT_FILE_NO : errdes, -- STDERR_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (errdes != STDERR_FILE_NO) -- { -- if (_close (errdes) < 0) -+ /* Determine whether or not we have an associated console. */ -+ conout_handle = CreateFile("CONOUT$", -+ GENERIC_WRITE, -+ FILE_SHARE_WRITE, -+ /*lpSecurityAttributes=*/NULL, -+ OPEN_EXISTING, -+ FILE_ATTRIBUTE_NORMAL, -+ /*hTemplateFile=*/NULL); -+ if (conout_handle == INVALID_HANDLE_VALUE) -+ /* There is no console associated with this process. Since -+ the child is a console process, the OS would normally -+ create a new console Window for the child. Since we'll be -+ redirecting the child's standard streams, we do not need -+ the console window. */ -+ dwCreationFlags = CREATE_NO_WINDOW; -+ else - { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -+ /* There is a console associated with the process, so the OS -+ will not create a new console. And, if we use -+ CREATE_NO_WINDOW in this situation, the child will have -+ no associated console. Therefore, if the child's -+ standard streams are connected to the console, the output -+ will be discarded. */ -+ CloseHandle(conout_handle); -+ dwCreationFlags = 0; - } - } - -- newargv = fix_argv (argv); -- pid = (((flags & PEX_SEARCH) != 0 ? _spawnvp : _spawnv) -- (_P_NOWAIT, executable, newargv)); -- -+ /* Since the child will be a console process, it will, by default, -+ connect standard input/output to its console. However, we want -+ the child to use the handles specifically designated above. In -+ addition, if there is no console (such as when we are running in -+ a Cygwin X window), then we must redirect the child's -+ input/output, as there is no console for the child to use. */ -+ memset (&si, 0, sizeof (si)); -+ si.cb = sizeof (si); -+ si.dwFlags = STARTF_USESTDHANDLES; -+ si.hStdInput = stdin_handle; -+ si.hStdOutput = stdout_handle; -+ si.hStdError = stderr_handle; -+ -+ /* Create the child process. */ -+ pid = win32_spawn (executable, (flags & PEX_SEARCH) != 0, -+ argv, dwCreationFlags, &si, &pi); - if (pid == -1) -- pid = spawn_script (executable, newargv); -- -+ pid = spawn_script (executable, argv, dwCreationFlags, &si, &pi); - if (pid == -1) - { -- *err = errno; -- *errmsg = ((flags & PEX_SEARCH) != 0) ? "_spawnvp" : "_spawnv"; -- } -- -- if (in != STDIN_FILE_NO) -- { -- if (_dup2 (org_in, STDIN_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (_close (org_in) < 0) -- { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -- } -- -- if (out != STDOUT_FILE_NO) -- { -- if (_dup2 (org_out, STDOUT_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (_close (org_out) < 0) -- { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -+ *err = ENOENT; -+ *errmsg = "CreateProcess"; - } - -- if (errdes != STDERR_FILE_NO -- || (flags & PEX_STDERR_TO_STDOUT) != 0) -- { -- if (_dup2 (org_errdes, STDERR_FILE_NO) < 0) -- { -- *err = errno; -- *errmsg = "_dup2"; -- return -1; -- } -- if (_close (org_errdes) < 0) -- { -- *err = errno; -- *errmsg = "_close"; -- return -1; -- } -- } -+ /* Close the standard output and standard error handles in the -+ parent. */ -+ if (out != STDOUT_FILENO) -+ obj->funcs->close (obj, out); -+ if (errdes != STDERR_FILENO) -+ obj->funcs->close (obj, errdes); - - return pid; - } -@@ -656,30 +716,34 @@ - int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED, - const char **errmsg, int *err) - { -- int termstat; -+ DWORD termstat; -+ HANDLE h; - - if (time != NULL) - memset (time, 0, sizeof *time); - -+ h = (HANDLE) pid; -+ - /* FIXME: If done is non-zero, we should probably try to kill the - process. */ -- -- if (_cwait (&termstat, pid, WAIT_CHILD) < 0) -+ if (WaitForSingleObject (h, INFINITE) != WAIT_OBJECT_0) - { -- *err = errno; -- *errmsg = "_cwait"; -+ CloseHandle (h); -+ *err = ECHILD; -+ *errmsg = "WaitForSingleObject"; - return -1; - } - -- /* cwait returns the child process exit code in termstat. A value -- of 3 indicates that the child caught a signal, but not which one. -- Since only SIGABRT, SIGFPE and SIGINT do anything, we report -- SIGABRT. */ -+ GetExitCodeProcess (h, &termstat); -+ CloseHandle (h); - -+ /* A value of 3 indicates that the child caught a signal, but not -+ which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we -+ report SIGABRT. */ - if (termstat == 3) - *status = SIGABRT; - else -- *status = ((termstat & 0xff) << 8); -+ *status = (termstat & 0xff) << 8; - - return 0; - } diff --git a/dkarm-eabi/patches/gdb-6.6.patch b/dkarm-eabi/patches/gdb-6.6.patch deleted file mode 100644 index aca936c..0000000 --- a/dkarm-eabi/patches/gdb-6.6.patch +++ /dev/null @@ -1,556 +0,0 @@ -diff -Nbaur gdb-6.6/configure gdb-6.6-mingw/configure ---- gdb-6.6/configure Tue Nov 14 23:26:39 2006 -+++ gdb-6.6-mingw/configure Tue Jun 12 18:33:14 2007 -@@ -3271,7 +3271,7 @@ - - # Host dirs don't like to share a cache file either, horribly enough. - # This seems to be due to autoconf 2.5x stupidity. --host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" -+host_configargs="${cache_file_option} --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" - - target_configargs=${baseargs} - -diff -Nbaur gdb-6.6/configure.in gdb-6.6-mingw/configure.in ---- gdb-6.6/configure.in Mon Dec 18 07:22:58 2006 -+++ gdb-6.6-mingw/configure.in Tue Jun 12 18:33:14 2007 -@@ -2024,7 +2024,7 @@ - - # Host dirs don't like to share a cache file either, horribly enough. - # This seems to be due to autoconf 2.5x stupidity. --host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" -+host_configargs="${cache_file_option} --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" - - target_configargs=${baseargs} - -diff -Nbaur gdb-6.6/gdb/Makefile.in gdb-6.6-mingw/gdb/Makefile.in ---- gdb-6.6/gdb/Makefile.in Fri Nov 24 19:54:14 2006 -+++ gdb-6.6-mingw/gdb/Makefile.in Tue Jun 12 18:33:14 2007 -@@ -2983,7 +2983,7 @@ - insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \ - $(CDEPS) $(TDEPLIBS) - rm -f insight$(EXEEXT) -- $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ -+ $(CC_LD) -mwindows $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ - -o insight$(EXEEXT) gdbtk-main.o libgdb.a \ - $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) - -diff -Nbaur gdb-6.6/gdb/config/i386/mingw.mh gdb-6.6-mingw/gdb/config/i386/mingw.mh ---- gdb-6.6/gdb/config/i386/mingw.mh Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-mingw/gdb/config/i386/mingw.mh Tue Jun 12 18:33:15 2007 -@@ -0,0 +1,5 @@ -+MH_CFLAGS=-D_POSIX_ -+XM_FILE=xm-mingw32.h -+NATDEPFILES= i386-nat.o win32-nat.o corelow.o -+NAT_FILE=nm-mingw32.h -+XM_CLIBS= -diff -Nbaur gdb-6.6/gdb/config/i386/mingw.mt gdb-6.6-mingw/gdb/config/i386/mingw.mt ---- gdb-6.6/gdb/config/i386/mingw.mt Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-mingw/gdb/config/i386/mingw.mt Tue Jun 12 18:33:15 2007 -@@ -0,0 +1,4 @@ -+# Target: Intel x86 running Win32 (MinGW) -+TDEPFILES= i386-tdep.o i386-win32-tdep.o i387-tdep.o -+DEPRECATED_TM_FILE= tm-mingw32.h -+GDBSERVER_DEPFILES= -diff -Nbaur gdb-6.6/gdb/config/i386/nm-mingw32.h gdb-6.6-mingw/gdb/config/i386/nm-mingw32.h ---- gdb-6.6/gdb/config/i386/nm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-mingw/gdb/config/i386/nm-mingw32.h Tue Jun 12 18:33:15 2007 -@@ -0,0 +1,38 @@ -+/* Native definitions for Intel x86 running MinGW. -+ Copyright (C) 2002 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+#define NO_PTRACE_H -+ -+#define I386_USE_GENERIC_WATCHPOINTS -+ -+#include "i386/nm-i386.h" -+ -+/* Support for hardware-assisted breakpoints and watchpoints. */ -+ -+#define I386_DR_LOW_SET_CONTROL(VAL) cygwin_set_dr7 (VAL) -+extern void cygwin_set_dr7 (unsigned); -+ -+#define I386_DR_LOW_SET_ADDR(N,ADDR) cygwin_set_dr (N,ADDR) -+extern void cygwin_set_dr (int, CORE_ADDR); -+ -+#define I386_DR_LOW_RESET_ADDR(N) -+ -+#define I386_DR_LOW_GET_STATUS() cygwin_get_dr6 () -+extern unsigned cygwin_get_dr6 (void); -diff -Nbaur gdb-6.6/gdb/config/i386/tm-mingw32.h gdb-6.6-mingw/gdb/config/i386/tm-mingw32.h ---- gdb-6.6/gdb/config/i386/tm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-mingw/gdb/config/i386/tm-mingw32.h Tue Jun 12 18:33:15 2007 -@@ -0,0 +1,21 @@ -+/* Macro definitions for i386 running under Win32. -+ Copyright 1999 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include "i386/tm-cygwin.h" -+ -diff -Nbaur gdb-6.6/gdb/config/i386/xm-mingw32.h gdb-6.6-mingw/gdb/config/i386/xm-mingw32.h ---- gdb-6.6/gdb/config/i386/xm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-mingw/gdb/config/i386/xm-mingw32.h Tue Jun 12 18:33:15 2007 -@@ -0,0 +1,25 @@ -+/* Definitions for hosting on WIN32, building with MinGW, for GDB. -+ Copyright 1999 Free Software Foundation, Inc. -+ -+This file is part of GDB. -+ -+This program is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2 of the License, or -+(at your option) any later version. -+ -+This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program; if not, write to the Free Software -+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include "fopen-bin.h" -+#define getkey getch -+#define DIRNAME_SEPARATOR ';' -+ -+/* Define this if source files use \r\n rather than just \n. */ -+#define CRLF_SOURCE_FILES -diff -Nbaur gdb-6.6/gdb/defs.h gdb-6.6-mingw/gdb/defs.h ---- gdb-6.6/gdb/defs.h Thu Sep 21 14:50:51 2006 -+++ gdb-6.6-mingw/gdb/defs.h Tue Jun 12 18:33:15 2007 -@@ -1167,7 +1167,7 @@ - /* FIXME, this doesn't work very well if host and executable - filesystems conventions are different. */ - --#ifdef __MSDOS__ -+#if defined(__MSDOS__) || (!defined (__CYGWIN__) && defined (_WIN32)) - # define CANT_FORK - # define GLOBAL_CURDIR - # define DIRNAME_SEPARATOR ';' -diff -Nbaur gdb-6.6/gdb/tui/tui-io.c gdb-6.6-mingw/gdb/tui/tui-io.c ---- gdb-6.6/gdb/tui/tui-io.c Fri Dec 23 19:10:02 2005 -+++ gdb-6.6-mingw/gdb/tui/tui-io.c Tue Jun 12 18:33:24 2007 -@@ -113,8 +113,11 @@ - - /* For gdb 5.3, prefer to continue the pipe hack as a backup wheel. */ - #define TUI_USE_PIPE_FOR_READLINE --/*#undef TUI_USE_PIPE_FOR_READLINE*/ - -+/* but remove for mingw host */ -+#ifdef __MINGW32__ -+#undef TUI_USE_PIPE_FOR_READLINE -+#endif - /* TUI output files. */ - static struct ui_file *tui_stdout; - static struct ui_file *tui_stderr; -diff -Nbaur gdb-6.6/gdb/win32-nat.c gdb-6.6-mingw/gdb/win32-nat.c ---- gdb-6.6/gdb/win32-nat.c Mon May 22 00:04:39 2006 -+++ gdb-6.6-mingw/gdb/win32-nat.c Tue Jun 12 18:33:24 2007 -@@ -43,7 +43,11 @@ - #include - #include - #include -+ -+#if defined (__CYGWIN__) - #include -+#endif /* __CYGWIN__ */ -+ - #include - - #include "buildsym.h" -@@ -81,7 +85,65 @@ - CONTEXT_DEBUGGER = (CONTEXT_FULL | CONTEXT_FLOATING_POINT) - }; - #endif --#include -+#ifndef __MINGW32__ -+ #include -+#else -+ #define NOTE_INFO_PROCESS 1 -+ #define NOTE_INFO_THREAD 2 -+ #define NOTE_INFO_MODULE 3 -+ -+ struct win32_core_process_info -+ { -+ DWORD pid; -+ int signal; -+ int command_line_size; -+ char command_line[1]; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_core_thread_info -+ { -+ DWORD tid; -+ BOOL is_active_thread; -+ CONTEXT thread_context; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_core_module_info -+ { -+ void* base_address; -+ int module_name_size; -+ char module_name[1]; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_pstatus -+ { -+ unsigned long data_type; -+ union -+ { -+ struct win32_core_process_info process_info; -+ struct win32_core_thread_info thread_info; -+ struct win32_core_module_info module_info; -+ } data ; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ typedef struct win32_pstatus win32_pstatus_t ; -+ -+#endif - #include - - #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \ -@@ -446,30 +508,23 @@ - static BOOL WINAPI (*psapi_GetModuleInformation) (HANDLE, HMODULE, LPMODULEINFO, DWORD) = NULL; - static DWORD WINAPI (*psapi_GetModuleFileNameExA) (HANDLE, HMODULE, LPSTR, DWORD) = NULL; - --static int --psapi_get_dll_name (DWORD BaseAddress, char *dll_name_ret) --{ -- DWORD len; -- MODULEINFO mi; -- int i; -- HMODULE dh_buf[1]; -- HMODULE *DllHandle = dh_buf; -- DWORD cbNeeded; -- BOOL ok; - -+BOOL -+load_psapi () -+{ - if (!psapi_loaded || - psapi_EnumProcessModules == NULL || - psapi_GetModuleInformation == NULL || - psapi_GetModuleFileNameExA == NULL) - { - if (psapi_loaded) -- goto failed; -+ return FALSE; - psapi_loaded = 1; - psapi_module_handle = LoadLibrary ("psapi.dll"); - if (!psapi_module_handle) - { - /* printf_unfiltered ("error loading psapi.dll: %u", GetLastError ()); */ -- goto failed; -+ return FALSE; - } - psapi_EnumProcessModules = GetProcAddress (psapi_module_handle, "EnumProcessModules"); - psapi_GetModuleInformation = GetProcAddress (psapi_module_handle, "GetModuleInformation"); -@@ -478,8 +533,24 @@ - if (psapi_EnumProcessModules == NULL || - psapi_GetModuleInformation == NULL || - psapi_GetModuleFileNameExA == NULL) -- goto failed; -+ return FALSE; - } -+ return TRUE; -+} -+ -+int -+psapi_get_dll_name (DWORD BaseAddress, char *dll_name_ret) -+{ -+ DWORD len; -+ MODULEINFO mi; -+ int i; -+ HMODULE dh_buf[1]; -+ HMODULE *DllHandle = dh_buf; -+ DWORD cbNeeded; -+ BOOL ok; -+ -+ if (!load_psapi ()) -+ goto failed; - - cbNeeded = 0; - ok = (*psapi_EnumProcessModules) (current_process_handle, -@@ -507,14 +578,14 @@ - DllHandle[i], - &mi, - sizeof (mi))) -- error (_("Can't get module info")); -+ error ("Can't get module info"); - - len = (*psapi_GetModuleFileNameExA) (current_process_handle, - DllHandle[i], - dll_name_ret, - MAX_PATH); - if (len == 0) -- error (_("Error getting dll name: %u."), (unsigned) GetLastError ()); -+ error ("Error getting dll name: %u\n", (unsigned) GetLastError ()); - - if ((DWORD) (mi.lpBaseOfDll) == BaseAddress) - return 1; -@@ -525,6 +596,30 @@ - return 0; - } - -+int -+psapi_get_module_filename (HANDLE hProcess, -+ HMODULE hModule, -+ LPTSTR lpFilename, -+ DWORD nSize) -+{ -+ DWORD len; -+ -+ if (!load_psapi ()) -+ goto failed; -+ -+ len = (*psapi_GetModuleFileNameExA) (hProcess, -+ hModule, -+ lpFilename, -+ nSize); -+ if (len == 0) -+ error ("Error getting file name: %u\n", (unsigned) GetLastError ()); -+ -+failed: -+ lpFilename[0] = '\0'; -+ return 0; -+} -+ -+ - /* Encapsulate the information required in a call to - symbol_file_add_args */ - struct safe_symbol_file_add_args -@@ -753,7 +848,13 @@ - so = XZALLOC (struct so_list); - so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info)); - so->lm_info->load_addr = load_addr; -+ -+#ifdef __CYGWIN__ - cygwin_conv_to_posix_path (buf, so->so_name); -+#else -+ strcpy( so->so_name, buf); -+#endif -+ - strcpy (so->so_original_name, so->so_name); - - solib_end->next = so; -@@ -1734,6 +1835,7 @@ - - if (!ok) - { -+#ifdef __CYGWIN__ - /* Try fall back to Cygwin pid */ - pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); - -@@ -1741,6 +1843,7 @@ - ok = DebugActiveProcess (pid); - - if (!ok) -+#endif /* __CYGWIN__ */ - error (_("Can't attach to process.")); - } - -@@ -1800,13 +1903,14 @@ - static char * - win32_pid_to_exec_file (int pid) - { -+ static char path[MAX_PATH + 1]; -+ char *path_ptr = NULL; -+#ifdef __CYGWIN__ - /* Try to find the process path using the Cygwin internal process list - pid isn't a valid pid, unfortunately. Use current_event.dwProcessId - instead. */ - /* TODO: Also find native Windows processes using CW_GETPINFO_FULL. */ - -- static char path[MAX_PATH + 1]; -- char *path_ptr = NULL; - int cpid; - struct external_pinfo *pinfo; - -@@ -1824,6 +1928,13 @@ - } - } - cygwin_internal (CW_UNLOCK_PINFO); -+#else -+ if (!psapi_get_module_filename (current_process_handle, NULL, path, MAX_PATH)) -+ printf_unfiltered ("error reading the process's file name: %lu", -+ GetLastError ()); -+ else -+ path_ptr = path; -+#endif - return path_ptr; - } - -@@ -1873,8 +1984,16 @@ - char *toexec; - char shell[MAX_PATH + 1]; /* Path to shell */ - const char *sh; -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ HANDLE hStdInput = 0; -+ HANDLE hStdOutput = 0; -+ HANDLE hStdError = 0; -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - int tty; - int ostdin, ostdout, ostderr; -+#endif /* !__MINGW32__ */ - const char *inferior_io_terminal = get_inferior_io_terminal (); - - if (!exec_file) -@@ -1886,7 +2005,12 @@ - if (!useshell) - { - flags = DEBUG_ONLY_THIS_PROCESS; -+#ifdef __CYGWIN__ - cygwin_conv_to_win32_path (exec_file, real_path); -+#else -+ strcpy (real_path, exec_file); -+#endif -+ - toexec = real_path; - } - else -@@ -1895,7 +2019,11 @@ - sh = getenv ("SHELL"); - if (!sh) - sh = "/bin/sh"; -+#ifdef __CYGWIN__ - cygwin_conv_to_win32_path (sh, shell); -+#else -+ strcpy (shell, sh); -+#endif - newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) - + strlen (allargs) + 2); - sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs); -@@ -1946,10 +2074,12 @@ - len = strlen (conv_path_names[j]); - if (strncmp (conv_path_names[j], in_env[i], len) == 0) - { -- if (cygwin_posix_path_list_p (in_env[i] + len)) -+#ifdef __CYGWIN__ -+ if (cygwin_posix_path_list_p (env[i] + len)) - envlen += len -- + cygwin_posix_to_win32_path_list_buf_size (in_env[i] + len); -+ + cygwin_posix_to_win32_path_list_buf_size (env[i] + len); - else -+#endif - envlen += strlen (in_env[i]) + 1; - break; - } -@@ -1976,12 +2106,14 @@ - len = strlen (conv_path_names[j]); - if (strncmp (conv_path_names[j], env[i], len) == 0) - { -+#ifdef __CYGWIN__ - if (cygwin_posix_path_list_p (env[i] + len)) - { - memcpy (temp, env[i], len); - cygwin_posix_to_win32_path_list (env[i] + len, temp + len); - } - else -+#endif - strcpy (temp, env[i]); - break; - } -@@ -1996,6 +2128,20 @@ - *temp = 0; - } - -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ if ( new_console) -+ { -+ hStdInput = GetStdHandle( STD_INPUT_HANDLE); -+ hStdOutput = GetStdHandle( STD_OUTPUT_HANDLE); -+ hStdError = GetStdHandle( STD_ERROR_HANDLE); -+ -+ SetStdHandle( STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); -+ SetStdHandle( STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE); -+ SetStdHandle( STD_ERROR_HANDLE, INVALID_HANDLE_VALUE); -+ } -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - if (!inferior_io_terminal) - tty = ostdin = ostdout = ostderr = -1; - else -@@ -2016,6 +2162,7 @@ - dup2 (tty, 2); - } - } -+#endif /* !__MINGW32__ */ - - win32_init_thread_list (); - ret = CreateProcess (0, -@@ -2028,6 +2175,16 @@ - NULL, /* current directory */ - &si, - &pi); -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ if ( new_console) -+ { -+ SetStdHandle( STD_INPUT_HANDLE, hStdInput); -+ SetStdHandle( STD_OUTPUT_HANDLE, hStdOutput); -+ SetStdHandle( STD_ERROR_HANDLE, hStdError); -+ } -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - if (tty >= 0) - { - close (tty); -@@ -2038,6 +2195,7 @@ - close (ostdout); - close (ostderr); - } -+#endif /* !__MINGW32__ */ - - if (!ret) - error (_("Error creating process %s, (error %d)."), diff --git a/dkarm-eabi/patches/newlib-1.14.0.patch b/dkarm-eabi/patches/newlib-1.14.0.patch deleted file mode 100644 index a32dcd9..0000000 --- a/dkarm-eabi/patches/newlib-1.14.0.patch +++ /dev/null @@ -1,2917 +0,0 @@ -diff -Nbaur newlib-1.14.0/libgloss/configure newlib-1.14.0-arm/libgloss/configure ---- newlib-1.14.0/libgloss/configure Mon Dec 12 11:25:07 2005 -+++ newlib-1.14.0-arm/libgloss/configure Thu Jul 20 02:41:18 2006 -@@ -711,9 +711,9 @@ - - - if test -z "${with_multisubdir}" ; then -- configdirs="doc libnosys" -+ configdirs="doc libnosys libsysbase" - else -- configdirs="libnosys" -+ configdirs="libnosys libsysbase" - fi - - case "${target}" in -diff -Nbaur newlib-1.14.0/libgloss/configure.in newlib-1.14.0-arm/libgloss/configure.in ---- newlib-1.14.0/libgloss/configure.in Mon Dec 12 11:25:07 2005 -+++ newlib-1.14.0-arm/libgloss/configure.in Thu Jul 20 02:41:18 2006 -@@ -22,9 +22,9 @@ - AC_CANONICAL_SYSTEM - - if test -z "${with_multisubdir}" ; then -- configdirs="doc libnosys" -+ configdirs="doc libnosys libsysbase" - else -- configdirs="libnosys" -+ configdirs="libnosys libsysbase" - fi - - case "${target}" in -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/Makefile.in newlib-1.14.0-arm/libgloss/libsysbase/Makefile.in ---- newlib-1.14.0/libgloss/libsysbase/Makefile.in Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/Makefile.in Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,145 @@ -+# Copyright (c) 1998 Cygnus Support -+# -+# The authors hereby grant permission to use, copy, modify, distribute, -+# and license this software and its documentation for any purpose, provided -+# that existing copyright notices are retained in all copies and that this -+# notice is included verbatim in any distributions. No written agreement, -+# license, or royalty fee is required for any of the authorized uses. -+# Modifications to this software may be copyrighted by their authors -+# and need not follow the licensing terms described here, provided that -+# the new terms are clearly indicated on the first page of each file where -+# they apply. -+ -+DESTDIR = -+VPATH = @srcdir@ -+srcdir = @srcdir@ -+objdir = . -+srcroot = $(srcdir)/../.. -+objroot = $(objdir)/../.. -+ -+prefix = @prefix@ -+exec_prefix = @exec_prefix@ -+ -+host_alias = @host_alias@ -+target_alias = @target_alias@ -+program_transform_name = @program_transform_name@ -+ -+bindir = @bindir@ -+libdir = @libdir@ -+tooldir = $(exec_prefix)/$(target_alias) -+ -+# Multilib support variables. -+# TOP is used instead of MULTI{BUILD,SRC}TOP. -+MULTIDIRS = -+MULTISUBDIR = -+MULTIDO = true -+MULTICLEAN = true -+ -+INSTALL = @INSTALL@ -+INSTALL_PROGRAM = @INSTALL_PROGRAM@ -+INSTALL_DATA = @INSTALL_DATA@ -+ -+SHELL = /bin/sh -+ -+CC = @CC@ -+ -+#AS = @AS@ -+AS = `if [ -f ${objroot}/../gas/as.new ] ; \ -+ then echo ${objroot}/../gas/as.new ; \ -+ else echo as ; fi` -+ -+AR = @AR@ -+ -+#LD = @LD@ -+LD = `if [ -f ${objroot}/../ld/ld.new ] ; \ -+ then echo ${objroot}/../ld/ld.new ; \ -+ else echo ld ; fi` -+ -+RANLIB = @RANLIB@ -+ -+OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ -+ then echo ${objroot}/../binutils/objdump ; \ -+ else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` -+OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ -+ then echo ${objroot}/../binutils/objcopy ; \ -+ else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` -+ -+# object files needed -+OBJS = abort.o iosupport.o close.o environ.o execve.o fork.o fstat.o getpid.o gettod.o \ -+ isatty.o kill.o link.o lseek.o open.o read.o sbrk.o stat.o \ -+ times.o unlink.o wait.o write.o _exit.o malloc_vars.o -+ -+# Object files specific to particular targets. -+EVALOBJS = ${OBJS} -+ -+GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \ -+ then echo -L${objroot}/../gcc ; fi` -+ -+OUTPUTS = libsysbase.a -+ -+NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi` -+NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi` -+ -+INCLUDES = -I. -I$(srcdir)/.. -+# Note that when building the library, ${MULTILIB} is not the way multilib -+# options are passed; they're passed in $(CFLAGS). -+CFLAGS_FOR_TARGET = ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS} -+LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS} -+AR_FLAGS = qc -+ -+.c.o: -+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< -+ -+.C.o: -+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< -+.s.o: -+ $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< -+ -+# -+# GCC knows to run the preprocessor on .S files before it assembles them. -+# -+.S.o: -+ $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< -+ -+# -+# this is a bogus target that'll produce an assembler from the -+# C source with the right compiler options. this is so we can -+# track down code generation or debug symbol bugs. -+# -+.c.s: -+ $(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $< -+ -+all: ${OUTPUTS} -+ -+# -+# here's where we build the library for each target -+# -+ -+libsysbase.a: $(EVALOBJS) -+ ${AR} ${ARFLAGS} $@ $(EVALOBJS) -+ ${RANLIB} $@ -+ -+doc: -+ -+clean mostlyclean: -+ rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x -+ -+distclean maintainer-clean realclean: clean -+ rm -f Makefile config.status $(OUTPUTS) -+ -+.PHONY: install info install-info clean-info -+install: -+ @for outputs in ${OUTPUTS}; do\ -+ mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ -+ $(INSTALL_PROGRAM) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ -+ done -+ -+info: -+install-info: -+clean-info: -+ -+Makefile: Makefile.in config.status @host_makefile_frag_path@ -+ $(SHELL) config.status -+ -+config.status: configure -+ $(SHELL) config.status --recheck -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/_exit.c newlib-1.14.0-arm/libgloss/libsysbase/_exit.c ---- newlib-1.14.0/libgloss/libsysbase/_exit.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/_exit.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,14 @@ -+/* Stub version of _exit. */ -+ -+#include -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+ -+_VOID -+_DEFUN (_exit, (rc), -+ int rc) -+{ -+ -+ while(1); -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/abort.c newlib-1.14.0-arm/libgloss/libsysbase/abort.c ---- newlib-1.14.0/libgloss/libsysbase/abort.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/abort.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,8 @@ -+#include -+#include -+ -+void abort(void) { -+ write (2, "Abort called.\n", sizeof("Abort called.\n")-1); -+ exit (1); -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/acconfig.h newlib-1.14.0-arm/libgloss/libsysbase/acconfig.h ---- newlib-1.14.0/libgloss/libsysbase/acconfig.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/acconfig.h Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,26 @@ -+/* Name of package. */ -+#undef PACKAGE -+ -+/* Version of package. */ -+#undef VERSION -+ -+/* Missing syscall names */ -+#undef MISSING_SYSCALL_NAMES -+ -+/* Using ELF format */ -+#undef HAVE_ELF -+ -+/* Using GNU LD */ -+#undef HAVE_GNU_LD -+ -+/* .previous directive allowed */ -+#undef HAVE_ASM_PREVIOUS_DIRECTIVE -+ -+/* .pushsection/.popsection directives allowed */ -+#undef HAVE_ASM_POPSECTION_DIRECTIVE -+ -+/* support for section attributes */ -+#undef HAVE_SECTION_ATTRIBUTES -+ -+/* symbol prefix */ -+#undef __SYMBOL_PREFIX -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/close.c newlib-1.14.0-arm/libgloss/libsysbase/close.c ---- newlib-1.14.0/libgloss/libsysbase/close.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/close.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,38 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+ -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN(_close_r,(ptr,fileDesc), -+ struct _reent *ptr _AND -+ int fileDesc) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN(_close,(fileDesc), -+ int fileDesc) { -+//--------------------------------------------------------------------------------- -+ struct _reent *ptr = _REENT; -+#endif -+ int ret = -1; -+ unsigned int dev = 0; -+ unsigned int fd = -1; -+ -+ if(fileDesc!=-1) { -+ -+ __handle *handle = fileDesc; -+ -+ dev = handle->device; -+ fd = handle->fileStruct; -+ -+ if(devoptab_list[dev]->close_r) -+ ret = devoptab_list[dev]->close_r(ptr,fd); -+ -+ free(fileDesc); -+ } -+ return ret; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/config.h.in newlib-1.14.0-arm/libgloss/libsysbase/config.h.in ---- newlib-1.14.0/libgloss/libsysbase/config.h.in Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/config.h.in Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,22 @@ -+/* config.h.in. Generated automatically from configure.in by autoheader. */ -+ -+/* Missing syscall names */ -+#undef MISSING_SYSCALL_NAMES -+ -+/* Using ELF format */ -+#undef HAVE_ELF -+ -+/* Using GNU LD */ -+#undef HAVE_GNU_LD -+ -+/* .previous directive allowed */ -+#undef HAVE_ASM_PREVIOUS_DIRECTIVE -+ -+/* .pushsection/.popsection directives allowed */ -+#undef HAVE_ASM_POPSECTION_DIRECTIVE -+ -+/* support for section attributes */ -+#undef HAVE_SECTION_ATTRIBUTES -+ -+/* symbol prefix */ -+#undef __SYMBOL_PREFIX -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/configure newlib-1.14.0-arm/libgloss/libsysbase/configure ---- newlib-1.14.0/libgloss/libsysbase/configure Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/configure Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,1461 @@ -+#! /bin/sh -+ -+# Guess values for system-dependent variables and create Makefiles. -+# Generated automatically using autoconf version 2.13 -+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -+# -+# This configure script is free software; the Free Software Foundation -+# gives unlimited permission to copy, distribute and modify it. -+ -+# Defaults: -+ac_help= -+ac_default_prefix=/usr/local -+# Any additions from configure.in: -+ -+# Initialize some variables set by options. -+# The variables have the same names as the options, with -+# dashes changed to underlines. -+build=NONE -+cache_file=./config.cache -+exec_prefix=NONE -+host=NONE -+no_create= -+nonopt=NONE -+no_recursion= -+prefix=NONE -+program_prefix=NONE -+program_suffix=NONE -+program_transform_name=s,x,x, -+silent= -+site= -+srcdir= -+target=NONE -+verbose= -+x_includes=NONE -+x_libraries=NONE -+bindir='${exec_prefix}/bin' -+sbindir='${exec_prefix}/sbin' -+libexecdir='${exec_prefix}/libexec' -+datadir='${prefix}/share' -+sysconfdir='${prefix}/etc' -+sharedstatedir='${prefix}/com' -+localstatedir='${prefix}/var' -+libdir='${exec_prefix}/lib' -+includedir='${prefix}/include' -+oldincludedir='/usr/include' -+infodir='${prefix}/info' -+mandir='${prefix}/man' -+ -+# Initialize some other variables. -+subdirs= -+MFLAGS= MAKEFLAGS= -+SHELL=${CONFIG_SHELL-/bin/sh} -+# Maximum number of lines to put in a shell here document. -+ac_max_here_lines=12 -+ -+ac_prev= -+for ac_option -+do -+ -+ # If the previous option needs an argument, assign it. -+ if test -n "$ac_prev"; then -+ eval "$ac_prev=\$ac_option" -+ ac_prev= -+ continue -+ fi -+ -+ case "$ac_option" in -+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; -+ *) ac_optarg= ;; -+ esac -+ -+ # Accept the important Cygnus configure options, so we can diagnose typos. -+ -+ case "$ac_option" in -+ -+ -bindir | --bindir | --bindi | --bind | --bin | --bi) -+ ac_prev=bindir ;; -+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) -+ bindir="$ac_optarg" ;; -+ -+ -build | --build | --buil | --bui | --bu) -+ ac_prev=build ;; -+ -build=* | --build=* | --buil=* | --bui=* | --bu=*) -+ build="$ac_optarg" ;; -+ -+ -cache-file | --cache-file | --cache-fil | --cache-fi \ -+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) -+ ac_prev=cache_file ;; -+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ -+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) -+ cache_file="$ac_optarg" ;; -+ -+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da) -+ ac_prev=datadir ;; -+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ -+ | --da=*) -+ datadir="$ac_optarg" ;; -+ -+ -disable-* | --disable-*) -+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then -+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } -+ fi -+ ac_feature=`echo $ac_feature| sed 's/-/_/g'` -+ eval "enable_${ac_feature}=no" ;; -+ -+ -enable-* | --enable-*) -+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then -+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } -+ fi -+ ac_feature=`echo $ac_feature| sed 's/-/_/g'` -+ case "$ac_option" in -+ *=*) ;; -+ *) ac_optarg=yes ;; -+ esac -+ eval "enable_${ac_feature}='$ac_optarg'" ;; -+ -+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ -+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ -+ | --exec | --exe | --ex) -+ ac_prev=exec_prefix ;; -+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ -+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ -+ | --exec=* | --exe=* | --ex=*) -+ exec_prefix="$ac_optarg" ;; -+ -+ -gas | --gas | --ga | --g) -+ # Obsolete; use --with-gas. -+ with_gas=yes ;; -+ -+ -help | --help | --hel | --he) -+ # Omit some internal or obsolete options to make the list less imposing. -+ # This message is too long to be a string in the A/UX 3.1 sh. -+ cat << EOF -+Usage: configure [options] [host] -+Options: [defaults in brackets after descriptions] -+Configuration: -+ --cache-file=FILE cache test results in FILE -+ --help print this message -+ --no-create do not create output files -+ --quiet, --silent do not print \`checking...' messages -+ --version print the version of autoconf that created configure -+Directory and file names: -+ --prefix=PREFIX install architecture-independent files in PREFIX -+ [$ac_default_prefix] -+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -+ [same as prefix] -+ --bindir=DIR user executables in DIR [EPREFIX/bin] -+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] -+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec] -+ --datadir=DIR read-only architecture-independent data in DIR -+ [PREFIX/share] -+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] -+ --sharedstatedir=DIR modifiable architecture-independent data in DIR -+ [PREFIX/com] -+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] -+ --libdir=DIR object code libraries in DIR [EPREFIX/lib] -+ --includedir=DIR C header files in DIR [PREFIX/include] -+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] -+ --infodir=DIR info documentation in DIR [PREFIX/info] -+ --mandir=DIR man documentation in DIR [PREFIX/man] -+ --srcdir=DIR find the sources in DIR [configure dir or ..] -+ --program-prefix=PREFIX prepend PREFIX to installed program names -+ --program-suffix=SUFFIX append SUFFIX to installed program names -+ --program-transform-name=PROGRAM -+ run sed PROGRAM on installed program names -+EOF -+ cat << EOF -+Host type: -+ --build=BUILD configure for building on BUILD [BUILD=HOST] -+ --host=HOST configure for HOST [guessed] -+ --target=TARGET configure for TARGET [TARGET=HOST] -+Features and packages: -+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -+ --x-includes=DIR X include files are in DIR -+ --x-libraries=DIR X library files are in DIR -+EOF -+ if test -n "$ac_help"; then -+ echo "--enable and --with options recognized:$ac_help" -+ fi -+ exit 0 ;; -+ -+ -host | --host | --hos | --ho) -+ ac_prev=host ;; -+ -host=* | --host=* | --hos=* | --ho=*) -+ host="$ac_optarg" ;; -+ -+ -includedir | --includedir | --includedi | --included | --include \ -+ | --includ | --inclu | --incl | --inc) -+ ac_prev=includedir ;; -+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ -+ | --includ=* | --inclu=* | --incl=* | --inc=*) -+ includedir="$ac_optarg" ;; -+ -+ -infodir | --infodir | --infodi | --infod | --info | --inf) -+ ac_prev=infodir ;; -+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) -+ infodir="$ac_optarg" ;; -+ -+ -libdir | --libdir | --libdi | --libd) -+ ac_prev=libdir ;; -+ -libdir=* | --libdir=* | --libdi=* | --libd=*) -+ libdir="$ac_optarg" ;; -+ -+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ -+ | --libexe | --libex | --libe) -+ ac_prev=libexecdir ;; -+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ -+ | --libexe=* | --libex=* | --libe=*) -+ libexecdir="$ac_optarg" ;; -+ -+ -localstatedir | --localstatedir | --localstatedi | --localstated \ -+ | --localstate | --localstat | --localsta | --localst \ -+ | --locals | --local | --loca | --loc | --lo) -+ ac_prev=localstatedir ;; -+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ -+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ -+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) -+ localstatedir="$ac_optarg" ;; -+ -+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) -+ ac_prev=mandir ;; -+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) -+ mandir="$ac_optarg" ;; -+ -+ -nfp | --nfp | --nf) -+ # Obsolete; use --without-fp. -+ with_fp=no ;; -+ -+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -+ | --no-cr | --no-c) -+ no_create=yes ;; -+ -+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) -+ no_recursion=yes ;; -+ -+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ -+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ -+ | --oldin | --oldi | --old | --ol | --o) -+ ac_prev=oldincludedir ;; -+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ -+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ -+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) -+ oldincludedir="$ac_optarg" ;; -+ -+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) -+ ac_prev=prefix ;; -+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) -+ prefix="$ac_optarg" ;; -+ -+ -program-prefix | --program-prefix | --program-prefi | --program-pref \ -+ | --program-pre | --program-pr | --program-p) -+ ac_prev=program_prefix ;; -+ -program-prefix=* | --program-prefix=* | --program-prefi=* \ -+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) -+ program_prefix="$ac_optarg" ;; -+ -+ -program-suffix | --program-suffix | --program-suffi | --program-suff \ -+ | --program-suf | --program-su | --program-s) -+ ac_prev=program_suffix ;; -+ -program-suffix=* | --program-suffix=* | --program-suffi=* \ -+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) -+ program_suffix="$ac_optarg" ;; -+ -+ -program-transform-name | --program-transform-name \ -+ | --program-transform-nam | --program-transform-na \ -+ | --program-transform-n | --program-transform- \ -+ | --program-transform | --program-transfor \ -+ | --program-transfo | --program-transf \ -+ | --program-trans | --program-tran \ -+ | --progr-tra | --program-tr | --program-t) -+ ac_prev=program_transform_name ;; -+ -program-transform-name=* | --program-transform-name=* \ -+ | --program-transform-nam=* | --program-transform-na=* \ -+ | --program-transform-n=* | --program-transform-=* \ -+ | --program-transform=* | --program-transfor=* \ -+ | --program-transfo=* | --program-transf=* \ -+ | --program-trans=* | --program-tran=* \ -+ | --progr-tra=* | --program-tr=* | --program-t=*) -+ program_transform_name="$ac_optarg" ;; -+ -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ silent=yes ;; -+ -+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -+ ac_prev=sbindir ;; -+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -+ | --sbi=* | --sb=*) -+ sbindir="$ac_optarg" ;; -+ -+ -sharedstatedir | --sharedstatedir | --sharedstatedi \ -+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ -+ | --sharedst | --shareds | --shared | --share | --shar \ -+ | --sha | --sh) -+ ac_prev=sharedstatedir ;; -+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ -+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ -+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ -+ | --sha=* | --sh=*) -+ sharedstatedir="$ac_optarg" ;; -+ -+ -site | --site | --sit) -+ ac_prev=site ;; -+ -site=* | --site=* | --sit=*) -+ site="$ac_optarg" ;; -+ -+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) -+ ac_prev=srcdir ;; -+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) -+ srcdir="$ac_optarg" ;; -+ -+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ -+ | --syscon | --sysco | --sysc | --sys | --sy) -+ ac_prev=sysconfdir ;; -+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ -+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) -+ sysconfdir="$ac_optarg" ;; -+ -+ -target | --target | --targe | --targ | --tar | --ta | --t) -+ ac_prev=target ;; -+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) -+ target="$ac_optarg" ;; -+ -+ -v | -verbose | --verbose | --verbos | --verbo | --verb) -+ verbose=yes ;; -+ -+ -version | --version | --versio | --versi | --vers) -+ echo "configure generated by autoconf version 2.13" -+ exit 0 ;; -+ -+ -with-* | --with-*) -+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then -+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } -+ fi -+ ac_package=`echo $ac_package| sed 's/-/_/g'` -+ case "$ac_option" in -+ *=*) ;; -+ *) ac_optarg=yes ;; -+ esac -+ eval "with_${ac_package}='$ac_optarg'" ;; -+ -+ -without-* | --without-*) -+ ac_package=`echo $ac_option|sed -e 's/-*without-//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then -+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } -+ fi -+ ac_package=`echo $ac_package| sed 's/-/_/g'` -+ eval "with_${ac_package}=no" ;; -+ -+ --x) -+ # Obsolete; use --with-x. -+ with_x=yes ;; -+ -+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ -+ | --x-incl | --x-inc | --x-in | --x-i) -+ ac_prev=x_includes ;; -+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ -+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) -+ x_includes="$ac_optarg" ;; -+ -+ -x-libraries | --x-libraries | --x-librarie | --x-librari \ -+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) -+ ac_prev=x_libraries ;; -+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ -+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) -+ x_libraries="$ac_optarg" ;; -+ -+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } -+ ;; -+ -+ *) -+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then -+ echo "configure: warning: $ac_option: invalid host type" 1>&2 -+ fi -+ if test "x$nonopt" != xNONE; then -+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } -+ fi -+ nonopt="$ac_option" -+ ;; -+ -+ esac -+done -+ -+if test -n "$ac_prev"; then -+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -+fi -+ -+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -+ -+# File descriptor usage: -+# 0 standard input -+# 1 file creation -+# 2 errors and warnings -+# 3 some systems may open it to /dev/tty -+# 4 used on the Kubota Titan -+# 6 checking for... messages and results -+# 5 compiler messages saved in config.log -+if test "$silent" = yes; then -+ exec 6>/dev/null -+else -+ exec 6>&1 -+fi -+exec 5>./config.log -+ -+echo "\ -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+" 1>&5 -+ -+# Strip out --no-create and --no-recursion so they do not pile up. -+# Also quote any args containing shell metacharacters. -+ac_configure_args= -+for ac_arg -+do -+ case "$ac_arg" in -+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -+ | --no-cr | --no-c) ;; -+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; -+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) -+ ac_configure_args="$ac_configure_args '$ac_arg'" ;; -+ *) ac_configure_args="$ac_configure_args $ac_arg" ;; -+ esac -+done -+ -+# NLS nuisances. -+# Only set these to C if already set. These must not be set unconditionally -+# because not all systems understand e.g. LANG=C (notably SCO). -+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -+# Non-C LC_CTYPE values break the ctype check. -+if test "${LANG+set}" = set; then LANG=C; export LANG; fi -+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -+ -+# confdefs.h avoids OS command line length limits that DEFS can exceed. -+rm -rf conftest* confdefs.h -+# AIX cpp loses on an empty file, so make sure it contains at least a newline. -+echo > confdefs.h -+ -+# A filename unique to this package, relative to the directory that -+# configure is in, which we can look for to find out if srcdir is correct. -+ac_unique_file=close.c -+ -+# Find the source files, if location was not specified. -+if test -z "$srcdir"; then -+ ac_srcdir_defaulted=yes -+ # Try the directory containing this script, then its parent. -+ ac_prog=$0 -+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` -+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. -+ srcdir=$ac_confdir -+ if test ! -r $srcdir/$ac_unique_file; then -+ srcdir=.. -+ fi -+else -+ ac_srcdir_defaulted=no -+fi -+if test ! -r $srcdir/$ac_unique_file; then -+ if test "$ac_srcdir_defaulted" = yes; then -+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } -+ else -+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } -+ fi -+fi -+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` -+ -+# Prefer explicitly selected file to automatically selected ones. -+if test -z "$CONFIG_SITE"; then -+ if test "x$prefix" != xNONE; then -+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" -+ else -+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -+ fi -+fi -+for ac_site_file in $CONFIG_SITE; do -+ if test -r "$ac_site_file"; then -+ echo "loading site script $ac_site_file" -+ . "$ac_site_file" -+ fi -+done -+ -+if test -r "$cache_file"; then -+ echo "loading cache $cache_file" -+ . $cache_file -+else -+ echo "creating cache $cache_file" -+ > $cache_file -+fi -+ -+ac_ext=c -+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -+cross_compiling=$ac_cv_prog_cc_cross -+ -+ac_exeext= -+ac_objext=o -+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then -+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. -+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then -+ ac_n= ac_c=' -+' ac_t=' ' -+ else -+ ac_n=-n ac_c= ac_t= -+ fi -+else -+ ac_n= ac_c='\c' ac_t= -+fi -+ -+ -+ -+ -+if test "${enable_shared}" = "yes" ; then -+ echo "Shared libraries not supported for cross compiling, ignored" -+fi -+ -+if test "$srcdir" = "." ; then -+ if test "${with_target_subdir}" != "." ; then -+ libgloss_topdir="${srcdir}/${with_multisrctop}../../.." -+ else -+ libgloss_topdir="${srcdir}/${with_multisrctop}../.." -+ fi -+else -+ libgloss_topdir="${srcdir}/../.." -+fi -+ac_aux_dir= -+for ac_dir in $libgloss_topdir $srcdir/$libgloss_topdir; do -+ if test -f $ac_dir/install-sh; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install-sh -c" -+ break -+ elif test -f $ac_dir/install.sh; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install.sh -c" -+ break -+ fi -+done -+if test -z "$ac_aux_dir"; then -+ { echo "configure: error: can not find install-sh or install.sh in $libgloss_topdir $srcdir/$libgloss_topdir" 1>&2; exit 1; } -+fi -+ac_config_guess=$ac_aux_dir/config.guess -+ac_config_sub=$ac_aux_dir/config.sub -+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -+ -+ -+ -+# Do some error checking and defaulting for the host and target type. -+# The inputs are: -+# configure --host=HOST --target=TARGET --build=BUILD NONOPT -+# -+# The rules are: -+# 1. You are not allowed to specify --host, --target, and nonopt at the -+# same time. -+# 2. Host defaults to nonopt. -+# 3. If nonopt is not specified, then host defaults to the current host, -+# as determined by config.guess. -+# 4. Target and build default to nonopt. -+# 5. If nonopt is not specified, then target and build default to host. -+ -+# The aliases save the names the user supplied, while $host etc. -+# will get canonicalized. -+case $host---$target---$nonopt in -+NONE---*---* | *---NONE---* | *---*---NONE) ;; -+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -+esac -+ -+ -+# Make sure we can run config.sub. -+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -+fi -+ -+echo $ac_n "checking host system type""... $ac_c" 1>&6 -+echo "configure:588: checking host system type" >&5 -+ -+host_alias=$host -+case "$host_alias" in -+NONE) -+ case $nonopt in -+ NONE) -+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : -+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } -+ fi ;; -+ *) host_alias=$nonopt ;; -+ esac ;; -+esac -+ -+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$host" 1>&6 -+ -+echo $ac_n "checking target system type""... $ac_c" 1>&6 -+echo "configure:609: checking target system type" >&5 -+ -+target_alias=$target -+case "$target_alias" in -+NONE) -+ case $nonopt in -+ NONE) target_alias=$host_alias ;; -+ *) target_alias=$nonopt ;; -+ esac ;; -+esac -+ -+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$target" 1>&6 -+ -+echo $ac_n "checking build system type""... $ac_c" 1>&6 -+echo "configure:627: checking build system type" >&5 -+ -+build_alias=$build -+case "$build_alias" in -+NONE) -+ case $nonopt in -+ NONE) build_alias=$host_alias ;; -+ *) build_alias=$nonopt ;; -+ esac ;; -+esac -+ -+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$build" 1>&6 -+ -+test "$host_alias" != "$target_alias" && -+ test "$program_prefix$program_suffix$program_transform_name" = \ -+ NONENONEs,x,x, && -+ program_prefix=${target_alias}- -+ -+if test "$program_transform_name" = s,x,x,; then -+ program_transform_name= -+else -+ # Double any \ or $. echo might interpret backslashes. -+ cat <<\EOF_SED > conftestsed -+s,\\,\\\\,g; s,\$,$$,g -+EOF_SED -+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`" -+ rm -f conftestsed -+fi -+test "$program_prefix" != NONE && -+ program_transform_name="s,^,${program_prefix},; $program_transform_name" -+# Use a double $ so make ignores it. -+test "$program_suffix" != NONE && -+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" -+ -+# sed with no file args requires a program. -+test "$program_transform_name" = "" && program_transform_name="s,x,x," -+ -+ -+# Find a good install program. We prefer a C program (faster), -+# so one script is as good as another. But avoid the broken or -+# incompatible versions: -+# SysV /etc/install, /usr/sbin/install -+# SunOS /usr/etc/install -+# IRIX /sbin/install -+# AIX /bin/install -+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -+# AFS /usr/afsws/bin/install, which mishandles nonexistent args -+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# ./install, which can be erroneously created by make from ./install.sh. -+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -+echo "configure:681: checking for a BSD compatible install" >&5 -+if test -z "$INSTALL"; then -+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" -+ for ac_dir in $PATH; do -+ # Account for people who put trailing slashes in PATH elements. -+ case "$ac_dir/" in -+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; -+ *) -+ # OSF1 and SCO ODT 3.0 have their own names for install. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ if test -f $ac_dir/$ac_prog; then -+ if test $ac_prog = install && -+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ else -+ ac_cv_path_install="$ac_dir/$ac_prog -c" -+ break 2 -+ fi -+ fi -+ done -+ ;; -+ esac -+ done -+ IFS="$ac_save_IFS" -+ -+fi -+ if test "${ac_cv_path_install+set}" = set; then -+ INSTALL="$ac_cv_path_install" -+ else -+ # As a last resort, use the slow shell script. We don't cache a -+ # path for INSTALL within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the path is relative. -+ INSTALL="$ac_install_sh" -+ fi -+fi -+echo "$ac_t""$INSTALL" 1>&6 -+ -+# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -+# It thinks the first close brace ends the variable substitution. -+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -+ -+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' -+ -+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -+ -+ -+# FIXME: We temporarily define our own version of AC_PROG_CC. This is -+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -+# are building a library that must be included in all links, so we -+# can't link an executable until this lib is built. -+# autoconf should provide a way to do this. -+ -+ -+ -+cat >> confdefs.h <<\EOF -+#define HAVE_GNU_LD 1 -+EOF -+ -+case "${target}" in -+ *-*-cygwin*) -+ ;; -+ a29k-amd-udi) -+ ;; -+ arc-*-*) -+ ;; -+ arm-*-pe) -+ ;; -+ arm-*-*) -+ ;; -+ strongarm-*-*) -+ ;; -+ d10v*) -+ ;; -+ h8300*-*-*) -+ ;; -+ h8500-*-*) -+ ;; -+ i345686-*-sco*) -+ ;; -+ m32r-*-*) -+ ;; -+ mn10?00-*-*) -+ ;; -+ powerpcle-*-pe) -+ ;; -+ sh*-*-*) -+ ;; -+ sparc-sun-sunos*) -+ ;; -+ sparc64-*-*) -+ ;; -+ thumb-*-pe) -+ ;; -+ thumb-*-*) -+ ;; -+ v850-*-*) -+ ;; -+ v850e-*-*) -+ ;; -+ v850ea-*-*) -+ ;; -+ w65-*-*) -+ ;; -+ xstormy16-*-*) -+ ;; -+ z8k-*-*) -+ ;; -+ *) -+ cat >> confdefs.h <<\EOF -+#define MISSING_SYSCALL_NAMES 1 -+EOF -+ -+ ;; -+esac -+ -+case "${target}" in -+ *-*-elf) -+ cat >> confdefs.h <<\EOF -+#define HAVE_ELF 1 -+EOF -+ -+ -+ echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6 -+echo "configure:811: checking for .previous assembler directive" >&5 -+if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.s <&5; (eval $ac_try) 2>&5; }; }; then -+ cat >> confdefs.h <<\EOF -+#define HAVE_ASM_PREVIOUS_DIRECTIVE 1 -+EOF -+ -+ fi -+ rm -f conftest* -+fi -+ -+echo "$ac_t""$libc_cv_asm_previous_directive" 1>&6 -+ -+ echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6 -+echo "configure:831: checking for .popsection assembler directive" >&5 -+if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.s <&5; (eval $ac_try) 2>&5; }; }; then -+ cat >> confdefs.h <<\EOF -+#define HAVE_ASM_POPSECTION_DIRECTIVE 1 -+EOF -+ -+ fi -+ rm -f conftest* -+fi -+ -+echo "$ac_t""$libc_cv_asm_popsection_directive" 1>&6 -+ -+ echo $ac_n "checking for section attributes""... $ac_c" 1>&6 -+echo "configure:851: checking for section attributes" >&5 -+if eval "test \"`echo '$''{'libc_cv_section_attributes'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then -+ cat >> confdefs.h <<\EOF -+#define HAVE_SECTION_ATTRIBUTES 1 -+EOF -+ -+ fi -+ rm -f conftest* -+fi -+ -+echo "$ac_t""$libc_cv_section_attributes" 1>&6 -+ ;; -+esac -+ -+echo $ac_n "checking for function prefix""... $ac_c" 1>&6 -+echo "configure:873: checking for function prefix" >&5 -+if eval "test \"`echo '$''{'libc_dollar_prefix'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.c <<\EOF -+foo () { } -+EOF -+if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null'; { (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; -+then -+ libc_dollar_prefix=yes -+else -+ libc_dollar_prefix=no -+fi -+rm -f conftest* -+fi -+ -+echo "$ac_t""$libc_dollar_prefix" 1>&6 -+if test $libc_dollar_prefix = yes ; then -+ cat >> confdefs.h <<\EOF -+#define __SYMBOL_PREFIX "$" -+EOF -+ -+else -+ cat >> confdefs.h <<\EOF -+#define __SYMBOL_PREFIX "" -+EOF -+ -+fi -+ -+# Extract the first word of "gcc", so it can be a program name with args. -+set dummy gcc; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:905: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_CC="gcc" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+fi -+fi -+CC="$ac_cv_prog_CC" -+if test -n "$CC"; then -+ echo "$ac_t""$CC" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+if test -z "$CC"; then -+ # Extract the first word of "cc", so it can be a program name with args. -+set dummy cc; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:935: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_prog_rejected=no -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then -+ ac_prog_rejected=yes -+ continue -+ fi -+ ac_cv_prog_CC="cc" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+if test $ac_prog_rejected = yes; then -+ # We found a bogon in the path, so make sure we never use it. -+ set dummy $ac_cv_prog_CC -+ shift -+ if test $# -gt 0; then -+ # We chose a different compiler from the bogus one. -+ # However, it has the same basename, so the bogon will be chosen -+ # first if we set CC to just the basename; use the full file name. -+ shift -+ set dummy "$ac_dir/$ac_word" "$@" -+ shift -+ ac_cv_prog_CC="$@" -+ fi -+fi -+fi -+fi -+CC="$ac_cv_prog_CC" -+if test -n "$CC"; then -+ echo "$ac_t""$CC" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -+fi -+ -+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -+echo "configure:984: checking whether we are using GNU C" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+ ac_cv_prog_gcc=yes -+else -+ ac_cv_prog_gcc=no -+fi -+fi -+ -+echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -+ -+if test $ac_cv_prog_gcc = yes; then -+ GCC=yes -+ ac_test_CFLAGS="${CFLAGS+set}" -+ ac_save_CFLAGS="$CFLAGS" -+ CFLAGS= -+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -+echo "configure:1008: checking whether ${CC-cc} accepts -g" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ echo 'void f(){}' > conftest.c -+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then -+ ac_cv_prog_cc_g=yes -+else -+ ac_cv_prog_cc_g=no -+fi -+rm -f conftest* -+ -+fi -+ -+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -+ if test "$ac_test_CFLAGS" = set; then -+ CFLAGS="$ac_save_CFLAGS" -+ elif test $ac_cv_prog_cc_g = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-O2" -+ fi -+else -+ GCC= -+ test "${CFLAGS+set}" = set || CFLAGS="-g" -+fi -+ -+AS=${AS-as} -+ -+AR=${AR-ar} -+ -+LD=${LD-ld} -+ -+# Extract the first word of "ranlib", so it can be a program name with args. -+set dummy ranlib; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1044: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_RANLIB="ranlib" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -+fi -+fi -+RANLIB="$ac_cv_prog_RANLIB" -+if test -n "$RANLIB"; then -+ echo "$ac_t""$RANLIB" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ -+host_makefile_frag=${srcdir}/../config/default.mh -+ -+host_makefile_frag_path=$host_makefile_frag -+ -+ -+ -+trap '' 1 2 15 -+cat > confcache <<\EOF -+# This file is a shell script that caches the results of configure -+# tests run on this system so they can be shared between configure -+# scripts and configure runs. It is not useful on other systems. -+# If it contains results you don't want to keep, you may remove or edit it. -+# -+# By default, configure uses ./config.cache as the cache file, -+# creating it if it does not exist already. You can give configure -+# the --cache-file=FILE option to use a different cache file; that is -+# what configure does when it calls configure scripts in -+# subdirectories, so they share the cache. -+# Giving --cache-file=/dev/null disables caching, for debugging configure. -+# config.status only pays attention to the cache file if you give it the -+# --recheck option to rerun configure. -+# -+EOF -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, don't put newlines in cache variables' values. -+# Ultrix sh set writes to stderr and can't be redirected directly, -+# and sets the high bit in the cache file unless we assign to the vars. -+(set) 2>&1 | -+ case `(ac_space=' '; set | grep ac_space) 2>&1` in -+ *ac_space=\ *) -+ # `set' does not quote correctly, so add quotes (double-quote substitution -+ # turns \\\\ into \\, and sed turns \\ into \). -+ sed -n \ -+ -e "s/'/'\\\\''/g" \ -+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" -+ ;; -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' -+ ;; -+ esac >> confcache -+if cmp -s $cache_file confcache; then -+ : -+else -+ if test -w $cache_file; then -+ echo "updating cache $cache_file" -+ cat confcache > $cache_file -+ else -+ echo "not updating unwritable cache $cache_file" -+ fi -+fi -+rm -f confcache -+ -+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -+ -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+# Let make expand exec_prefix. -+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ -+# Any assignment to VPATH causes Sun make to only execute -+# the first set of double-colon rules, so remove it if not needed. -+# If there is a colon in the path, we need to keep it. -+if test "x$srcdir" = x.; then -+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -+fi -+ -+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -+ -+DEFS=-DHAVE_CONFIG_H -+ -+# Without the "./", some shells look in PATH for config.status. -+: ${CONFIG_STATUS=./config.status} -+ -+echo creating $CONFIG_STATUS -+rm -f $CONFIG_STATUS -+cat > $CONFIG_STATUS </dev/null | sed 1q`: -+# -+# $0 $ac_configure_args -+# -+# Compiler output produced by configure, useful for debugging -+# configure, is in ./config.log if it exists. -+ -+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -+for ac_option -+do -+ case "\$ac_option" in -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" -+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v) -+ echo "$CONFIG_STATUS generated by autoconf version 2.13" -+ exit 0 ;; -+ -help | --help | --hel | --he | --h) -+ echo "\$ac_cs_usage"; exit 0 ;; -+ *) echo "\$ac_cs_usage"; exit 1 ;; -+ esac -+done -+ -+ac_given_srcdir=$srcdir -+ac_given_INSTALL="$INSTALL" -+ -+trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -+EOF -+cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -+$ac_vpsub -+$extrasub -+s%@SHELL@%$SHELL%g -+s%@CFLAGS@%$CFLAGS%g -+s%@CPPFLAGS@%$CPPFLAGS%g -+s%@CXXFLAGS@%$CXXFLAGS%g -+s%@FFLAGS@%$FFLAGS%g -+s%@DEFS@%$DEFS%g -+s%@LDFLAGS@%$LDFLAGS%g -+s%@LIBS@%$LIBS%g -+s%@exec_prefix@%$exec_prefix%g -+s%@prefix@%$prefix%g -+s%@program_transform_name@%$program_transform_name%g -+s%@bindir@%$bindir%g -+s%@sbindir@%$sbindir%g -+s%@libexecdir@%$libexecdir%g -+s%@datadir@%$datadir%g -+s%@sysconfdir@%$sysconfdir%g -+s%@sharedstatedir@%$sharedstatedir%g -+s%@localstatedir@%$localstatedir%g -+s%@libdir@%$libdir%g -+s%@includedir@%$includedir%g -+s%@oldincludedir@%$oldincludedir%g -+s%@infodir@%$infodir%g -+s%@mandir@%$mandir%g -+s%@host@%$host%g -+s%@host_alias@%$host_alias%g -+s%@host_cpu@%$host_cpu%g -+s%@host_vendor@%$host_vendor%g -+s%@host_os@%$host_os%g -+s%@target@%$target%g -+s%@target_alias@%$target_alias%g -+s%@target_cpu@%$target_cpu%g -+s%@target_vendor@%$target_vendor%g -+s%@target_os@%$target_os%g -+s%@build@%$build%g -+s%@build_alias@%$build_alias%g -+s%@build_cpu@%$build_cpu%g -+s%@build_vendor@%$build_vendor%g -+s%@build_os@%$build_os%g -+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -+s%@INSTALL_DATA@%$INSTALL_DATA%g -+s%@CC@%$CC%g -+s%@AS@%$AS%g -+s%@AR@%$AR%g -+s%@LD@%$LD%g -+s%@RANLIB@%$RANLIB%g -+s%@host_makefile_frag_path@%$host_makefile_frag_path%g -+/@host_makefile_frag@/r $host_makefile_frag -+s%@host_makefile_frag@%%g -+ -+CEOF -+EOF -+ -+cat >> $CONFIG_STATUS <<\EOF -+ -+# Split the substitutions into bite-sized pieces for seds with -+# small command number limits, like on Digital OSF/1 and HP-UX. -+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -+ac_file=1 # Number of current file. -+ac_beg=1 # First line for current file. -+ac_end=$ac_max_sed_cmds # Line after last line for current file. -+ac_more_lines=: -+ac_sed_cmds="" -+while $ac_more_lines; do -+ if test $ac_beg -gt 1; then -+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file -+ else -+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file -+ fi -+ if test ! -s conftest.s$ac_file; then -+ ac_more_lines=false -+ rm -f conftest.s$ac_file -+ else -+ if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds="sed -f conftest.s$ac_file" -+ else -+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" -+ fi -+ ac_file=`expr $ac_file + 1` -+ ac_beg=$ac_end -+ ac_end=`expr $ac_end + $ac_max_sed_cmds` -+ fi -+done -+if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds=cat -+fi -+EOF -+ -+cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then -+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". -+ case "$ac_file" in -+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` -+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; -+ *) ac_file_in="${ac_file}.in" ;; -+ esac -+ -+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. -+ -+ # Remove last slash and all that follows it. Not all systems have dirname. -+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` -+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then -+ # The file is in a subdirectory. -+ test ! -d "$ac_dir" && mkdir "$ac_dir" -+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" -+ # A "../" for each directory in $ac_dir_suffix. -+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` -+ else -+ ac_dir_suffix= ac_dots= -+ fi -+ -+ case "$ac_given_srcdir" in -+ .) srcdir=. -+ if test -z "$ac_dots"; then top_srcdir=. -+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; -+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; -+ *) # Relative path. -+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" -+ top_srcdir="$ac_dots$ac_given_srcdir" ;; -+ esac -+ -+ case "$ac_given_INSTALL" in -+ [/$]*) INSTALL="$ac_given_INSTALL" ;; -+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;; -+ esac -+ -+ echo creating "$ac_file" -+ rm -f "$ac_file" -+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." -+ case "$ac_file" in -+ *Makefile*) ac_comsub="1i\\ -+# $configure_input" ;; -+ *) ac_comsub= ;; -+ esac -+ -+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` -+ sed -e "$ac_comsub -+s%@configure_input@%$configure_input%g -+s%@srcdir@%$srcdir%g -+s%@top_srcdir@%$top_srcdir%g -+s%@INSTALL@%$INSTALL%g -+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -+fi; done -+rm -f conftest.s* -+ -+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -+# NAME is the cpp macro being defined and VALUE is the value it is being given. -+# -+# ac_d sets the value in "#define NAME VALUE" lines. -+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -+ac_dC='\3' -+ac_dD='%g' -+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -+ac_uB='\([ ]\)%\1#\2define\3' -+ac_uC=' ' -+ac_uD='\4%g' -+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -+ac_eB='$%\1#\2define\3' -+ac_eC=' ' -+ac_eD='%g' -+ -+if test "${CONFIG_HEADERS+set}" != set; then -+EOF -+cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -+fi -+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then -+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". -+ case "$ac_file" in -+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` -+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; -+ *) ac_file_in="${ac_file}.in" ;; -+ esac -+ -+ echo creating $ac_file -+ -+ rm -f conftest.frag conftest.in conftest.out -+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` -+ cat $ac_file_inputs > conftest.in -+ -+EOF -+ -+# Transform confdefs.h into a sed script conftest.vals that substitutes -+# the proper values into config.h.in to produce config.h. And first: -+# Protect against being on the right side of a sed subst in config.status. -+# Protect against being in an unquoted here document in config.status. -+rm -f conftest.vals -+cat > conftest.hdr <<\EOF -+s/[\\&%]/\\&/g -+s%[\\$`]%\\&%g -+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -+s%ac_d%ac_u%gp -+s%ac_u%ac_e%gp -+EOF -+sed -n -f conftest.hdr confdefs.h > conftest.vals -+rm -f conftest.hdr -+ -+# This sed command replaces #undef with comments. This is necessary, for -+# example, in the case of _POSIX_SOURCE, which is predefined and required -+# on some systems where configure will not decide to define it. -+cat >> conftest.vals <<\EOF -+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -+EOF -+ -+# Break up conftest.vals because some shells have a limit on -+# the size of here documents, and old seds have small limits too. -+ -+rm -f conftest.tail -+while : -+do -+ ac_lines=`grep -c . conftest.vals` -+ # grep -c gives empty output for an empty file on some AIX systems. -+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi -+ # Write a limited-size here document to conftest.frag. -+ echo ' cat > conftest.frag <> $CONFIG_STATUS -+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS -+ echo 'CEOF -+ sed -f conftest.frag conftest.in > conftest.out -+ rm -f conftest.in -+ mv conftest.out conftest.in -+' >> $CONFIG_STATUS -+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail -+ rm -f conftest.vals -+ mv conftest.tail conftest.vals -+done -+rm -f conftest.vals -+ -+cat >> $CONFIG_STATUS <<\EOF -+ rm -f conftest.frag conftest.h -+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h -+ cat conftest.in >> conftest.h -+ rm -f conftest.in -+ if cmp -s $ac_file conftest.h 2>/dev/null; then -+ echo "$ac_file is unchanged" -+ rm -f conftest.h -+ else -+ # Remove last slash and all that follows it. Not all systems have dirname. -+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` -+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then -+ # The file is in a subdirectory. -+ test ! -d "$ac_dir" && mkdir "$ac_dir" -+ fi -+ rm -f $ac_file -+ mv conftest.h $ac_file -+ fi -+fi; done -+ -+EOF -+cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -+ac_file=Makefile . ${libgloss_topdir}/config-ml.in -+exit 0 -+EOF -+chmod +x $CONFIG_STATUS -+rm -fr confdefs* $ac_clean_files -+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 -+ -+ -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/configure.in newlib-1.14.0-arm/libgloss/libsysbase/configure.in ---- newlib-1.14.0/libgloss/libsysbase/configure.in Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/configure.in Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,219 @@ -+# Copyright (c) 1995, 1996 Cygnus Support -+# -+# The authors hereby grant permission to use, copy, modify, distribute, -+# and license this software and its documentation for any purpose, provided -+# that existing copyright notices are retained in all copies and that this -+# notice is included verbatim in any distributions. No written agreement, -+# license, or royalty fee is required for any of the authorized uses. -+# Modifications to this software may be copyrighted by their authors -+# and need not follow the licensing terms described here, provided that -+# the new terms are clearly indicated on the first page of each file where -+# they apply. -+# -+# Process this file with autoconf to produce a configure script. -+# -+AC_PREREQ(2.5)dnl -+AC_INIT(close.c) -+AC_CONFIG_HEADER(config.h) -+ -+if test "${enable_shared}" = "yes" ; then -+ echo "Shared libraries not supported for cross compiling, ignored" -+fi -+ -+if test "$srcdir" = "." ; then -+ if test "${with_target_subdir}" != "." ; then -+ libgloss_topdir="${srcdir}/${with_multisrctop}../../.." -+ else -+ libgloss_topdir="${srcdir}/${with_multisrctop}../.." -+ fi -+else -+ libgloss_topdir="${srcdir}/../.." -+fi -+AC_CONFIG_AUX_DIR($libgloss_topdir) -+ -+AC_CANONICAL_SYSTEM -+AC_ARG_PROGRAM -+ -+AC_PROG_INSTALL -+ -+# FIXME: We temporarily define our own version of AC_PROG_CC. This is -+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -+# are building a library that must be included in all links, so we -+# can't link an executable until this lib is built. -+# autoconf should provide a way to do this. -+ -+AC_DEFUN(LIB_AC_PROG_CC, -+[AC_BEFORE([$0], [AC_PROG_CPP])dnl -+AC_CHECK_PROG(CC, gcc, gcc) -+if test -z "$CC"; then -+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) -+ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -+fi -+ -+AC_PROG_CC_GNU -+ -+if test $ac_cv_prog_gcc = yes; then -+ GCC=yes -+dnl Check whether -g works, even if CFLAGS is set, in case the package -+dnl plays around with CFLAGS (such as to build both debugging and -+dnl normal versions of a library), tasteless as that idea is. -+ ac_test_CFLAGS="${CFLAGS+set}" -+ ac_save_CFLAGS="$CFLAGS" -+ CFLAGS= -+ AC_PROG_CC_G -+ if test "$ac_test_CFLAGS" = set; then -+ CFLAGS="$ac_save_CFLAGS" -+ elif test $ac_cv_prog_cc_g = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-O2" -+ fi -+else -+ GCC= -+ test "${CFLAGS+set}" = set || CFLAGS="-g" -+fi -+]) -+ -+AC_DEFINE(HAVE_GNU_LD) -+dnl Make sure syscall names match those being used by newlib -+case "${target}" in -+ *-*-cygwin*) -+ ;; -+ a29k-amd-udi) -+ ;; -+ arc-*-*) -+ ;; -+ arm-*-pe) -+ ;; -+ arm-*-*) -+ ;; -+ strongarm-*-*) -+ ;; -+ d10v*) -+ ;; -+ h8300*-*-*) -+ ;; -+ h8500-*-*) -+ ;; -+ i[3456]86-*-sco*) -+ ;; -+ m32r-*-*) -+ ;; -+ mn10?00-*-*) -+ ;; -+ powerpcle-*-pe) -+ ;; -+ sh*-*-*) -+ ;; -+ sparc-sun-sunos*) -+ ;; -+ sparc64-*-*) -+ ;; -+ thumb-*-pe) -+ ;; -+ thumb-*-*) -+ ;; -+ v850-*-*) -+ ;; -+ v850e-*-*) -+ ;; -+ v850ea-*-*) -+ ;; -+ w65-*-*) -+ ;; -+ xstormy16-*-*) -+ ;; -+ z8k-*-*) -+ ;; -+ *) -+ AC_DEFINE(MISSING_SYSCALL_NAMES) -+ ;; -+esac -+ -+dnl Make sure we know if elf format used -+case "${target}" in -+ *-*-elf) -+ AC_DEFINE(HAVE_ELF) -+ -+ AC_CACHE_CHECK(for .previous assembler directive, -+ libc_cv_asm_previous_directive, [dnl -+ cat > conftest.s <&AC_FD_CC); then -+ AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE) -+ fi -+ rm -f conftest*]) -+ -+ AC_CACHE_CHECK(for .popsection assembler directive, -+ libc_cv_asm_popsection_directive, [dnl -+ cat > conftest.s <&AC_FD_CC); then -+ AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE) -+ fi -+ rm -f conftest*]) -+ -+ AC_CACHE_CHECK(for section attributes, -+ libc_cv_section_attributes, [dnl -+ cat > conftest.c <&AC_FD_CC); then -+ AC_DEFINE(HAVE_SECTION_ATTRIBUTES) -+ fi -+ rm -f conftest*]) -+ ;; -+esac -+ -+AC_CACHE_CHECK(for function prefix, libc_dollar_prefix, [dnl -+cat > conftest.c <<\EOF -+foo () { } -+EOF -+dnl -+if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]); -+then -+ libc_dollar_prefix=yes -+else -+ libc_dollar_prefix=no -+fi -+rm -f conftest* ]) -+if test $libc_dollar_prefix = yes ; then -+ AC_DEFINE(__SYMBOL_PREFIX, "$") -+else -+ AC_DEFINE(__SYMBOL_PREFIX, "") -+fi -+ -+LIB_AC_PROG_CC -+AS=${AS-as} -+AC_SUBST(AS) -+AR=${AR-ar} -+AC_SUBST(AR) -+LD=${LD-ld} -+AC_SUBST(LD) -+AC_PROG_RANLIB -+ -+host_makefile_frag=${srcdir}/../config/default.mh -+ -+dnl We have to assign the same value to other variables because autoconf -+dnl doesn't provide a mechanism to substitute a replacement keyword with -+dnl arbitrary data or pathnames. -+dnl -+host_makefile_frag_path=$host_makefile_frag -+AC_SUBST(host_makefile_frag_path) -+AC_SUBST_FILE(host_makefile_frag) -+ -+AC_OUTPUT(Makefile, -+ac_file=Makefile . ${libgloss_topdir}/config-ml.in, -+srcdir=${srcdir} -+target=${target} -+ac_configure_args="${ac_configure_args} --enable-multilib" -+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -+libgloss_topdir=${libgloss_topdir} -+) -+ -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/environ.c newlib-1.14.0-arm/libgloss/libsysbase/environ.c ---- newlib-1.14.0/libgloss/libsysbase/environ.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/environ.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,6 @@ -+/* -+ * Version of environ for no OS. -+ */ -+ -+char *__env[1] = { 0 }; -+char **environ = __env; -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/execve.c newlib-1.14.0-arm/libgloss/libsysbase/execve.c ---- newlib-1.14.0/libgloss/libsysbase/execve.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/execve.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,21 @@ -+/* -+ * Stub version of execve. -+ */ -+ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include "warning.h" -+ -+int -+_DEFUN (_execve, (name, argv, env), -+ char *name _AND -+ char **argv _AND -+ char **env) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+ -+stub_warning(_execve) -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/fork.c newlib-1.14.0-arm/libgloss/libsysbase/fork.c ---- newlib-1.14.0/libgloss/libsysbase/fork.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/fork.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,19 @@ -+/* -+ * Stub version of fork. -+ */ -+ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include "warning.h" -+ -+int -+_DEFUN (_fork, (), -+ _NOARGS) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+ -+stub_warning(_fork) -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/fstat.c newlib-1.14.0-arm/libgloss/libsysbase/fstat.c ---- newlib-1.14.0/libgloss/libsysbase/fstat.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/fstat.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,45 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+ -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN (_fstat_r,(r,fileDesc, st), -+ struct _reent * r _AND -+ int fileDesc _AND -+ struct stat *st) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN (_fstat,(fileDesc, st), -+ int fileDesc _AND -+ struct stat *st) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ int ret = -1; -+ unsigned int dev = 0; -+ unsigned int fd = -1; -+ -+ __handle * handle = NULL; -+ -+ if(fileDesc!=-1) { -+ if ( fileDesc < 3) { -+ dev = fileDesc; -+ } else { -+ handle = (__handle *)fileDesc; -+ dev = handle->device; -+ fd = (int)handle->fileStruct; -+ } -+ if(devoptab_list[dev]->fstat_r) { -+ ret = devoptab_list[dev]->fstat_r(r,fd,st); -+ } else { -+ r->_errno = ENOSYS; -+ } -+ } -+ return ret; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/getpid.c newlib-1.14.0-arm/libgloss/libsysbase/getpid.c ---- newlib-1.14.0/libgloss/libsysbase/getpid.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/getpid.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,20 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN( _getpid_r,(ptr), -+ struct _reent *ptr) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN (_getpid, (), -+ _NOARGS) { -+//--------------------------------------------------------------------------------- -+ struct _reent *ptr = _REENT; -+#endif -+ ptr->_errno = ENOSYS; -+ return -1; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/gettod.c newlib-1.14.0-arm/libgloss/libsysbase/gettod.c ---- newlib-1.14.0/libgloss/libsysbase/gettod.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/gettod.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,25 @@ -+/* -+ * Stub version of gettimeofday. -+ */ -+ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+#include "warning.h" -+ -+struct timeval; -+struct timezone; -+ -+int -+_DEFUN (_gettimeofday, (ptimeval, ptimezone), -+ struct timeval *ptimeval _AND -+ struct timezone *ptimezone) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+ -+stub_warning(_gettimeofday) -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/iosupport.c newlib-1.14.0-arm/libgloss/libsysbase/iosupport.c ---- newlib-1.14.0/libgloss/libsysbase/iosupport.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/iosupport.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,98 @@ -+#include -+#include -+#include -+ -+static int defaultDevice = -1; -+ -+//--------------------------------------------------------------------------------- -+void setDefaultDevice( int device ) { -+//--------------------------------------------------------------------------------- -+ -+ if ( device >2 && device <= STD_MAX) -+ defaultDevice = device; -+} -+ -+//--------------------------------------------------------------------------------- -+const devoptab_t dotab_stdnull = { -+//--------------------------------------------------------------------------------- -+ "stdnull", // device name -+ 0, // size of file structure -+ NULL, // device open -+ NULL, // device close -+ NULL, // device write -+ NULL, // device read -+ NULL, // device seek -+ NULL, // device fstat -+ NULL, // device stat -+ NULL, // device link -+ NULL, // device unlink -+ NULL // device chdir -+}; -+ -+//--------------------------------------------------------------------------------- -+const devoptab_t *devoptab_list[STD_MAX] = { -+//--------------------------------------------------------------------------------- -+ &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, -+ &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, -+ &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, -+ &dotab_stdnull, &dotab_stdnull, &dotab_stdnull, &dotab_stdnull -+}; -+ -+//--------------------------------------------------------------------------------- -+int FindDevice(const char* name) { -+//--------------------------------------------------------------------------------- -+ int i = 0, namelen, dev = -1; -+ -+ while(iname); -+ if(strncmp(devoptab_list[i]->name,name,namelen)==0 ) { -+ if ( name[namelen] == ':' || (isdigit(name[namelen]) && name[namelen+1] ==':' )) { -+ dev = i; -+ break; -+ } -+ } -+ } -+ i++; -+ } -+ -+ if ( dev == -1 && defaultDevice != -1 ) dev = defaultDevice; -+ -+ return dev; -+} -+ -+//--------------------------------------------------------------------------------- -+int RemoveDevice( const char* name) { -+//--------------------------------------------------------------------------------- -+ int dev = FindDevice(name); -+ -+ if ( -1 != dev ) { -+ devoptab_list[dev] = &dotab_stdnull; -+ return 0; -+ } -+ -+ return -1; -+ -+} -+//--------------------------------------------------------------------------------- -+int AddDevice( const devoptab_t* device) { -+//--------------------------------------------------------------------------------- -+ -+ int devnum; -+ -+ for ( devnum = 3;devnum name, device->name) && -+ strlen(devoptab_list[devnum]->name) == strlen(device->name) ) || -+ !strcmp(devoptab_list[devnum]->name, "stdnull") -+ ) -+ break; -+ } -+ -+ if ( devnum == STD_MAX ) { -+ devnum = -1; -+ } else { -+ devoptab_list[devnum] = device; -+ } -+ return devnum; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/isatty.c newlib-1.14.0-arm/libgloss/libsysbase/isatty.c ---- newlib-1.14.0/libgloss/libsysbase/isatty.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/isatty.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,10 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+ -+//--------------------------------------------------------------------------------- -+int _DEFUN(isatty,(file), -+ int file) { -+//--------------------------------------------------------------------------------- -+ return 0; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/kill.c newlib-1.14.0-arm/libgloss/libsysbase/kill.c ---- newlib-1.14.0/libgloss/libsysbase/kill.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/kill.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,24 @@ -+/* -+ * Stub version of kill. -+ */ -+ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include "warning.h" -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+int _DEFUN(_kill_r,(ptr,pid,sig), -+ struct _reent *ptr _AND -+ int pid _AND -+ int sig) { -+#else -+int _DEFUN(_kill,(pid,sig), -+ int pid _AND -+ int sig) { -+ struct _reent *ptr = _REENT; -+#endif -+ ptr->_errno = ENOSYS; -+ return -1; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/link.c newlib-1.14.0-arm/libgloss/libsysbase/link.c ---- newlib-1.14.0/libgloss/libsysbase/link.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/link.c Thu Jul 20 02:46:43 2006 -@@ -0,0 +1,36 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+int _DEFUN (_link_r, (r, existing, new), -+ struct _reent r _AND -+ const char *existing _AND -+ const char *new) { -+#else -+int _DEFUN (_link, (existing, new), -+ const char *existing _AND -+ const char *new) { -+ struct _reent *r = _REENT; -+#endif -+ int ret; -+ int sourceDev = FindDevice(existing); -+ int destDev = FindDevice(new); -+ -+ ret = -1; -+ -+ if ( sourceDev == destDev) { -+ if (devoptab_list[destDev]->link_r) { -+ ret = devoptab_list[destDev]->link_r( r, existing, new); -+ } else { -+ r->_errno = ENOSYS; -+ } -+ } else { -+ r->_errno = EXDEV; -+ } -+ -+ return ret; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/lseek.c newlib-1.14.0-arm/libgloss/libsysbase/lseek.c ---- newlib-1.14.0/libgloss/libsysbase/lseek.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/lseek.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,46 @@ -+ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+ -+#include -+ -+//--------------------------------------------------------------------------------- -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN(_lseek_r,(r, fileDesc, pos, dir), -+ struct _reent * r _AND -+ int fileDesc _AND -+ int pos _AND -+ int dir) -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN(_lseek,(fileDesc, pos, dir), -+ int fileDesc _AND -+ int pos _AND -+ int dir) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+//--------------------------------------------------------------------------------- -+#endif -+//--------------------------------------------------------------------------------- -+ int ret = -1; -+ unsigned int dev = 0; -+ unsigned int fd = -1; -+ -+ __handle * handle; -+ -+ if(fileDesc!=-1) { -+ -+ handle = (__handle *)fileDesc; -+ dev = handle->device; -+ fd = (int)handle->fileStruct; -+ -+ if(devoptab_list[dev]->seek_r) -+ ret = devoptab_list[dev]->seek_r(0,fd,pos,dir); -+ -+ } -+ return ret; -+ -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/malloc_vars.c newlib-1.14.0-arm/libgloss/libsysbase/malloc_vars.c ---- newlib-1.14.0/libgloss/libsysbase/malloc_vars.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/malloc_vars.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,2 @@ -+char *fake_heap_end = (char*)0; -+char *fake_heap_start = (char*)0; -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/open.c newlib-1.14.0-arm/libgloss/libsysbase/open.c ---- newlib-1.14.0/libgloss/libsysbase/open.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/open.c Thu Jul 20 02:47:56 2006 -@@ -0,0 +1,58 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN (_open_r, (r, file, flags, mode), -+ struct _reent * r _AND -+ const char *file _AND -+ int flags _AND -+ int mode) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN (_open, (file, flags, mode), -+ const char *file _AND -+ int flags _AND -+ int mode) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ __handle *handle; -+ int dev,fd; -+ -+ dev = FindDevice(file); -+ -+ fd = -1; -+ handle = (__handle *)-1; -+ if(dev!=-1 && devoptab_list[dev]->open_r) { -+ -+ handle = (__handle *)malloc( sizeof(__handle) + devoptab_list[dev]->structSize ); -+ -+ if ( NULL != handle ) { -+ handle->device = dev; -+ handle->fileStruct = ((void *)handle) + sizeof(__handle); -+ -+ fd = devoptab_list[dev]->open_r(r, handle->fileStruct, file, flags, mode); -+ -+ if ( fd == -1 ) { -+ free(handle); -+ handle = (__handle *)-1; -+ } -+ } else { -+ r->_errno = ENOSR; -+ handle = (__handle *)-1; -+ } -+ } else { -+ r->_errno = ENOSYS; -+ } -+ -+ return (int)handle; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/read.c newlib-1.14.0-arm/libgloss/libsysbase/read.c ---- newlib-1.14.0/libgloss/libsysbase/read.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/read.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,44 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+ -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN(_read_r,(r, fileDesc, ptr, len), -+ struct _reent * r _AND -+ int fileDesc _AND -+ char *ptr _AND -+ int len) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN(_read,(fileDesc, ptr, len), -+ int fileDesc _AND -+ char *ptr _AND -+ int len) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ int ret = -1; -+ unsigned int dev = 0; -+ unsigned int fd = -1; -+ -+ __handle * handle = NULL; -+ -+ if(fileDesc!=-1) { -+ if ( fileDesc < 3) { -+ dev = fileDesc; -+ } else { -+ handle = (__handle *)fileDesc; -+ dev = handle->device; -+ fd = (int)handle->fileStruct; -+ } -+ if(devoptab_list[dev]->read_r) -+ ret = devoptab_list[dev]->read_r(r,fd,ptr,len); -+ } -+ return ret; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/sbrk.c newlib-1.14.0-arm/libgloss/libsysbase/sbrk.c ---- newlib-1.14.0/libgloss/libsysbase/sbrk.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/sbrk.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,61 @@ -+#include <_ansi.h> -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+extern char *fake_heap_end; -+extern char *fake_heap_start; -+ -+/* Register name faking - works in collusion with the linker. */ -+register char * stack_ptr asm ("sp"); -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+caddr_t _sbrk_r (struct _reent *ptr, int incr) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+caddr_t _sbrk (int incr) { -+//--------------------------------------------------------------------------------- -+ struct _reent *ptr = _REENT; -+#endif -+ extern char end asm ("end"); /* Defined by the linker. */ -+ static char * heap_start; -+ -+ -+ char * prev_heap_start; -+ char * heap_end; -+ -+ if (heap_start == NULL) { -+ if (fake_heap_start == NULL) { -+ heap_start = &end; -+ } else { -+ heap_start = fake_heap_start; -+ } -+ } -+ -+ prev_heap_start = heap_start; -+ -+ if (fake_heap_end == NULL) { -+ heap_end = stack_ptr; -+ } else { -+ heap_end = fake_heap_end; -+ } -+ -+ if (heap_start + incr > heap_end) { -+ ptr->_errno = ENOMEM; -+ return (caddr_t) -1; -+ } -+ -+ heap_start += incr; -+ -+ return (caddr_t) prev_heap_start; -+} -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/stat.c newlib-1.14.0-arm/libgloss/libsysbase/stat.c ---- newlib-1.14.0/libgloss/libsysbase/stat.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/stat.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,39 @@ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+#include -+ -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN (_stat_r,(r,file, st), -+ struct _reent * r _AND -+ const char *file _AND -+ struct stat *st) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int -+_DEFUN (_stat, (file, st), -+ const char *file _AND -+ struct stat *st) -+{ -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ int dev,ret; -+ -+ dev = FindDevice(file); -+ -+ if(dev!=-1 && devoptab_list[dev]->stat_r) { -+ ret = devoptab_list[dev]->stat_r(r,file,st); -+ } else { -+ ret = -1; -+ r->_errno = ENODEV; -+ } -+ return ret; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/times.c newlib-1.14.0-arm/libgloss/libsysbase/times.c ---- newlib-1.14.0/libgloss/libsysbase/times.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/times.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,13 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+ -+//--------------------------------------------------------------------------------- -+clock_t _DEFUN (_times, (buf), -+ struct tms *buf) { -+//--------------------------------------------------------------------------------- -+ errno = ENOSYS; -+ return -1; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/unlink.c newlib-1.14.0-arm/libgloss/libsysbase/unlink.c ---- newlib-1.14.0/libgloss/libsysbase/unlink.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/unlink.c Thu Jul 20 02:46:16 2006 -@@ -0,0 +1,32 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN (_unlink_r, (r, name), -+ struct _reent * r _AND -+ const char *name ) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN (_unlink, (name), -+ const char *name) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ int dev,ret; -+ -+ dev = FindDevice(name); -+ if(dev!=-1 && devoptab_list[dev]->unlink_r) { -+ ret = devoptab_list[dev]->unlink_r(r,name); -+ } else { -+ ret = -1; -+ r->_errno = ENODEV; -+ } -+ -+ return ret; -+} -+ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/wait.c newlib-1.14.0-arm/libgloss/libsysbase/wait.c ---- newlib-1.14.0/libgloss/libsysbase/wait.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/wait.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,19 @@ -+/* -+ * Stub version of wait. -+ */ -+ -+#include "config.h" -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include "warning.h" -+ -+int -+_DEFUN (_wait, (status), -+ int *status) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+ -+stub_warning(_wait) -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/warning.h newlib-1.14.0-arm/libgloss/libsysbase/warning.h ---- newlib-1.14.0/libgloss/libsysbase/warning.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/warning.h Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,43 @@ -+#ifndef __WARNING_H__ -+#define __WARNING_H__ -+ -+#ifdef HAVE_GNU_LD -+# ifdef HAVE_ELF -+ -+/* We want the .gnu.warning.SYMBOL section to be unallocated. */ -+# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE -+# define __make_section_unallocated(section_string) \ -+ asm(".section " section_string "; .previous"); -+# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE) -+# define __make_section_unallocated(section_string) \ -+ asm(".pushsection " section_string "; .popsection"); -+# else -+# define __make_section_unallocated(section_string) -+# endif -+ -+# ifdef HAVE_SECTION_ATTRIBUTES -+# define link_warning(symbol, msg) \ -+ __make_section_unallocated (".gnu.warning." #symbol) \ -+ static const char __evoke_link_warning_##symbol[] \ -+ __attribute__ ((section (".gnu.warning." #symbol))) = msg; -+# else -+# define link_warning(symbol, msg) -+# endif -+ -+#else /* !ELF */ -+ -+# define link_warning(symbol, msg) \ -+ asm(".stabs \"" msg "\",30,0,0,0\n" \ -+ ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n"); -+# endif -+#else /* !GNULD */ -+/* We will never be heard; they will all die horribly. */ -+# define link_warning(symbol, msg) -+#endif -+ -+/* A canned warning for sysdeps/stub functions. */ -+#define stub_warning(name) \ -+ link_warning (name, \ -+ "warning: " #name " is not implemented and will always fail") -+ -+#endif /* __WARNING_H__ */ -diff -Nbaur newlib-1.14.0/libgloss/libsysbase/write.c newlib-1.14.0-arm/libgloss/libsysbase/write.c ---- newlib-1.14.0/libgloss/libsysbase/write.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/libgloss/libsysbase/write.c Thu Jul 20 02:41:18 2006 -@@ -0,0 +1,44 @@ -+#include <_ansi.h> -+#include <_syslist.h> -+#include -+#include -+ -+#include -+ -+#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- -+int _DEFUN(_write_r,(r, fileDesc, ptr, len), -+ struct _reent * r _AND -+ int fileDesc _AND -+ char *ptr _AND -+ int len) { -+//--------------------------------------------------------------------------------- -+#else -+//--------------------------------------------------------------------------------- -+int _DEFUN (_write, (fileDesc, ptr, len), -+ int fileDesc _AND -+ char *ptr _AND -+ int len) { -+//--------------------------------------------------------------------------------- -+ struct _reent *r = _REENT; -+#endif -+ int ret = -1; -+ unsigned int dev = 0; -+ unsigned int fd = -1; -+ -+ __handle * handle = NULL; -+ -+ -+ if(fileDesc!=-1) { -+ if ( fileDesc < 3) { -+ dev = fileDesc; -+ } else { -+ handle = (__handle *)fileDesc; -+ dev = handle->device; -+ fd = (int)handle->fileStruct; -+ } -+ if(devoptab_list[dev]->write_r) -+ ret = devoptab_list[dev]->write_r(r,fd,ptr,len); -+ } -+ return ret; -+} -diff -Nbaur newlib-1.14.0/newlib/libc/include/stdio.h newlib-1.14.0-arm/newlib/libc/include/stdio.h ---- newlib-1.14.0/newlib/libc/include/stdio.h Wed Oct 12 00:59:32 2005 -+++ newlib-1.14.0-arm/newlib/libc/include/stdio.h Thu Jul 20 02:41:18 2006 -@@ -179,6 +179,7 @@ - int _EXFUN(printf, (const char *, ...)); - int _EXFUN(scanf, (const char *, ...)); - int _EXFUN(sscanf, (const char *, const char *, ...)); -+int _EXFUN(siscanf, (const char *, const char *, ...)); - int _EXFUN(vfprintf, (FILE *, const char *, __VALIST)); - int _EXFUN(vprintf, (const char *, __VALIST)); - int _EXFUN(vsprintf, (char *, const char *, __VALIST)); -@@ -229,7 +230,7 @@ - #ifndef _REENT_ONLY - int _EXFUN(asiprintf, (char **, const char *, ...)); - int _EXFUN(asprintf, (char **, const char *, ...)); --int _EXFUN(dprintf, (int, const char *, ...)); -+//int _EXFUN(dprintf, (int, const char *, ...)); - int _EXFUN(fcloseall, (_VOID)); - int _EXFUN(fiprintf, (FILE *, const char *, ...)); - int _EXFUN(iprintf, (const char *, ...)); -@@ -247,6 +248,7 @@ - int _EXFUN(vfscanf, (FILE *, const char *, __VALIST)); - int _EXFUN(viprintf, (const char *, __VALIST)); - int _EXFUN(viscanf, (const char *, __VALIST)); -+int _EXFUN(viprintf, (const char *, __VALIST)); - int _EXFUN(vscanf, (const char *, __VALIST)); - int _EXFUN(vsiscanf, (const char *, const char *, __VALIST)); - int _EXFUN(vsscanf, (const char *, const char *, __VALIST)); -diff -Nbaur newlib-1.14.0/newlib/libc/include/sys/iosupport.h newlib-1.14.0-arm/newlib/libc/include/sys/iosupport.h ---- newlib-1.14.0/newlib/libc/include/sys/iosupport.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.14.0-arm/newlib/libc/include/sys/iosupport.h Thu Jul 20 02:45:46 2006 -@@ -0,0 +1,45 @@ -+//--------------------------------------------------------------------------------- -+#ifndef __iosupp_h__ -+#define __iosupp_h__ -+//--------------------------------------------------------------------------------- -+ -+#include -+ -+enum { -+ STD_IN, -+ STD_OUT, -+ STD_ERR, -+ STD_MAX = 16 -+}; -+ -+ -+typedef struct { -+ int device; -+ void *fileStruct; -+} __handle; -+ -+typedef struct { -+ const char *name; -+ int structSize; -+ int (*open_r)(struct _reent *r, void *fileStruct, const char *path,int flags,int mode); -+ int (*close_r)(struct _reent *r,int fd); -+ int (*write_r)(struct _reent *r,int fd,const char *ptr,int len); -+ int (*read_r)(struct _reent *r,int fd,char *ptr,int len); -+ int (*seek_r)(struct _reent *r,int fd,int pos,int dir); -+ int (*fstat_r)(struct _reent *r,int fd,struct stat *st); -+ int (*stat_r)(struct _reent *r,const char *file,struct stat *st); -+ int (*link_r)(struct _reent *r,const char *existing, const char *new); -+ int (*unlink_r)(struct _reent *r,const char *name); -+ int (*chdir_r)(struct _reent *r,const char *name); -+} devoptab_t; -+ -+extern const devoptab_t *devoptab_list[]; -+ -+int AddDevice( const devoptab_t* device); -+int FindDevice(const char* name); -+int RemoveDevice(const char* name); -+void setDefaultDevice( int device ); -+ -+//--------------------------------------------------------------------------------- -+#endif -+//--------------------------------------------------------------------------------- -diff -Nbaur newlib-1.14.0/newlib/libc/include/sys/reent.h newlib-1.14.0-arm/newlib/libc/include/sys/reent.h ---- newlib-1.14.0/newlib/libc/include/sys/reent.h Tue Feb 8 01:33:16 2005 -+++ newlib-1.14.0-arm/newlib/libc/include/sys/reent.h Thu Jul 20 02:41:18 2006 -@@ -151,7 +151,7 @@ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ -- short _file; /* fileno, if Unix descriptor, else -1 */ -+ int _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - -@@ -168,7 +168,7 @@ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ -- short _file; /* fileno, if Unix descriptor, else -1 */ -+ int _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - -@@ -216,7 +216,7 @@ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ -- short _file; /* fileno, if Unix descriptor, else -1 */ -+ int _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - -diff -Nbaur newlib-1.14.0/newlib/libc/syscalls/syslink.c newlib-1.14.0-arm/newlib/libc/syscalls/syslink.c ---- newlib-1.14.0/newlib/libc/syscalls/syslink.c Tue Jun 3 20:48:08 2003 -+++ newlib-1.14.0-arm/newlib/libc/syscalls/syslink.c Thu Jul 20 02:42:38 2006 -@@ -4,8 +4,8 @@ - - int - _DEFUN (link, (old, new), -- char *old _AND -- char *new) -+ const char *old _AND -+ const char *new) - { - #ifdef REENTRANT_SYSCALLS_PROVIDED - return _link_r (_REENT, old, new); -diff -Nbaur newlib-1.14.0/newlib/libc/syscalls/sysunlink.c newlib-1.14.0-arm/newlib/libc/syscalls/sysunlink.c ---- newlib-1.14.0/newlib/libc/syscalls/sysunlink.c Tue Jun 3 20:48:08 2003 -+++ newlib-1.14.0-arm/newlib/libc/syscalls/sysunlink.c Thu Jul 20 02:42:19 2006 -@@ -4,7 +4,7 @@ - - int - _DEFUN (unlink, (file), -- char *file) -+ const char *file) - { - #ifdef REENTRANT_SYSCALLS_PROVIDED - return _unlink_r (_REENT, file); diff --git a/dkpsp/patches/gcc-4.0.1.patch b/dkpsp/patches/gcc-4.0.1.patch deleted file mode 100644 index 87af40c..0000000 --- a/dkpsp/patches/gcc-4.0.1.patch +++ /dev/null @@ -1,1067 +0,0 @@ ---- gcc-4.0.1.orig/config.sub 2005-04-25 03:36:56.000000000 -0700 -+++ gcc-psp/config.sub 2005-07-22 17:40:49.000000000 -0700 -@@ -254,6 +254,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ -@@ -328,6 +329,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ -@@ -668,6 +670,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; ---- gcc-4.0.1.orig/gcc/config/mips/t-allegrex 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/t-allegrex 2005-06-19 18:09:38.000000000 -0700 -@@ -0,0 +1,29 @@ -+# Suppress building libgcc1.a, since the MIPS compiler port is complete -+# and does not need anything from libgcc1.a. -+LIBGCC1 = -+CROSS_LIBGCC1 = -+ -+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o -+# Don't let CTOR_LIST end up in sdata section. -+CRTSTUFF_T_CFLAGS = -G 0 -+ -+# Assemble startup files. -+$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm -+ -+$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm -+ -+# We must build libgcc2.a with -G 0, in case the user wants to link -+# without the $gp register. -+TARGET_LIBGCC2_CFLAGS = -G 0 -+ -+# Build the libraries for both hard and soft floating point -+ -+MULTILIB_OPTIONS = -+MULTILIB_DIRNAMES = -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib ---- gcc-4.0.1.orig/gcc/config/mips/mips.md 2005-05-08 04:56:58.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.md 2005-08-25 23:56:56.000000000 -0700 -@@ -70,6 +70,21 @@ - (UNSPEC_RSQRT2 209) - (UNSPEC_RECIP1 210) - (UNSPEC_RECIP2 211) -+ -+ ;; Sony ALLEGREX instructions -+ (UNSPEC_BITREV 400) -+ (UNSPEC_WSBH 401) -+ (UNSPEC_WSBW 402) -+ -+ (UNSPEC_CLO 403) -+ (UNSPEC_CTO 404) -+ -+ (UNSPEC_CACHE 405) -+ (UNSPEC_SYNC 406) -+ -+ (UNSPEC_CEIL_W_S 407) -+ (UNSPEC_FLOOR_W_S 408) -+ (UNSPEC_ROUND_W_S 409) - ] - ) - -@@ -1514,9 +1529,9 @@ - (mult:DI - (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] -- "!TARGET_64BIT && ISA_HAS_MSAC" -+ "!TARGET_64BIT && (ISA_HAS_MSAC || TARGET_ALLEGREX)" - { -- if (TARGET_MIPS5500) -+ if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "msub\t%1,%2"; - else - return "msac\t$0,%1,%2"; -@@ -1631,12 +1646,12 @@ - (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) - (match_operand:DI 3 "register_operand" "0")))] -- "(TARGET_MAD || ISA_HAS_MACC) -+ "(TARGET_MAD || ISA_HAS_MACC || TARGET_ALLEGREX) - && !TARGET_64BIT" - { - if (TARGET_MAD) - return "mad\t%1,%2"; -- else if (TARGET_MIPS5500) -+ else if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "madd\t%1,%2"; - else - /* See comment in *macc. */ -@@ -1911,36 +1926,24 @@ - ;; .................... - ;; - --(define_insn "ffs2" -- [(set (match_operand:GPR 0 "register_operand" "=&d") -- (ffs:GPR (match_operand:GPR 1 "register_operand" "d"))) -- (clobber (match_scratch:GPR 2 "=&d")) -- (clobber (match_scratch:GPR 3 "=&d"))] -- "!TARGET_MIPS16" -+(define_expand "ffs2" -+ [(set (match_operand:GPR 0 "register_operand" "") -+ (ffs:GPR (match_operand:GPR 1 "register_operand" "")))] -+ "ISA_HAS_CLZ_CLO" - { -- if (optimize && find_reg_note (insn, REG_DEAD, operands[1])) -- return "%(\ --move\t%0,%.\;\ --beq\t%1,%.,2f\n\ --%~1:\tand\t%2,%1,0x0001\;\ --addu\t%0,%0,1\;\ --beq\t%2,%.,1b\;\ --srl\t%1,%1,1\n\ --%~2:%)"; -- -- return "%(\ --move\t%0,%.\;\ --move\t%3,%1\;\ --beq\t%3,%.,2f\n\ --%~1:\tand\t%2,%3,0x0001\;\ --addu\t%0,%0,1\;\ --beq\t%2,%.,1b\;\ --srl\t%3,%3,1\n\ --%~2:%)"; --} -- [(set_attr "type" "multi") -- (set_attr "mode" "") -- (set_attr "length" "28")]) -+ rtx r1, r2, r3, r4; -+ -+ r1 = gen_reg_rtx (mode); -+ r2 = gen_reg_rtx (mode); -+ r3 = gen_reg_rtx (mode); -+ r4 = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (r1, operands[1])); -+ emit_insn (gen_and3 (r2, operands[1], r1)); -+ emit_insn (gen_clz2 (r3, r2)); -+ emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (mode))); -+ emit_insn (gen_sub3 (operands[0], r4, r3)); -+ DONE; -+}) - - ;; - ;; ................... -@@ -2790,7 +2793,7 @@ - - (define_expand "extzv" - [(set (match_operand 0 "register_operand") -- (zero_extract (match_operand:QI 1 "memory_operand") -+ (zero_extract (match_operand 1 "nonimmediate_operand") - (match_operand 2 "immediate_operand") - (match_operand 3 "immediate_operand")))] - "!TARGET_MIPS16" -@@ -2799,12 +2802,33 @@ - INTVAL (operands[2]), - INTVAL (operands[3]))) - DONE; -+ else if (mips_use_ins_ext_p (operands[1], operands[2], operands[3])) -+ { -+ if (GET_MODE (operands[0]) == DImode) -+ emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], -+ operands[3])); -+ else -+ emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], -+ operands[3])); -+ DONE; -+ } - else - FAIL; - }) - -+(define_insn "extzv" -+ [(set (match_operand:GPR 0 "register_operand" "=d") -+ (zero_extract:GPR (match_operand:GPR 1 "register_operand" "d") -+ (match_operand:SI 2 "immediate_operand" "I") -+ (match_operand:SI 3 "immediate_operand" "I")))] -+ "mips_use_ins_ext_p (operands[1], operands[2], operands[3])" -+ "ext\t%0,%1,%3,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "")]) -+ -+ - (define_expand "insv" -- [(set (zero_extract (match_operand:QI 0 "memory_operand") -+ [(set (zero_extract (match_operand 0 "nonimmediate_operand") - (match_operand 1 "immediate_operand") - (match_operand 2 "immediate_operand")) - (match_operand 3 "reg_or_0_operand"))] -@@ -2814,10 +2838,30 @@ - INTVAL (operands[1]), - INTVAL (operands[2]))) - DONE; -+ else if (mips_use_ins_ext_p (operands[0], operands[1], operands[2])) -+ { -+ if (GET_MODE (operands[0]) == DImode) -+ emit_insn (gen_insvdi (operands[0], operands[1], operands[2], -+ operands[3])); -+ else -+ emit_insn (gen_insvsi (operands[0], operands[1], operands[2], -+ operands[3])); -+ DONE; -+ } - else - FAIL; - }) - -+(define_insn "insv" -+ [(set (zero_extract:GPR (match_operand:GPR 0 "register_operand" "+d") -+ (match_operand:SI 1 "immediate_operand" "I") -+ (match_operand:SI 2 "immediate_operand" "I")) -+ (match_operand:GPR 3 "reg_or_0_operand" "dJ"))] -+ "mips_use_ins_ext_p (operands[0], operands[1], operands[2])" -+ "ins\t%0,%z3,%2,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "")]) -+ - ;; Unaligned word moves generated by the bit field patterns. - ;; - ;; As far as the rtl is concerned, both the left-part and right-part -@@ -4087,6 +4131,25 @@ - [(set_attr "type" "shift") - (set_attr "mode" "")]) - -+(define_expand "rotl3" -+ [(set (match_operand:GPR 0 "register_operand") -+ (rotate:GPR (match_operand:GPR 1 "register_operand") -+ (match_operand:SI 2 "arith_operand")))] -+ "ISA_HAS_ROTR_" -+{ -+ rtx temp; -+ -+ if (GET_CODE (operands[2]) == CONST_INT) -+ temp = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); -+ else -+ { -+ temp = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (temp, operands[2])); -+ } -+ emit_insn (gen_rotr3 (operands[0], operands[1], temp)); -+ DONE; -+}) -+ - ;; - ;; .................... - ;; -@@ -5200,7 +5263,7 @@ - (const_int 0)]) - (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") - (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - "@ - mov%T4\t%0,%z2,%1 - mov%t4\t%0,%z3,%1" -@@ -5230,8 +5293,12 @@ - (if_then_else:GPR (match_dup 5) - (match_operand:GPR 2 "reg_or_0_operand") - (match_operand:GPR 3 "reg_or_0_operand")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - { -+ if (ISA_HAS_INT_CONDMOVE -+ && GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_FLOAT) -+ FAIL; -+ - gen_conditional_move (operands); - DONE; - }) -@@ -5299,3 +5366,6 @@ - ; The MIPS Paired-Single Floating Point and MIPS-3D Instructions. - - (include "mips-ps-3d.md") -+ -+; Sony ALLEGREX instructions. -+(include "allegrex.md") ---- gcc-4.0.1.orig/gcc/config/mips/mips.c 2005-05-08 04:56:53.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.c 2005-08-26 18:56:46.257670312 -0700 -@@ -150,6 +150,15 @@ - MIPS_DF_FTYPE_DF, - MIPS_DF_FTYPE_DF_DF, - -+ /* For the Sony ALLEGREX. */ -+ MIPS_SI_FTYPE_QI, -+ MIPS_SI_FTYPE_HI, -+ MIPS_SI_FTYPE_SI, -+ MIPS_SI_FTYPE_SI_SI, -+ MIPS_VOID_FTYPE_VOID, -+ MIPS_VOID_FTYPE_SI_SI, -+ MIPS_SI_FTYPE_SF, -+ - /* The last type. */ - MIPS_MAX_FTYPE_MAX - }; -@@ -162,6 +171,10 @@ - operands 1 and above. */ - MIPS_BUILTIN_DIRECT, - -+ /* The builtin corresponds directly to an .md pattern. There is no return -+ value and the arguments are mapped to operands 0 and above. */ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, -+ - /* The builtin corresponds to a comparison instruction followed by - a mips_cond_move_tf_ps pattern. The first two arguments are the - values to compare and the second two arguments are the vector -@@ -185,7 +198,12 @@ - MIPS_BUILTIN_CMP_LOWER, - - /* As above, but the instruction only sets a single $fcc register. */ -- MIPS_BUILTIN_CMP_SINGLE -+ MIPS_BUILTIN_CMP_SINGLE, -+ -+ /* The builtin corresponds to the ALLEGREX cache instruction. Operand 0 -+ is the function code (must be less than 32) and operand 1 is the base -+ address. */ -+ MIPS_BUILTIN_CACHE - }; - - /* Invokes MACRO (COND) for each c.cond.fmt condition. */ -@@ -361,13 +379,14 @@ - static rtx mips_prepare_builtin_target (enum insn_code, unsigned int, rtx); - static rtx mips_expand_builtin (tree, rtx, rtx, enum machine_mode, int); - static void mips_init_builtins (void); --static rtx mips_expand_builtin_direct (enum insn_code, rtx, tree); -+static rtx mips_expand_builtin_direct (enum insn_code, rtx, tree, bool); - static rtx mips_expand_builtin_movtf (enum mips_builtin_type, - enum insn_code, enum mips_fp_condition, - rtx, tree); - static rtx mips_expand_builtin_compare (enum mips_builtin_type, - enum insn_code, enum mips_fp_condition, - rtx, tree); -+static rtx mips_expand_builtin_cache (enum insn_code icode, rtx, tree); - - /* Structure to be filled in by compute_frame_size with register - save masks, and offsets for the current function. */ -@@ -673,6 +692,7 @@ - - /* MIPS II */ - { "r6000", PROCESSOR_R6000, 2 }, -+ { "allegrex", PROCESSOR_ALLEGREX, 2 }, - - /* MIPS III */ - { "r4000", PROCESSOR_R4000, 3 }, -@@ -3969,6 +3989,38 @@ - return true; - } - -+/* Return true if (zero_extract OP SIZE POSITION) can be used as the -+ source of an "ext" instruction or the destination of an "ins" -+ instruction. OP must be a register operand and the following -+ conditions must hold: -+ -+ 0 <= POSITION < GET_MODE_BITSIZE (GET_MODE (op)) -+ 0 < SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) -+ 0 < POSITION + SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) -+ -+ Also reject lengths equal to a word as they are better handled -+ by the move patterns. */ -+ -+bool -+mips_use_ins_ext_p (rtx op, rtx size, rtx position) -+{ -+ HOST_WIDE_INT len, pos; -+ -+ if (!ISA_HAS_EXT_INS -+ || !register_operand (op, VOIDmode) -+ || GET_MODE_BITSIZE (GET_MODE (op)) > BITS_PER_WORD) -+ return false; -+ -+ len = INTVAL (size); -+ pos = INTVAL (position); -+ -+ if (len <= 0 || len >= GET_MODE_BITSIZE (GET_MODE (op)) -+ || pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (op))) -+ return false; -+ -+ return true; -+} -+ - /* Set up globals to generate code for the ISA or processor - described by INFO. */ - -@@ -9498,6 +9550,67 @@ - DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE) - }; - -+/* Builtin functions for the Sony ALLEGREX processor. -+ -+ These have the `__builtin_allgrex_' prefix instead of `__builtin_mips_' -+ to maintain compatibility with Sony's ALLEGREX GCC port. -+ -+ Some of the builtins may seem redundant, but they are the same as the -+ builtins defined in the Sony compiler. I chose to map redundant and -+ trivial builtins to the original instruction instead of creating -+ duplicate patterns specifically for the ALLEGREX (as Sony does). */ -+ -+/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_allegrex_. -+ FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */ -+#define DIRECT_ALLEGREX_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Same as the above, but mapped to an instruction that doesn't share the -+ NAME. NAME is the name of the builtin without the builtin prefix. */ -+#define DIRECT_ALLEGREX_NAMED_BUILTIN(NAME, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_ ## INSN, 0, "__builtin_allegrex_" #NAME, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction -+ CODE_FOR_allegrex_. FUNCTION_TYPE and TARGET_FLAGS are -+ builtin_description fields. */ -+#define DIRECT_ALLEGREX_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a builtin with a specific function TYPE. */ -+#define SPECIAL_ALLEGREX_BUILTIN(TYPE, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_ ## TYPE, FUNCTION_TYPE, TARGET_FLAGS } -+ -+static const struct builtin_description allegrex_bdesc[] = -+{ -+ DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbh, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbw, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seb, extendqisi2, MIPS_SI_FTYPE_QI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seh, extendhisi2, MIPS_SI_FTYPE_HI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(max, smaxsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(min, sminsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NO_TARGET_BUILTIN(sync, MIPS_VOID_FTYPE_VOID, 0), -+ SPECIAL_ALLEGREX_BUILTIN(CACHE, cache, MIPS_VOID_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(sqrt_s, sqrtsf2, MIPS_SF_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(ceil_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(floor_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(round_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(trunc_w_s, fix_truncsfsi2_insn, MIPS_SI_FTYPE_SF, 0) -+}; -+ - /* This helps provide a mapping from builtin function codes to bdesc - arrays. */ - -@@ -9517,7 +9630,8 @@ - static const struct bdesc_map bdesc_arrays[] = - { - { mips_bdesc, ARRAY_SIZE (mips_bdesc), PROCESSOR_DEFAULT }, -- { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 } -+ { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 }, -+ { allegrex_bdesc, ARRAY_SIZE (allegrex_bdesc), PROCESSOR_ALLEGREX } - }; - - /* Take the head of argument list *ARGLIST and convert it into a form -@@ -9534,7 +9648,15 @@ - value = expand_expr (TREE_VALUE (*arglist), NULL_RTX, VOIDmode, 0); - mode = insn_data[icode].operand[op].mode; - if (!insn_data[icode].operand[op].predicate (value, mode)) -+ { - value = copy_to_mode_reg (mode, value); -+ /* Check the predicate again. */ -+ if (!insn_data[icode].operand[op].predicate (value, mode)) -+ { -+ error ("invalid argument to builtin function"); -+ return const0_rtx; -+ } -+ } - - *arglist = TREE_CHAIN (*arglist); - return value; -@@ -9591,7 +9713,10 @@ - switch (type) - { - case MIPS_BUILTIN_DIRECT: -- return mips_expand_builtin_direct (icode, target, arglist); -+ return mips_expand_builtin_direct (icode, target, arglist, true); -+ -+ case MIPS_BUILTIN_DIRECT_NO_TARGET: -+ return mips_expand_builtin_direct (icode, target, arglist, false); - - case MIPS_BUILTIN_MOVT: - case MIPS_BUILTIN_MOVF: -@@ -9606,6 +9731,9 @@ - return mips_expand_builtin_compare (type, icode, bdesc[fcode].cond, - target, arglist); - -+ case MIPS_BUILTIN_CACHE: -+ return mips_expand_builtin_cache (icode, target, arglist); -+ - default: - return 0; - } -@@ -9622,10 +9750,12 @@ - tree V2SF_type_node; - unsigned int offset; - -- /* We have only builtins for -mpaired-single and -mips3d. */ -- if (!TARGET_PAIRED_SINGLE_FLOAT) -+ /* We have only builtins for -mpaired-single, -mips3d, and the Sony ALLEGREX. */ -+ if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_ALLEGREX) - return; - -+ if (TARGET_PAIRED_SINGLE_FLOAT) -+ { - V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode); - - types[MIPS_V2SF_FTYPE_V2SF] -@@ -9684,6 +9814,45 @@ - types[MIPS_DF_FTYPE_DF_DF] - = build_function_type_list (double_type_node, - double_type_node, double_type_node, NULL_TREE); -+ } -+ -+ if (TARGET_ALLEGREX) -+ { -+ types[MIPS_SI_FTYPE_QI] -+ = build_function_type_list (intSI_type_node, -+ intQI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_HI] -+ = build_function_type_list (intSI_type_node, -+ intHI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_VOID] -+ = build_function_type_list (void_type_node, void_type_node, NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_SI_SI] -+ = build_function_type_list (void_type_node, -+ intSI_type_node, intSI_type_node, NULL_TREE); -+ -+ types[MIPS_SF_FTYPE_SF] -+ = build_function_type_list (float_type_node, -+ float_type_node, NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SF] -+ = build_function_type_list (intSI_type_node, -+ float_type_node, NULL_TREE); -+ } - - /* Iterate through all of the bdesc arrays, initializing all of the - builtin functions. */ -@@ -9703,30 +9872,44 @@ - - /* Expand a MIPS_BUILTIN_DIRECT function. ICODE is the code of the - .md pattern and ARGLIST is the list of function arguments. TARGET, -- if nonnull, suggests a good place to put the result. */ -+ if nonnull, suggests a good place to put the result. -+ HAS_TARGET indicates the function must return something. */ - - static rtx --mips_expand_builtin_direct (enum insn_code icode, rtx target, tree arglist) -+mips_expand_builtin_direct (enum insn_code icode, rtx target, tree arglist, -+ bool has_target) - { - rtx ops[MAX_RECOG_OPERANDS]; -- int i; -+ int i = 0; - -- target = mips_prepare_builtin_target (icode, 0, target); -- for (i = 1; i < insn_data[icode].n_operands; i++) -+ if (has_target) -+ { -+ /* We save target to ops[0]. */ -+ ops[0] = mips_prepare_builtin_target (icode, 0, target); -+ i = 1; -+ } -+ -+ /* We need to test if arglist is not zero. Some instructions have extra -+ clobber registers. */ -+ for (; i < insn_data[icode].n_operands && arglist != 0; i++) - ops[i] = mips_prepare_builtin_arg (icode, i, &arglist); - -- switch (insn_data[icode].n_operands) -+ switch (i) - { -+ case 0: -+ emit_insn (GEN_FCN (icode) (0)); -+ break; -+ - case 2: -- emit_insn (GEN_FCN (icode) (target, ops[1])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1])); - break; - - case 3: -- emit_insn (GEN_FCN (icode) (target, ops[1], ops[2])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2])); - break; - - case 4: -- emit_insn (GEN_FCN (icode) (target, ops[1], ops[2], ops[3])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3])); - break; - - default: -@@ -9857,4 +10040,26 @@ - return target; - } - -+/* Expand a __builtin_allegrex_cache() function. Make sure the passed -+ cache function code is less than 32. */ -+ -+static rtx -+mips_expand_builtin_cache (enum insn_code icode, rtx target, tree arglist) -+{ -+ rtx op0, op1; -+ -+ op0 = mips_prepare_builtin_arg (icode, 0, &arglist); -+ op1 = mips_prepare_builtin_arg (icode, 1, &arglist); -+ -+ if (GET_CODE (op0) == CONST_INT) -+ if (INTVAL (op0) < 0 || INTVAL (op0) > 0x1f) -+ { -+ error ("invalid function code '%d'", INTVAL (op0)); -+ return const0_rtx; -+ } -+ -+ emit_insn (GEN_FCN (icode) (op0, op1)); -+ return target; -+} -+ - #include "gt-mips.h" ---- gcc-4.0.1.orig/gcc/config/mips/mips.h 2005-04-15 00:00:18.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.h 2005-08-25 20:24:02.000000000 -0700 -@@ -59,7 +59,8 @@ - PROCESSOR_R8000, - PROCESSOR_R9000, - PROCESSOR_SB1, -- PROCESSOR_SR71000 -+ PROCESSOR_SR71000, -+ PROCESSOR_ALLEGREX - }; - - /* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32), -@@ -308,6 +309,7 @@ - #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000) - #define TARGET_SB1 (mips_arch == PROCESSOR_SB1) - #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) -+#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX) - - /* Scheduling target defines. */ - #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000) -@@ -322,6 +324,7 @@ - #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000) - #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000) - #define TUNE_SB1 (mips_tune == PROCESSOR_SB1) -+#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) - - /* True if the pre-reload scheduler should try to create chains of - multiply-add or multiply-subtract instructions. For example, -@@ -873,6 +876,9 @@ - && !TARGET_MIPS5500 \ - && !TARGET_MIPS16) - -+/* ISA has just the integer condition move instructions (movn,movz) */ -+#define ISA_HAS_INT_CONDMOVE (TARGET_ALLEGREX) -+ - /* ISA has the mips4 FP condition code instructions: FP-compare to CC, - branch on CC, and move (both FP and non-FP) on CC. */ - #define ISA_HAS_8CC (ISA_MIPS4 \ -@@ -889,7 +895,8 @@ - - /* ISA has conditional trap instructions. */ - #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ -- && !TARGET_MIPS16) -+ && !TARGET_MIPS16 \ -+ && !TARGET_ALLEGREX) - - /* ISA has integer multiply-accumulate instructions, madd and msub. */ - #define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ -@@ -907,6 +914,7 @@ - #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -+ || TARGET_ALLEGREX \ - ) && !TARGET_MIPS16) - - /* ISA has double-word count leading zeroes/ones instruction (not -@@ -954,6 +962,7 @@ - || TARGET_MIPS5400 \ - || TARGET_MIPS5500 \ - || TARGET_SR71K \ -+ || TARGET_ALLEGREX \ - )) - - /* ISA has 64-bit rotate right instruction. */ -@@ -987,6 +996,13 @@ - /* ISA includes the MIPS32r2 seb and seh instructions. */ - #define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \ - && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ -+ )) -+ -+/* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ -+#define ISA_HAS_EXT_INS (!TARGET_MIPS16 \ -+ && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - )) - - /* True if the result of a load is not available to the next instruction. -@@ -1017,7 +1033,8 @@ - #define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -- || TARGET_MIPS5500) -+ || TARGET_MIPS5500 \ -+ || TARGET_ALLEGREX) - - /* Add -G xx support. */ - -@@ -1427,6 +1444,11 @@ - /* Define if loading short immediate values into registers sign extends. */ - #define SHORT_IMMEDIATES_SIGN_EXTEND - -+/* The [d]clz instructions have the natural values at 0. */ -+ -+#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ -+ ((VALUE) = GET_MODE_BITSIZE (MODE), true) -+ - /* Standard register usage. */ - - /* Number of hardware registers. We have: ---- gcc-4.0.1.orig/gcc/config/mips/psp.h 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/psp.h 2005-07-12 03:05:10.000000000 -0700 -@@ -0,0 +1,31 @@ -+/* Support for Sony's Playstation Portable (PSP). -+ Copyright (C) 2005 Free Software Foundation, Inc. -+ Contributed by Marcus R. Brown -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+/* Override the startfile spec to include crt0.o. */ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" -+ -+#undef SUBTARGET_CPP_SPEC -+#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1" -+ -+/* Get rid of the .pdr section. */ -+#undef SUBTARGET_ASM_SPEC -+#define SUBTARGET_ASM_SPEC "-mno-pdr" ---- gcc-4.0.1.orig/gcc/config/mips/mips-protos.h 2004-12-29 19:07:56.000000000 -0800 -+++ gcc-psp/gcc/config/mips/mips-protos.h 2005-08-23 23:52:02.000000000 -0700 -@@ -205,5 +205,6 @@ - extern void irix_asm_output_align (FILE *, unsigned); - extern const char *current_section_name (void); - extern unsigned int current_section_flags (void); -+extern bool mips_use_ins_ext_p (rtx, rtx, rtx); - - #endif /* ! GCC_MIPS_PROTOS_H */ ---- gcc-4.0.1.orig/gcc/config/mips/allegrex.md 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/allegrex.md 2005-08-26 18:56:28.162421208 -0700 -@@ -0,0 +1,183 @@ -+;; Sony ALLEGREX instructions. -+;; Copyright (C) 2005 Free Software Foundation, Inc. -+;; -+;; This file is part of GCC. -+;; -+;; GCC is free software; you can redistribute it and/or modify -+;; it under the terms of the GNU General Public License as published by -+;; the Free Software Foundation; either version 2, or (at your option) -+;; any later version. -+;; -+;; GCC is distributed in the hope that it will be useful, -+;; but WITHOUT ANY WARRANTY; without even the implied warranty of -+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+;; GNU General Public License for more details. -+;; -+;; You should have received a copy of the GNU General Public License -+;; along with GCC; see the file COPYING. If not, write to -+;; the Free Software Foundation, 59 Temple Place - Suite 330, -+;; Boston, MA 02111-1307, USA. -+ -+; Multiply Add and Subtract. -+ -+(define_insn "allegrex_madd" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")) -+ (match_dup 0))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "madd\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_msub" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (minus:SI (match_dup 0) -+ (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "msub\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+ -+; Min and max. -+ -+(define_insn "sminsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smin:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "min\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "smaxsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smax:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "max\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Extended shift instructions. -+ -+(define_insn "allegrex_bitrev" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_BITREV))] -+ "TARGET_ALLEGREX" -+ "bitrev\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbh" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBH))] -+ "TARGET_ALLEGREX" -+ "wsbh\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbw" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBW))] -+ "TARGET_ALLEGREX" -+ "wsbw\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Count leading ones, count trailing zeros, and count trailing ones (clz is -+; already defined). -+ -+(define_insn "allegrex_clo" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CLO))] -+ "TARGET_ALLEGREX" -+ "clo\t%0,%1" -+ [(set_attr "type" "clz") -+ (set_attr "mode" "SI")]) -+ -+(define_expand "ctzsi2" -+ [(set (match_operand:SI 0 "register_operand") -+ (ctz:SI (match_operand:SI 1 "register_operand")))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_clzsi2 (operands[0], r1)); -+ DONE; -+}) -+ -+(define_expand "allegrex_cto" -+ [(set (match_operand:SI 0 "register_operand") -+ (unspec:SI [(match_operand:SI 1 "register_operand")] -+ UNSPEC_CTO))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_allegrex_clo (operands[0], r1)); -+ DONE; -+}) -+ -+ -+; Misc. -+ -+(define_insn "allegrex_sync" -+ [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)] -+ "TARGET_ALLEGREX" -+ "sync" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+(define_insn "allegrex_cache" -+ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "") -+ (match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CACHE)] -+ "TARGET_ALLEGREX" -+ "cache\t%0,0(%1)" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+ -+; Floating-point builtins. -+ -+(define_insn "allegrex_ceil_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_CEIL_W_S))] -+ "TARGET_ALLEGREX" -+ "ceil.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_floor_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_FLOOR_W_S))] -+ "TARGET_ALLEGREX" -+ "floor.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_round_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_ROUND_W_S))] -+ "TARGET_ALLEGREX" -+ "round.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) ---- gcc-4.0.1.orig/gcc/version.c 2005-07-07 11:41:54.000000000 -0700 -+++ gcc-psp/gcc/version.c 2005-08-26 23:16:06.058221080 -0700 -@@ -5,7 +5,7 @@ - please modify this string to indicate that, e.g. by putting your - organization's name in parentheses at the end of the string. */ - --const char version_string[] = "4.0.1"; -+const char version_string[] = "4.0.1 (PSPDEV 20050827)"; - - /* This is the location of the online document giving instructions for - reporting bugs. If you distribute a modified version of GCC, -@@ -14,4 +14,4 @@ - forward us bugs reported to you, if you determine that they are - not bugs in your modifications.) */ - --const char bug_report_url[] = ""; -+const char bug_report_url[] = ""; ---- gcc-4.0.1.orig/gcc/config.gcc 2005-05-05 13:11:50.000000000 -0700 -+++ gcc-psp/gcc/config.gcc 2005-07-22 17:40:41.000000000 -0700 -@@ -1520,6 +1520,18 @@ - tmake_file=mips/t-r3900 - use_fixproto=yes - ;; -+mipsallegrex-*-elf* | mipsallegrexel-*-elf*) -+ tm_file="elfos.h ${tm_file} mips/elf.h" -+ tmake_file=mips/t-allegrex -+ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" -+ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" -+ case ${target} in -+ mipsallegrex*-psp-elf*) -+ tm_file="${tm_file} mips/psp.h" -+ ;; -+ esac -+ use_fixproto=yes -+ ;; - mmix-knuth-mmixware) - need_64bit_hwint=yes - ;; ---- gcc-4.0.1.orig/gcc/hwint.h 2004-11-23 20:31:57.000000000 -0800 -+++ gcc-psp/gcc/hwint.h 2005-07-22 21:50:31.000000000 -0700 -@@ -80,7 +80,7 @@ - # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx" - # endif - #else --# define HOST_WIDE_INT_PRINT "ll" -+# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT - # define HOST_WIDE_INT_PRINT_C "LL" - /* We can assume that 'long long' is at least 64 bits. */ - # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ ---- gcc-4.0.1.orig/gcc/c-incpath.c 2005-01-23 07:05:27.000000000 -0800 -+++ gcc-psp/gcc/c-incpath.c 2005-07-22 21:49:25.000000000 -0700 -@@ -331,13 +331,18 @@ - cpp_dir *p; - - #if defined (HAVE_DOS_BASED_FILE_SYSTEM) -- /* Convert all backslashes to slashes. The native CRT stat() -- function does not recognize a directory that ends in a backslash -- (unless it is a drive root dir, such "c:\"). Forward slashes, -- trailing or otherwise, cause no problems for stat(). */ -- char* c; -- for (c = path; *c; c++) -- if (*c == '\\') *c = '/'; -+ /* Remove unnecessary trailing slashes. On some versions of MS -+ Windows, trailing _forward_ slashes cause no problems for stat(). -+ On newer versions, stat() does not recognise a directory that ends -+ in a '\\' or '/', unless it is a drive root dir, such as "c:/", -+ where it is obligatory. */ -+ int pathlen = strlen (path); -+ char* end = path + pathlen - 1; -+ /* Preserve the lead '/' or lead "c:/". */ -+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); -+ -+ for (; end > start && IS_DIR_SEPARATOR (*end); end--) -+ *end = 0; - #endif - - p = xmalloc (sizeof (cpp_dir)); diff --git a/dkpsp/patches/gcc-4.0.2.patch b/dkpsp/patches/gcc-4.0.2.patch deleted file mode 100644 index 2d1b7a7..0000000 --- a/dkpsp/patches/gcc-4.0.2.patch +++ /dev/null @@ -1,1092 +0,0 @@ ---- gcc-4.0.2.orig/config.sub 2005-04-25 03:36:56.000000000 -0700 -+++ gcc-psp/config.sub 2005-07-22 17:40:49.000000000 -0700 -@@ -254,6 +254,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ -@@ -328,6 +329,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ -@@ -668,6 +670,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; ---- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 07:05:27.000000000 -0800 -+++ gcc-psp/gcc/c-incpath.c 2005-07-22 21:49:25.000000000 -0700 -@@ -331,13 +331,18 @@ - cpp_dir *p; - - #if defined (HAVE_DOS_BASED_FILE_SYSTEM) -- /* Convert all backslashes to slashes. The native CRT stat() -- function does not recognize a directory that ends in a backslash -- (unless it is a drive root dir, such "c:\"). Forward slashes, -- trailing or otherwise, cause no problems for stat(). */ -- char* c; -- for (c = path; *c; c++) -- if (*c == '\\') *c = '/'; -+ /* Remove unnecessary trailing slashes. On some versions of MS -+ Windows, trailing _forward_ slashes cause no problems for stat(). -+ On newer versions, stat() does not recognise a directory that ends -+ in a '\\' or '/', unless it is a drive root dir, such as "c:/", -+ where it is obligatory. */ -+ int pathlen = strlen (path); -+ char* end = path + pathlen - 1; -+ /* Preserve the lead '/' or lead "c:/". */ -+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); -+ -+ for (; end > start && IS_DIR_SEPARATOR (*end); end--) -+ *end = 0; - #endif - - p = xmalloc (sizeof (cpp_dir)); ---- gcc-4.0.2.orig/gcc/config.gcc 2005-10-22 14:38:16.000000000 -0700 -+++ gcc-psp/gcc/config.gcc 2005-07-22 17:40:41.000000000 -0700 -@@ -406,12 +406,6 @@ - tm_defines="${tm_defines} FBSD_MAJOR=5" ;; - *-*-freebsd6 | *-*-freebsd[6].*) - tm_defines="${tm_defines} FBSD_MAJOR=6" ;; -- *-*-freebsd7 | *-*-freebsd[7].*) -- tm_defines="${tm_defines} FBSD_MAJOR=7" ;; -- *-*-freebsd8 | *-*-freebsd[8].*) -- tm_defines="${tm_defines} FBSD_MAJOR=8" ;; -- *-*-freebsd9 | *-*-freebsd[9].*) -- tm_defines="${tm_defines} FBSD_MAJOR=9" ;; - *) - echo 'Please update *-*-freebsd* in gcc/config.gcc' - exit 1 -@@ -740,11 +734,6 @@ - tmake_file=bfin/t-bfin-elf - use_collect2=no - ;; --bfin*-uclinux*) -- tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/uclinux.h" -- tmake_file=bfin/t-bfin-elf -- use_collect2=no -- ;; - bfin*-*) - tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" - tmake_file=bfin/t-bfin -@@ -1531,6 +1520,18 @@ - tmake_file=mips/t-r3900 - use_fixproto=yes - ;; -+mipsallegrex-*-elf* | mipsallegrexel-*-elf*) -+ tm_file="elfos.h ${tm_file} mips/elf.h" -+ tmake_file=mips/t-allegrex -+ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" -+ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" -+ case ${target} in -+ mipsallegrex*-psp-elf*) -+ tm_file="${tm_file} mips/psp.h" -+ ;; -+ esac -+ use_fixproto=yes -+ ;; - mmix-knuth-mmixware) - need_64bit_hwint=yes - ;; ---- gcc-4.0.2.orig/gcc/config/mips/allegrex.md 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/allegrex.md 2005-08-28 09:29:14.000000000 -0700 -@@ -0,0 +1,183 @@ -+;; Sony ALLEGREX instructions. -+;; Copyright (C) 2005 Free Software Foundation, Inc. -+;; -+;; This file is part of GCC. -+;; -+;; GCC is free software; you can redistribute it and/or modify -+;; it under the terms of the GNU General Public License as published by -+;; the Free Software Foundation; either version 2, or (at your option) -+;; any later version. -+;; -+;; GCC is distributed in the hope that it will be useful, -+;; but WITHOUT ANY WARRANTY; without even the implied warranty of -+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+;; GNU General Public License for more details. -+;; -+;; You should have received a copy of the GNU General Public License -+;; along with GCC; see the file COPYING. If not, write to -+;; the Free Software Foundation, 59 Temple Place - Suite 330, -+;; Boston, MA 02111-1307, USA. -+ -+; Multiply Add and Subtract. -+ -+(define_insn "allegrex_madd" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")) -+ (match_dup 0))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "madd\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_msub" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (minus:SI (match_dup 0) -+ (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "msub\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+ -+; Min and max. -+ -+(define_insn "sminsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smin:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "min\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "smaxsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smax:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "max\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Extended shift instructions. -+ -+(define_insn "allegrex_bitrev" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_BITREV))] -+ "TARGET_ALLEGREX" -+ "bitrev\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbh" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBH))] -+ "TARGET_ALLEGREX" -+ "wsbh\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbw" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBW))] -+ "TARGET_ALLEGREX" -+ "wsbw\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Count leading ones, count trailing zeros, and count trailing ones (clz is -+; already defined). -+ -+(define_insn "allegrex_clo" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CLO))] -+ "TARGET_ALLEGREX" -+ "clo\t%0,%1" -+ [(set_attr "type" "clz") -+ (set_attr "mode" "SI")]) -+ -+(define_expand "ctzsi2" -+ [(set (match_operand:SI 0 "register_operand") -+ (ctz:SI (match_operand:SI 1 "register_operand")))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_clzsi2 (operands[0], r1)); -+ DONE; -+}) -+ -+(define_expand "allegrex_cto" -+ [(set (match_operand:SI 0 "register_operand") -+ (unspec:SI [(match_operand:SI 1 "register_operand")] -+ UNSPEC_CTO))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_allegrex_clo (operands[0], r1)); -+ DONE; -+}) -+ -+ -+; Misc. -+ -+(define_insn "allegrex_sync" -+ [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)] -+ "TARGET_ALLEGREX" -+ "sync" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+(define_insn "allegrex_cache" -+ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "") -+ (match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CACHE)] -+ "TARGET_ALLEGREX" -+ "cache\t%0,0(%1)" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+ -+; Floating-point builtins. -+ -+(define_insn "allegrex_ceil_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_CEIL_W_S))] -+ "TARGET_ALLEGREX" -+ "ceil.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_floor_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_FLOOR_W_S))] -+ "TARGET_ALLEGREX" -+ "floor.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_round_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_ROUND_W_S))] -+ "TARGET_ALLEGREX" -+ "round.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) ---- gcc-4.0.2.orig/gcc/config/mips/mips-protos.h 2004-12-29 19:07:56.000000000 -0800 -+++ gcc-psp/gcc/config/mips/mips-protos.h 2005-08-23 23:52:02.000000000 -0700 -@@ -205,5 +205,6 @@ - extern void irix_asm_output_align (FILE *, unsigned); - extern const char *current_section_name (void); - extern unsigned int current_section_flags (void); -+extern bool mips_use_ins_ext_p (rtx, rtx, rtx); - - #endif /* ! GCC_MIPS_PROTOS_H */ ---- gcc-4.0.2.orig/gcc/config/mips/mips.c 2005-05-08 04:56:53.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.c 2005-08-26 18:56:46.000000000 -0700 -@@ -150,6 +150,15 @@ - MIPS_DF_FTYPE_DF, - MIPS_DF_FTYPE_DF_DF, - -+ /* For the Sony ALLEGREX. */ -+ MIPS_SI_FTYPE_QI, -+ MIPS_SI_FTYPE_HI, -+ MIPS_SI_FTYPE_SI, -+ MIPS_SI_FTYPE_SI_SI, -+ MIPS_VOID_FTYPE_VOID, -+ MIPS_VOID_FTYPE_SI_SI, -+ MIPS_SI_FTYPE_SF, -+ - /* The last type. */ - MIPS_MAX_FTYPE_MAX - }; -@@ -162,6 +171,10 @@ - operands 1 and above. */ - MIPS_BUILTIN_DIRECT, - -+ /* The builtin corresponds directly to an .md pattern. There is no return -+ value and the arguments are mapped to operands 0 and above. */ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, -+ - /* The builtin corresponds to a comparison instruction followed by - a mips_cond_move_tf_ps pattern. The first two arguments are the - values to compare and the second two arguments are the vector -@@ -185,7 +198,12 @@ - MIPS_BUILTIN_CMP_LOWER, - - /* As above, but the instruction only sets a single $fcc register. */ -- MIPS_BUILTIN_CMP_SINGLE -+ MIPS_BUILTIN_CMP_SINGLE, -+ -+ /* The builtin corresponds to the ALLEGREX cache instruction. Operand 0 -+ is the function code (must be less than 32) and operand 1 is the base -+ address. */ -+ MIPS_BUILTIN_CACHE - }; - - /* Invokes MACRO (COND) for each c.cond.fmt condition. */ -@@ -361,13 +379,14 @@ - static rtx mips_prepare_builtin_target (enum insn_code, unsigned int, rtx); - static rtx mips_expand_builtin (tree, rtx, rtx, enum machine_mode, int); - static void mips_init_builtins (void); --static rtx mips_expand_builtin_direct (enum insn_code, rtx, tree); -+static rtx mips_expand_builtin_direct (enum insn_code, rtx, tree, bool); - static rtx mips_expand_builtin_movtf (enum mips_builtin_type, - enum insn_code, enum mips_fp_condition, - rtx, tree); - static rtx mips_expand_builtin_compare (enum mips_builtin_type, - enum insn_code, enum mips_fp_condition, - rtx, tree); -+static rtx mips_expand_builtin_cache (enum insn_code icode, rtx, tree); - - /* Structure to be filled in by compute_frame_size with register - save masks, and offsets for the current function. */ -@@ -673,6 +692,7 @@ - - /* MIPS II */ - { "r6000", PROCESSOR_R6000, 2 }, -+ { "allegrex", PROCESSOR_ALLEGREX, 2 }, - - /* MIPS III */ - { "r4000", PROCESSOR_R4000, 3 }, -@@ -3969,6 +3989,38 @@ - return true; - } - -+/* Return true if (zero_extract OP SIZE POSITION) can be used as the -+ source of an "ext" instruction or the destination of an "ins" -+ instruction. OP must be a register operand and the following -+ conditions must hold: -+ -+ 0 <= POSITION < GET_MODE_BITSIZE (GET_MODE (op)) -+ 0 < SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) -+ 0 < POSITION + SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) -+ -+ Also reject lengths equal to a word as they are better handled -+ by the move patterns. */ -+ -+bool -+mips_use_ins_ext_p (rtx op, rtx size, rtx position) -+{ -+ HOST_WIDE_INT len, pos; -+ -+ if (!ISA_HAS_EXT_INS -+ || !register_operand (op, VOIDmode) -+ || GET_MODE_BITSIZE (GET_MODE (op)) > BITS_PER_WORD) -+ return false; -+ -+ len = INTVAL (size); -+ pos = INTVAL (position); -+ -+ if (len <= 0 || len >= GET_MODE_BITSIZE (GET_MODE (op)) -+ || pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (op))) -+ return false; -+ -+ return true; -+} -+ - /* Set up globals to generate code for the ISA or processor - described by INFO. */ - -@@ -9498,6 +9550,67 @@ - DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE) - }; - -+/* Builtin functions for the Sony ALLEGREX processor. -+ -+ These have the `__builtin_allgrex_' prefix instead of `__builtin_mips_' -+ to maintain compatibility with Sony's ALLEGREX GCC port. -+ -+ Some of the builtins may seem redundant, but they are the same as the -+ builtins defined in the Sony compiler. I chose to map redundant and -+ trivial builtins to the original instruction instead of creating -+ duplicate patterns specifically for the ALLEGREX (as Sony does). */ -+ -+/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_allegrex_. -+ FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */ -+#define DIRECT_ALLEGREX_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Same as the above, but mapped to an instruction that doesn't share the -+ NAME. NAME is the name of the builtin without the builtin prefix. */ -+#define DIRECT_ALLEGREX_NAMED_BUILTIN(NAME, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_ ## INSN, 0, "__builtin_allegrex_" #NAME, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction -+ CODE_FOR_allegrex_. FUNCTION_TYPE and TARGET_FLAGS are -+ builtin_description fields. */ -+#define DIRECT_ALLEGREX_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a builtin with a specific function TYPE. */ -+#define SPECIAL_ALLEGREX_BUILTIN(TYPE, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_ ## TYPE, FUNCTION_TYPE, TARGET_FLAGS } -+ -+static const struct builtin_description allegrex_bdesc[] = -+{ -+ DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbh, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbw, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seb, extendqisi2, MIPS_SI_FTYPE_QI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seh, extendhisi2, MIPS_SI_FTYPE_HI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(max, smaxsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(min, sminsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NO_TARGET_BUILTIN(sync, MIPS_VOID_FTYPE_VOID, 0), -+ SPECIAL_ALLEGREX_BUILTIN(CACHE, cache, MIPS_VOID_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(sqrt_s, sqrtsf2, MIPS_SF_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(ceil_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(floor_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(round_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(trunc_w_s, fix_truncsfsi2_insn, MIPS_SI_FTYPE_SF, 0) -+}; -+ - /* This helps provide a mapping from builtin function codes to bdesc - arrays. */ - -@@ -9517,7 +9630,8 @@ - static const struct bdesc_map bdesc_arrays[] = - { - { mips_bdesc, ARRAY_SIZE (mips_bdesc), PROCESSOR_DEFAULT }, -- { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 } -+ { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 }, -+ { allegrex_bdesc, ARRAY_SIZE (allegrex_bdesc), PROCESSOR_ALLEGREX } - }; - - /* Take the head of argument list *ARGLIST and convert it into a form -@@ -9534,7 +9648,15 @@ - value = expand_expr (TREE_VALUE (*arglist), NULL_RTX, VOIDmode, 0); - mode = insn_data[icode].operand[op].mode; - if (!insn_data[icode].operand[op].predicate (value, mode)) -+ { - value = copy_to_mode_reg (mode, value); -+ /* Check the predicate again. */ -+ if (!insn_data[icode].operand[op].predicate (value, mode)) -+ { -+ error ("invalid argument to builtin function"); -+ return const0_rtx; -+ } -+ } - - *arglist = TREE_CHAIN (*arglist); - return value; -@@ -9591,7 +9713,10 @@ - switch (type) - { - case MIPS_BUILTIN_DIRECT: -- return mips_expand_builtin_direct (icode, target, arglist); -+ return mips_expand_builtin_direct (icode, target, arglist, true); -+ -+ case MIPS_BUILTIN_DIRECT_NO_TARGET: -+ return mips_expand_builtin_direct (icode, target, arglist, false); - - case MIPS_BUILTIN_MOVT: - case MIPS_BUILTIN_MOVF: -@@ -9606,6 +9731,9 @@ - return mips_expand_builtin_compare (type, icode, bdesc[fcode].cond, - target, arglist); - -+ case MIPS_BUILTIN_CACHE: -+ return mips_expand_builtin_cache (icode, target, arglist); -+ - default: - return 0; - } -@@ -9622,10 +9750,12 @@ - tree V2SF_type_node; - unsigned int offset; - -- /* We have only builtins for -mpaired-single and -mips3d. */ -- if (!TARGET_PAIRED_SINGLE_FLOAT) -+ /* We have only builtins for -mpaired-single, -mips3d, and the Sony ALLEGREX. */ -+ if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_ALLEGREX) - return; - -+ if (TARGET_PAIRED_SINGLE_FLOAT) -+ { - V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode); - - types[MIPS_V2SF_FTYPE_V2SF] -@@ -9684,6 +9814,45 @@ - types[MIPS_DF_FTYPE_DF_DF] - = build_function_type_list (double_type_node, - double_type_node, double_type_node, NULL_TREE); -+ } -+ -+ if (TARGET_ALLEGREX) -+ { -+ types[MIPS_SI_FTYPE_QI] -+ = build_function_type_list (intSI_type_node, -+ intQI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_HI] -+ = build_function_type_list (intSI_type_node, -+ intHI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_VOID] -+ = build_function_type_list (void_type_node, void_type_node, NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_SI_SI] -+ = build_function_type_list (void_type_node, -+ intSI_type_node, intSI_type_node, NULL_TREE); -+ -+ types[MIPS_SF_FTYPE_SF] -+ = build_function_type_list (float_type_node, -+ float_type_node, NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SF] -+ = build_function_type_list (intSI_type_node, -+ float_type_node, NULL_TREE); -+ } - - /* Iterate through all of the bdesc arrays, initializing all of the - builtin functions. */ -@@ -9703,30 +9872,44 @@ - - /* Expand a MIPS_BUILTIN_DIRECT function. ICODE is the code of the - .md pattern and ARGLIST is the list of function arguments. TARGET, -- if nonnull, suggests a good place to put the result. */ -+ if nonnull, suggests a good place to put the result. -+ HAS_TARGET indicates the function must return something. */ - - static rtx --mips_expand_builtin_direct (enum insn_code icode, rtx target, tree arglist) -+mips_expand_builtin_direct (enum insn_code icode, rtx target, tree arglist, -+ bool has_target) - { - rtx ops[MAX_RECOG_OPERANDS]; -- int i; -+ int i = 0; - -- target = mips_prepare_builtin_target (icode, 0, target); -- for (i = 1; i < insn_data[icode].n_operands; i++) -+ if (has_target) -+ { -+ /* We save target to ops[0]. */ -+ ops[0] = mips_prepare_builtin_target (icode, 0, target); -+ i = 1; -+ } -+ -+ /* We need to test if arglist is not zero. Some instructions have extra -+ clobber registers. */ -+ for (; i < insn_data[icode].n_operands && arglist != 0; i++) - ops[i] = mips_prepare_builtin_arg (icode, i, &arglist); - -- switch (insn_data[icode].n_operands) -+ switch (i) - { -+ case 0: -+ emit_insn (GEN_FCN (icode) (0)); -+ break; -+ - case 2: -- emit_insn (GEN_FCN (icode) (target, ops[1])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1])); - break; - - case 3: -- emit_insn (GEN_FCN (icode) (target, ops[1], ops[2])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2])); - break; - - case 4: -- emit_insn (GEN_FCN (icode) (target, ops[1], ops[2], ops[3])); -+ emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3])); - break; - - default: -@@ -9857,4 +10040,26 @@ - return target; - } - -+/* Expand a __builtin_allegrex_cache() function. Make sure the passed -+ cache function code is less than 32. */ -+ -+static rtx -+mips_expand_builtin_cache (enum insn_code icode, rtx target, tree arglist) -+{ -+ rtx op0, op1; -+ -+ op0 = mips_prepare_builtin_arg (icode, 0, &arglist); -+ op1 = mips_prepare_builtin_arg (icode, 1, &arglist); -+ -+ if (GET_CODE (op0) == CONST_INT) -+ if (INTVAL (op0) < 0 || INTVAL (op0) > 0x1f) -+ { -+ error ("invalid function code '%d'", INTVAL (op0)); -+ return const0_rtx; -+ } -+ -+ emit_insn (GEN_FCN (icode) (op0, op1)); -+ return target; -+} -+ - #include "gt-mips.h" ---- gcc-4.0.2.orig/gcc/config/mips/mips.h 2005-04-15 00:00:18.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.h 2005-08-25 20:24:02.000000000 -0700 -@@ -59,7 +59,8 @@ - PROCESSOR_R8000, - PROCESSOR_R9000, - PROCESSOR_SB1, -- PROCESSOR_SR71000 -+ PROCESSOR_SR71000, -+ PROCESSOR_ALLEGREX - }; - - /* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32), -@@ -308,6 +309,7 @@ - #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000) - #define TARGET_SB1 (mips_arch == PROCESSOR_SB1) - #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) -+#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX) - - /* Scheduling target defines. */ - #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000) -@@ -322,6 +324,7 @@ - #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000) - #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000) - #define TUNE_SB1 (mips_tune == PROCESSOR_SB1) -+#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) - - /* True if the pre-reload scheduler should try to create chains of - multiply-add or multiply-subtract instructions. For example, -@@ -873,6 +876,9 @@ - && !TARGET_MIPS5500 \ - && !TARGET_MIPS16) - -+/* ISA has just the integer condition move instructions (movn,movz) */ -+#define ISA_HAS_INT_CONDMOVE (TARGET_ALLEGREX) -+ - /* ISA has the mips4 FP condition code instructions: FP-compare to CC, - branch on CC, and move (both FP and non-FP) on CC. */ - #define ISA_HAS_8CC (ISA_MIPS4 \ -@@ -889,7 +895,8 @@ - - /* ISA has conditional trap instructions. */ - #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ -- && !TARGET_MIPS16) -+ && !TARGET_MIPS16 \ -+ && !TARGET_ALLEGREX) - - /* ISA has integer multiply-accumulate instructions, madd and msub. */ - #define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ -@@ -907,6 +914,7 @@ - #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -+ || TARGET_ALLEGREX \ - ) && !TARGET_MIPS16) - - /* ISA has double-word count leading zeroes/ones instruction (not -@@ -954,6 +962,7 @@ - || TARGET_MIPS5400 \ - || TARGET_MIPS5500 \ - || TARGET_SR71K \ -+ || TARGET_ALLEGREX \ - )) - - /* ISA has 64-bit rotate right instruction. */ -@@ -987,6 +996,13 @@ - /* ISA includes the MIPS32r2 seb and seh instructions. */ - #define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \ - && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ -+ )) -+ -+/* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ -+#define ISA_HAS_EXT_INS (!TARGET_MIPS16 \ -+ && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - )) - - /* True if the result of a load is not available to the next instruction. -@@ -1017,7 +1033,8 @@ - #define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -- || TARGET_MIPS5500) -+ || TARGET_MIPS5500 \ -+ || TARGET_ALLEGREX) - - /* Add -G xx support. */ - -@@ -1427,6 +1444,11 @@ - /* Define if loading short immediate values into registers sign extends. */ - #define SHORT_IMMEDIATES_SIGN_EXTEND - -+/* The [d]clz instructions have the natural values at 0. */ -+ -+#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ -+ ((VALUE) = GET_MODE_BITSIZE (MODE), true) -+ - /* Standard register usage. */ - - /* Number of hardware registers. We have: ---- gcc-4.0.2.orig/gcc/config/mips/mips.md 2005-05-08 04:56:58.000000000 -0700 -+++ gcc-psp/gcc/config/mips/mips.md 2005-08-28 09:29:10.000000000 -0700 -@@ -70,6 +70,21 @@ - (UNSPEC_RSQRT2 209) - (UNSPEC_RECIP1 210) - (UNSPEC_RECIP2 211) -+ -+ ;; Sony ALLEGREX instructions -+ (UNSPEC_BITREV 400) -+ (UNSPEC_WSBH 401) -+ (UNSPEC_WSBW 402) -+ -+ (UNSPEC_CLO 403) -+ (UNSPEC_CTO 404) -+ -+ (UNSPEC_CACHE 405) -+ (UNSPEC_SYNC 406) -+ -+ (UNSPEC_CEIL_W_S 407) -+ (UNSPEC_FLOOR_W_S 408) -+ (UNSPEC_ROUND_W_S 409) - ] - ) - -@@ -1514,9 +1529,9 @@ - (mult:DI - (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] -- "!TARGET_64BIT && ISA_HAS_MSAC" -+ "!TARGET_64BIT && (ISA_HAS_MSAC || TARGET_ALLEGREX)" - { -- if (TARGET_MIPS5500) -+ if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "msub\t%1,%2"; - else - return "msac\t$0,%1,%2"; -@@ -1631,12 +1646,12 @@ - (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) - (match_operand:DI 3 "register_operand" "0")))] -- "(TARGET_MAD || ISA_HAS_MACC) -+ "(TARGET_MAD || ISA_HAS_MACC || TARGET_ALLEGREX) - && !TARGET_64BIT" - { - if (TARGET_MAD) - return "mad\t%1,%2"; -- else if (TARGET_MIPS5500) -+ else if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "madd\t%1,%2"; - else - /* See comment in *macc. */ -@@ -1911,36 +1926,24 @@ - ;; .................... - ;; - --(define_insn "ffs2" -- [(set (match_operand:GPR 0 "register_operand" "=&d") -- (ffs:GPR (match_operand:GPR 1 "register_operand" "d"))) -- (clobber (match_scratch:GPR 2 "=&d")) -- (clobber (match_scratch:GPR 3 "=&d"))] -- "!TARGET_MIPS16" -+(define_expand "ffs2" -+ [(set (match_operand:GPR 0 "register_operand" "") -+ (ffs:GPR (match_operand:GPR 1 "register_operand" "")))] -+ "ISA_HAS_CLZ_CLO" - { -- if (optimize && find_reg_note (insn, REG_DEAD, operands[1])) -- return "%(\ --move\t%0,%.\;\ --beq\t%1,%.,2f\n\ --%~1:\tand\t%2,%1,0x0001\;\ --addu\t%0,%0,1\;\ --beq\t%2,%.,1b\;\ --srl\t%1,%1,1\n\ --%~2:%)"; -- -- return "%(\ --move\t%0,%.\;\ --move\t%3,%1\;\ --beq\t%3,%.,2f\n\ --%~1:\tand\t%2,%3,0x0001\;\ --addu\t%0,%0,1\;\ --beq\t%2,%.,1b\;\ --srl\t%3,%3,1\n\ --%~2:%)"; --} -- [(set_attr "type" "multi") -- (set_attr "mode" "") -- (set_attr "length" "28")]) -+ rtx r1, r2, r3, r4; -+ -+ r1 = gen_reg_rtx (mode); -+ r2 = gen_reg_rtx (mode); -+ r3 = gen_reg_rtx (mode); -+ r4 = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (r1, operands[1])); -+ emit_insn (gen_and3 (r2, operands[1], r1)); -+ emit_insn (gen_clz2 (r3, r2)); -+ emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (mode))); -+ emit_insn (gen_sub3 (operands[0], r4, r3)); -+ DONE; -+}) - - ;; - ;; ................... -@@ -2790,7 +2793,7 @@ - - (define_expand "extzv" - [(set (match_operand 0 "register_operand") -- (zero_extract (match_operand:QI 1 "memory_operand") -+ (zero_extract (match_operand 1 "nonimmediate_operand") - (match_operand 2 "immediate_operand") - (match_operand 3 "immediate_operand")))] - "!TARGET_MIPS16" -@@ -2799,12 +2802,33 @@ - INTVAL (operands[2]), - INTVAL (operands[3]))) - DONE; -+ else if (mips_use_ins_ext_p (operands[1], operands[2], operands[3])) -+ { -+ if (GET_MODE (operands[0]) == DImode) -+ emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], -+ operands[3])); -+ else -+ emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], -+ operands[3])); -+ DONE; -+ } - else - FAIL; - }) - -+(define_insn "extzv" -+ [(set (match_operand:GPR 0 "register_operand" "=d") -+ (zero_extract:GPR (match_operand:GPR 1 "register_operand" "d") -+ (match_operand:SI 2 "immediate_operand" "I") -+ (match_operand:SI 3 "immediate_operand" "I")))] -+ "mips_use_ins_ext_p (operands[1], operands[2], operands[3])" -+ "ext\t%0,%1,%3,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "")]) -+ -+ - (define_expand "insv" -- [(set (zero_extract (match_operand:QI 0 "memory_operand") -+ [(set (zero_extract (match_operand 0 "nonimmediate_operand") - (match_operand 1 "immediate_operand") - (match_operand 2 "immediate_operand")) - (match_operand 3 "reg_or_0_operand"))] -@@ -2814,10 +2838,30 @@ - INTVAL (operands[1]), - INTVAL (operands[2]))) - DONE; -+ else if (mips_use_ins_ext_p (operands[0], operands[1], operands[2])) -+ { -+ if (GET_MODE (operands[0]) == DImode) -+ emit_insn (gen_insvdi (operands[0], operands[1], operands[2], -+ operands[3])); -+ else -+ emit_insn (gen_insvsi (operands[0], operands[1], operands[2], -+ operands[3])); -+ DONE; -+ } - else - FAIL; - }) - -+(define_insn "insv" -+ [(set (zero_extract:GPR (match_operand:GPR 0 "register_operand" "+d") -+ (match_operand:SI 1 "immediate_operand" "I") -+ (match_operand:SI 2 "immediate_operand" "I")) -+ (match_operand:GPR 3 "reg_or_0_operand" "dJ"))] -+ "mips_use_ins_ext_p (operands[0], operands[1], operands[2])" -+ "ins\t%0,%z3,%2,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "")]) -+ - ;; Unaligned word moves generated by the bit field patterns. - ;; - ;; As far as the rtl is concerned, both the left-part and right-part -@@ -4087,6 +4131,25 @@ - [(set_attr "type" "shift") - (set_attr "mode" "")]) - -+(define_expand "rotl3" -+ [(set (match_operand:GPR 0 "register_operand") -+ (rotate:GPR (match_operand:GPR 1 "register_operand") -+ (match_operand:SI 2 "arith_operand")))] -+ "ISA_HAS_ROTR_" -+{ -+ rtx temp; -+ -+ if (GET_CODE (operands[2]) == CONST_INT) -+ temp = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); -+ else -+ { -+ temp = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (temp, operands[2])); -+ } -+ emit_insn (gen_rotr3 (operands[0], operands[1], temp)); -+ DONE; -+}) -+ - ;; - ;; .................... - ;; -@@ -5200,7 +5263,7 @@ - (const_int 0)]) - (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") - (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - "@ - mov%T4\t%0,%z2,%1 - mov%t4\t%0,%z3,%1" -@@ -5230,8 +5293,12 @@ - (if_then_else:GPR (match_dup 5) - (match_operand:GPR 2 "reg_or_0_operand") - (match_operand:GPR 3 "reg_or_0_operand")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - { -+ if (ISA_HAS_INT_CONDMOVE -+ && GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_FLOAT) -+ FAIL; -+ - gen_conditional_move (operands); - DONE; - }) -@@ -5299,3 +5366,6 @@ - ; The MIPS Paired-Single Floating Point and MIPS-3D Instructions. - - (include "mips-ps-3d.md") -+ -+; Sony ALLEGREX instructions. -+(include "allegrex.md") ---- gcc-4.0.2.orig/gcc/config/mips/psp.h 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/psp.h 2005-07-12 03:05:10.000000000 -0700 -@@ -0,0 +1,31 @@ -+/* Support for Sony's Playstation Portable (PSP). -+ Copyright (C) 2005 Free Software Foundation, Inc. -+ Contributed by Marcus R. Brown -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+/* Override the startfile spec to include crt0.o. */ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" -+ -+#undef SUBTARGET_CPP_SPEC -+#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1" -+ -+/* Get rid of the .pdr section. */ -+#undef SUBTARGET_ASM_SPEC -+#define SUBTARGET_ASM_SPEC "-mno-pdr" ---- gcc-4.0.2.orig/gcc/config/mips/t-allegrex 1969-12-31 16:00:00.000000000 -0800 -+++ gcc-psp/gcc/config/mips/t-allegrex 2005-06-19 18:09:38.000000000 -0700 -@@ -0,0 +1,29 @@ -+# Suppress building libgcc1.a, since the MIPS compiler port is complete -+# and does not need anything from libgcc1.a. -+LIBGCC1 = -+CROSS_LIBGCC1 = -+ -+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o -+# Don't let CTOR_LIST end up in sdata section. -+CRTSTUFF_T_CFLAGS = -G 0 -+ -+# Assemble startup files. -+$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm -+ -+$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm -+ -+# We must build libgcc2.a with -G 0, in case the user wants to link -+# without the $gp register. -+TARGET_LIBGCC2_CFLAGS = -G 0 -+ -+# Build the libraries for both hard and soft floating point -+ -+MULTILIB_OPTIONS = -+MULTILIB_DIRNAMES = -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib ---- gcc-4.0.2.orig/gcc/hwint.h 2004-11-23 20:31:57.000000000 -0800 -+++ gcc-psp/gcc/hwint.h 2005-07-22 21:50:31.000000000 -0700 -@@ -80,7 +80,7 @@ - # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx" - # endif - #else --# define HOST_WIDE_INT_PRINT "ll" -+# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT - # define HOST_WIDE_INT_PRINT_C "LL" - /* We can assume that 'long long' is at least 64 bits. */ - # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ ---- gcc-4.0.2.orig/gcc/version.c 2005-10-22 14:38:17.000000000 -0700 -+++ gcc-psp/gcc/version.c 2005-10-22 14:44:30.000000000 -0700 -@@ -5,7 +5,7 @@ - please modify this string to indicate that, e.g. by putting your - organization's name in parentheses at the end of the string. */ - --const char version_string[] = "4.0.2"; -+const char version_string[] = "4.0.2 (PSPDEV 20051022)"; - - /* This is the location of the online document giving instructions for - reporting bugs. If you distribute a modified version of GCC, -@@ -14,4 +14,4 @@ - forward us bugs reported to you, if you determine that they are - not bugs in your modifications.) */ - --const char bug_report_url[] = ""; -+const char bug_report_url[] = ""; diff --git a/dkpsp/patches/gcc-4.1.0.patch b/dkpsp/patches/gcc-4.1.0.patch deleted file mode 100644 index a372493..0000000 --- a/dkpsp/patches/gcc-4.1.0.patch +++ /dev/null @@ -1,924 +0,0 @@ -diff -Nbaur gcc-4.1.0/config.sub gcc-4.1.0-psp/config.sub ---- gcc-4.1.0/config.sub Fri Dec 16 12:57:40 2005 -+++ gcc-4.1.0-psp/config.sub Sun May 7 22:34:17 2006 -@@ -264,6 +264,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ -@@ -346,6 +347,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -688,6 +690,10 @@ - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint -+ ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` -diff -Nbaur gcc-4.1.0/gcc/c-incpath.c gcc-4.1.0-psp/gcc/c-incpath.c ---- gcc-4.1.0/gcc/c-incpath.c Sat Jun 25 03:02:01 2005 -+++ gcc-4.1.0-psp/gcc/c-incpath.c Sun May 7 22:34:29 2006 -@@ -331,13 +331,18 @@ - cpp_dir *p; - - #if defined (HAVE_DOS_BASED_FILE_SYSTEM) -- /* Convert all backslashes to slashes. The native CRT stat() -- function does not recognize a directory that ends in a backslash -- (unless it is a drive root dir, such "c:\"). Forward slashes, -- trailing or otherwise, cause no problems for stat(). */ -- char* c; -- for (c = path; *c; c++) -- if (*c == '\\') *c = '/'; -+ /* Remove unnecessary trailing slashes. On some versions of MS -+ Windows, trailing _forward_ slashes cause no problems for stat(). -+ On newer versions, stat() does not recognise a directory that ends -+ in a '\\' or '/', unless it is a drive root dir, such as "c:/", -+ where it is obligatory. */ -+ int pathlen = strlen (path); -+ char* end = path + pathlen - 1; -+ /* Preserve the lead '/' or lead "c:/". */ -+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); -+ -+ for (; end > start && IS_DIR_SEPARATOR (*end); end--) -+ *end = 0; - #endif - - p = xmalloc (sizeof (cpp_dir)); -diff -Nbaur gcc-4.1.0/gcc/config/mips/allegrex.md gcc-4.1.0-psp/gcc/config/mips/allegrex.md ---- gcc-4.1.0/gcc/config/mips/allegrex.md Thu Jan 1 00:00:00 1970 -+++ gcc-4.1.0-psp/gcc/config/mips/allegrex.md Sun May 7 22:34:17 2006 -@@ -0,0 +1,183 @@ -+;; Sony ALLEGREX instructions. -+;; Copyright (C) 2005 Free Software Foundation, Inc. -+;; -+;; This file is part of GCC. -+;; -+;; GCC is free software; you can redistribute it and/or modify -+;; it under the terms of the GNU General Public License as published by -+;; the Free Software Foundation; either version 2, or (at your option) -+;; any later version. -+;; -+;; GCC is distributed in the hope that it will be useful, -+;; but WITHOUT ANY WARRANTY; without even the implied warranty of -+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+;; GNU General Public License for more details. -+;; -+;; You should have received a copy of the GNU General Public License -+;; along with GCC; see the file COPYING. If not, write to -+;; the Free Software Foundation, 59 Temple Place - Suite 330, -+;; Boston, MA 02111-1307, USA. -+ -+; Multiply Add and Subtract. -+ -+(define_insn "allegrex_madd" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")) -+ (match_dup 0))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "madd\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_msub" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (minus:SI (match_dup 0) -+ (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))) -+ (clobber (match_scratch:SI 3 "=h"))] -+ "TARGET_ALLEGREX" -+ "msub\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+ -+; Min and max. -+ -+(define_insn "sminsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smin:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "min\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "smaxsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smax:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "max\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Extended shift instructions. -+ -+(define_insn "allegrex_bitrev" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_BITREV))] -+ "TARGET_ALLEGREX" -+ "bitrev\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbh" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBH))] -+ "TARGET_ALLEGREX" -+ "wsbh\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbw" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBW))] -+ "TARGET_ALLEGREX" -+ "wsbw\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+; Count leading ones, count trailing zeros, and count trailing ones (clz is -+; already defined). -+ -+(define_insn "allegrex_clo" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CLO))] -+ "TARGET_ALLEGREX" -+ "clo\t%0,%1" -+ [(set_attr "type" "clz") -+ (set_attr "mode" "SI")]) -+ -+(define_expand "ctzsi2" -+ [(set (match_operand:SI 0 "register_operand") -+ (ctz:SI (match_operand:SI 1 "register_operand")))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_clzsi2 (operands[0], r1)); -+ DONE; -+}) -+ -+(define_expand "allegrex_cto" -+ [(set (match_operand:SI 0 "register_operand") -+ (unspec:SI [(match_operand:SI 1 "register_operand")] -+ UNSPEC_CTO))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_allegrex_clo (operands[0], r1)); -+ DONE; -+}) -+ -+ -+; Misc. -+ -+(define_insn "allegrex_sync" -+ [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)] -+ "TARGET_ALLEGREX" -+ "sync" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+(define_insn "allegrex_cache" -+ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "") -+ (match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CACHE)] -+ "TARGET_ALLEGREX" -+ "cache\t%0,0(%1)" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+ -+; Floating-point builtins. -+ -+(define_insn "allegrex_ceil_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_CEIL_W_S))] -+ "TARGET_ALLEGREX" -+ "ceil.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_floor_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_FLOOR_W_S))] -+ "TARGET_ALLEGREX" -+ "floor.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_round_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_ROUND_W_S))] -+ "TARGET_ALLEGREX" -+ "round.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -diff -Nbaur gcc-4.1.0/gcc/config/mips/mips.c gcc-4.1.0-psp/gcc/config/mips/mips.c ---- gcc-4.1.0/gcc/config/mips/mips.c Fri Dec 9 08:15:58 2005 -+++ gcc-4.1.0-psp/gcc/config/mips/mips.c Sun May 7 22:34:17 2006 -@@ -179,6 +179,12 @@ - MIPS_VOID_FTYPE_V2HI_V2HI, - MIPS_VOID_FTYPE_V4QI_V4QI, - -+ /* For the Sony ALLEGREX. */ -+ MIPS_SI_FTYPE_QI, -+ MIPS_SI_FTYPE_HI, -+ MIPS_VOID_FTYPE_VOID, -+ MIPS_SI_FTYPE_SF, -+ - /* The last type. */ - MIPS_MAX_FTYPE_MAX - }; -@@ -220,6 +226,11 @@ - /* As above, but the instruction only sets a single $fcc register. */ - MIPS_BUILTIN_CMP_SINGLE, - -+ /* The builtin corresponds to the ALLEGREX cache instruction. Operand 0 -+ is the function code (must be less than 32) and operand 1 is the base -+ address. */ -+ MIPS_BUILTIN_CACHE, -+ - /* For generating bposge32 branch instructions in MIPS32 DSP ASE. */ - MIPS_BUILTIN_BPOSGE32 - }; -@@ -405,6 +416,7 @@ - static rtx mips_expand_builtin_compare (enum mips_builtin_type, - enum insn_code, enum mips_fp_condition, - rtx, tree); -+static rtx mips_expand_builtin_cache (enum insn_code icode, rtx, tree); - static rtx mips_expand_builtin_bposge (enum mips_builtin_type, rtx); - static void mips_encode_section_info (tree, rtx, int); - -@@ -721,6 +733,7 @@ - - /* MIPS II */ - { "r6000", PROCESSOR_R6000, 2 }, -+ { "allegrex", PROCESSOR_ALLEGREX, 2 }, - - /* MIPS III */ - { "r4000", PROCESSOR_R4000, 3 }, -@@ -10169,6 +10182,67 @@ - BPOSGE_BUILTIN (32, MASK_DSP) - }; - -+/* Builtin functions for the Sony ALLEGREX processor. -+ -+ These have the `__builtin_allgrex_' prefix instead of `__builtin_mips_' -+ to maintain compatibility with Sony's ALLEGREX GCC port. -+ -+ Some of the builtins may seem redundant, but they are the same as the -+ builtins defined in the Sony compiler. I chose to map redundant and -+ trivial builtins to the original instruction instead of creating -+ duplicate patterns specifically for the ALLEGREX (as Sony does). */ -+ -+/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_allegrex_. -+ FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */ -+#define DIRECT_ALLEGREX_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Same as the above, but mapped to an instruction that doesn't share the -+ NAME. NAME is the name of the builtin without the builtin prefix. */ -+#define DIRECT_ALLEGREX_NAMED_BUILTIN(NAME, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_ ## INSN, 0, "__builtin_allegrex_" #NAME, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction -+ CODE_FOR_allegrex_. FUNCTION_TYPE and TARGET_FLAGS are -+ builtin_description fields. */ -+#define DIRECT_ALLEGREX_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS } -+ -+/* Define a builtin with a specific function TYPE. */ -+#define SPECIAL_ALLEGREX_BUILTIN(TYPE, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_ ## TYPE, FUNCTION_TYPE, TARGET_FLAGS } -+ -+static const struct builtin_description allegrex_bdesc[] = -+{ -+ DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbh, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbw, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seb, extendqisi2, MIPS_SI_FTYPE_QI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seh, extendhisi2, MIPS_SI_FTYPE_HI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(max, smaxsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(min, sminsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NO_TARGET_BUILTIN(sync, MIPS_VOID_FTYPE_VOID, 0), -+ SPECIAL_ALLEGREX_BUILTIN(CACHE, cache, MIPS_VOID_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(sqrt_s, sqrtsf2, MIPS_SF_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(ceil_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(floor_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(round_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(trunc_w_s, fix_truncsfsi2_insn, MIPS_SI_FTYPE_SF, 0) -+}; -+ - /* This helps provide a mapping from builtin function codes to bdesc - arrays. */ - -@@ -10189,6 +10263,7 @@ - { - { mips_bdesc, ARRAY_SIZE (mips_bdesc), PROCESSOR_MAX }, - { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 }, -+ { allegrex_bdesc, ARRAY_SIZE (allegrex_bdesc), PROCESSOR_ALLEGREX }, - { dsp_bdesc, ARRAY_SIZE (dsp_bdesc), PROCESSOR_MAX } - }; - -@@ -10292,6 +10367,9 @@ - case MIPS_BUILTIN_BPOSGE32: - return mips_expand_builtin_bposge (type, target); - -+ case MIPS_BUILTIN_CACHE: -+ return mips_expand_builtin_cache (icode, target, arglist); -+ - default: - return 0; - } -@@ -10310,8 +10388,8 @@ - tree V4QI_type_node; - unsigned int offset; - -- /* We have only builtins for -mpaired-single, -mips3d and -mdsp. */ -- if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_DSP) -+ /* We have only builtins for -mpaired-single, -mips3d and -mdsp and the Sony ALLEGREX. */ -+ if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_DSP && !TARGET_ALLEGREX) - return; - - if (TARGET_PAIRED_SINGLE_FLOAT) -@@ -10376,6 +10454,44 @@ - double_type_node, double_type_node, NULL_TREE); - } - -+ if (TARGET_ALLEGREX) -+ { -+ types[MIPS_SI_FTYPE_QI] -+ = build_function_type_list (intSI_type_node, -+ intQI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_HI] -+ = build_function_type_list (intSI_type_node, -+ intHI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SI_SI] -+ = build_function_type_list (intSI_type_node, -+ intSI_type_node, intSI_type_node, -+ NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_VOID] -+ = build_function_type_list (void_type_node, void_type_node, NULL_TREE); -+ -+ types[MIPS_VOID_FTYPE_SI_SI] -+ = build_function_type_list (void_type_node, -+ intSI_type_node, intSI_type_node, NULL_TREE); -+ -+ types[MIPS_SF_FTYPE_SF] -+ = build_function_type_list (float_type_node, -+ float_type_node, NULL_TREE); -+ -+ types[MIPS_SI_FTYPE_SF] -+ = build_function_type_list (intSI_type_node, -+ float_type_node, NULL_TREE); -+ } -+ - if (TARGET_DSP) - { - V2HI_type_node = build_vector_type_for_mode (intHI_type_node, V2HImode); -@@ -10557,6 +10673,10 @@ - - switch (i) - { -+ case 0: -+ emit_insn (GEN_FCN (icode) (0)); -+ break; -+ - case 2: - emit_insn (GEN_FCN (icode) (ops[0], ops[1])); - break; -@@ -10765,6 +10885,28 @@ - rtx symbol = XEXP (rtl, 0); - SYMBOL_REF_FLAGS (symbol) |= SYMBOL_FLAG_LONG_CALL; - } -+} -+ -+/* Expand a __builtin_allegrex_cache() function. Make sure the passed -+ cache function code is less than 32. */ -+ -+static rtx -+mips_expand_builtin_cache (enum insn_code icode, rtx target, tree arglist) -+{ -+ rtx op0, op1; -+ -+ op0 = mips_prepare_builtin_arg (icode, 0, &arglist); -+ op1 = mips_prepare_builtin_arg (icode, 1, &arglist); -+ -+ if (GET_CODE (op0) == CONST_INT) -+ if (INTVAL (op0) < 0 || INTVAL (op0) > 0x1f) -+ { -+ error ("invalid function code '%d'", INTVAL (op0)); -+ return const0_rtx; -+ } -+ -+ emit_insn (GEN_FCN (icode) (op0, op1)); -+ return target; - } - - #include "gt-mips.h" -diff -Nbaur gcc-4.1.0/gcc/config/mips/mips.h gcc-4.1.0-psp/gcc/config/mips/mips.h ---- gcc-4.1.0/gcc/config/mips/mips.h Fri Feb 17 21:38:59 2006 -+++ gcc-4.1.0-psp/gcc/config/mips/mips.h Sun May 7 22:34:17 2006 -@@ -59,6 +59,7 @@ - PROCESSOR_R9000, - PROCESSOR_SB1, - PROCESSOR_SR71000, -+ PROCESSOR_ALLEGREX, - PROCESSOR_MAX - }; - -@@ -194,6 +195,7 @@ - #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000) - #define TARGET_SB1 (mips_arch == PROCESSOR_SB1) - #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) -+#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX) - - /* Scheduling target defines. */ - #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000) -@@ -208,6 +210,7 @@ - #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000) - #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000) - #define TUNE_SB1 (mips_tune == PROCESSOR_SB1) -+#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) - - /* True if the pre-reload scheduler should try to create chains of - multiply-add or multiply-subtract instructions. For example, -@@ -578,6 +581,9 @@ - && !TARGET_MIPS5500 \ - && !TARGET_MIPS16) - -+/* ISA has just the integer condition move instructions (movn,movz) */ -+#define ISA_HAS_INT_CONDMOVE (TARGET_ALLEGREX) -+ - /* ISA has the mips4 FP condition code instructions: FP-compare to CC, - branch on CC, and move (both FP and non-FP) on CC. */ - #define ISA_HAS_8CC (ISA_MIPS4 \ -@@ -594,7 +600,8 @@ - - /* ISA has conditional trap instructions. */ - #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ -- && !TARGET_MIPS16) -+ && !TARGET_MIPS16 \ -+ && !TARGET_ALLEGREX) - - /* ISA has integer multiply-accumulate instructions, madd and msub. */ - #define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ -@@ -612,6 +619,7 @@ - #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -+ || TARGET_ALLEGREX \ - ) && !TARGET_MIPS16) - - /* ISA has double-word count leading zeroes/ones instruction (not -@@ -659,6 +667,7 @@ - || TARGET_MIPS5400 \ - || TARGET_MIPS5500 \ - || TARGET_SR71K \ -+ || TARGET_ALLEGREX \ - )) - - /* ISA has 64-bit rotate right instruction. */ -@@ -692,11 +701,13 @@ - /* ISA includes the MIPS32r2 seb and seh instructions. */ - #define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \ - && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - )) - - /* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ - #define ISA_HAS_EXT_INS (!TARGET_MIPS16 \ - && (ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - )) - - /* True if the result of a load is not available to the next instruction. -@@ -727,7 +738,8 @@ - #define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \ - || ISA_MIPS32R2 \ - || ISA_MIPS64 \ -- || TARGET_MIPS5500) -+ || TARGET_MIPS5500 \ -+ || TARGET_ALLEGREX) - - /* Add -G xx support. */ - -@@ -1138,6 +1150,11 @@ - /* Define if loading short immediate values into registers sign extends. */ - #define SHORT_IMMEDIATES_SIGN_EXTEND - -+/* The [d]clz instructions have the natural values at 0. */ -+ -+#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ -+ ((VALUE) = GET_MODE_BITSIZE (MODE), true) -+ - /* The [d]clz instructions have the natural values at 0. */ - - #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ -diff -Nbaur gcc-4.1.0/gcc/config/mips/mips.md gcc-4.1.0-psp/gcc/config/mips/mips.md ---- gcc-4.1.0/gcc/config/mips/mips.md Fri Jul 29 18:25:27 2005 -+++ gcc-4.1.0-psp/gcc/config/mips/mips.md Sun May 7 22:34:17 2006 -@@ -142,6 +142,21 @@ - (UNSPEC_MTHLIP 365) - (UNSPEC_WRDSP 366) - (UNSPEC_RDDSP 367) -+ -+ ;; Sony ALLEGREX instructions -+ (UNSPEC_WSBH 401) -+ (UNSPEC_WSBW 402) -+ -+ (UNSPEC_CLO 403) -+ (UNSPEC_CTO 404) -+ -+ (UNSPEC_CACHE 405) -+ (UNSPEC_SYNC 406) -+ -+ (UNSPEC_CEIL_W_S 407) -+ (UNSPEC_FLOOR_W_S 408) -+ (UNSPEC_ROUND_W_S 409) -+ - ] - ) - -@@ -1601,9 +1616,9 @@ - (mult:DI - (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] -- "!TARGET_64BIT && ISA_HAS_MSAC" -+ "!TARGET_64BIT && (ISA_HAS_MSAC || TARGET_ALLEGREX)" - { -- if (TARGET_MIPS5500) -+ if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "msub\t%1,%2"; - else - return "msac\t$0,%1,%2"; -@@ -1718,12 +1733,12 @@ - (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) - (match_operand:DI 3 "register_operand" "0")))] -- "(TARGET_MAD || ISA_HAS_MACC) -+ "(TARGET_MAD || ISA_HAS_MACC || TARGET_ALLEGREX) - && !TARGET_64BIT" - { - if (TARGET_MAD) - return "mad\t%1,%2"; -- else if (TARGET_MIPS5500) -+ else if (TARGET_MIPS5500 || TARGET_ALLEGREX) - return "madd\t%1,%2"; - else - /* See comment in *macc. */ -@@ -1995,6 +2010,32 @@ - ;; - ;; .................... - ;; -+;; FIND FIRST BIT INSTRUCTION -+;; -+;; .................... -+;; -+ -+(define_expand "ffs2" -+ [(set (match_operand:GPR 0 "register_operand" "") -+ (ffs:GPR (match_operand:GPR 1 "register_operand" "")))] -+ "ISA_HAS_CLZ_CLO" -+{ -+ rtx r1, r2, r3, r4; -+ -+ r1 = gen_reg_rtx (mode); -+ r2 = gen_reg_rtx (mode); -+ r3 = gen_reg_rtx (mode); -+ r4 = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (r1, operands[1])); -+ emit_insn (gen_and3 (r2, operands[1], r1)); -+ emit_insn (gen_clz2 (r3, r2)); -+ emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (mode))); -+ emit_insn (gen_sub3 (operands[0], r4, r3)); -+ DONE; -+}) -+;; -+;; .................... -+;; - ;; NEGATION and ONE'S COMPLEMENT - ;; - ;; .................... -@@ -4193,6 +4234,25 @@ - [(set_attr "type" "shift") - (set_attr "mode" "")]) - -+(define_expand "rotl3" -+ [(set (match_operand:GPR 0 "register_operand") -+ (rotate:GPR (match_operand:GPR 1 "register_operand") -+ (match_operand:SI 2 "arith_operand")))] -+ "ISA_HAS_ROTR_" -+{ -+ rtx temp; -+ -+ if (GET_CODE (operands[2]) == CONST_INT) -+ temp = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); -+ else -+ { -+ temp = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (temp, operands[2])); -+ } -+ emit_insn (gen_rotr3 (operands[0], operands[1], temp)); -+ DONE; -+}) -+ - ;; - ;; .................... - ;; -@@ -5306,7 +5366,7 @@ - (const_int 0)]) - (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") - (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - "@ - mov%T4\t%0,%z2,%1 - mov%t4\t%0,%z3,%1" -@@ -5336,8 +5396,12 @@ - (if_then_else:GPR (match_dup 5) - (match_operand:GPR 2 "reg_or_0_operand") - (match_operand:GPR 3 "reg_or_0_operand")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - { -+ if (ISA_HAS_INT_CONDMOVE -+ && GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_FLOAT) -+ FAIL; -+ - gen_conditional_move (operands); - DONE; - }) -@@ -5428,3 +5492,6 @@ - ; The MIPS DSP Instructions. - - (include "mips-dsp.md") -+ -+; Sony ALLEGREX instructions. -+(include "allegrex.md") -diff -Nbaur gcc-4.1.0/gcc/config/mips/psp.h gcc-4.1.0-psp/gcc/config/mips/psp.h ---- gcc-4.1.0/gcc/config/mips/psp.h Thu Jan 1 00:00:00 1970 -+++ gcc-4.1.0-psp/gcc/config/mips/psp.h Sun May 7 22:34:17 2006 -@@ -0,0 +1,31 @@ -+/* Support for Sony's Playstation Portable (PSP). -+ Copyright (C) 2005 Free Software Foundation, Inc. -+ Contributed by Marcus R. Brown -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+/* Override the startfile spec to include crt0.o. */ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" -+ -+#undef SUBTARGET_CPP_SPEC -+#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1" -+ -+/* Get rid of the .pdr section. */ -+#undef SUBTARGET_ASM_SPEC -+#define SUBTARGET_ASM_SPEC "-mno-pdr" -diff -Nbaur gcc-4.1.0/gcc/config/mips/t-allegrex gcc-4.1.0-psp/gcc/config/mips/t-allegrex ---- gcc-4.1.0/gcc/config/mips/t-allegrex Thu Jan 1 00:00:00 1970 -+++ gcc-4.1.0-psp/gcc/config/mips/t-allegrex Sun May 7 22:34:17 2006 -@@ -0,0 +1,29 @@ -+# Suppress building libgcc1.a, since the MIPS compiler port is complete -+# and does not need anything from libgcc1.a. -+LIBGCC1 = -+CROSS_LIBGCC1 = -+ -+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o -+# Don't let CTOR_LIST end up in sdata section. -+CRTSTUFF_T_CFLAGS = -G 0 -+ -+# Assemble startup files. -+$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm -+ -+$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm -+ -+# We must build libgcc2.a with -G 0, in case the user wants to link -+# without the $gp register. -+TARGET_LIBGCC2_CFLAGS = -G 0 -+ -+# Build the libraries for both hard and soft floating point -+ -+MULTILIB_OPTIONS = -+MULTILIB_DIRNAMES = -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -diff -Nbaur gcc-4.1.0/gcc/config.gcc gcc-4.1.0-psp/gcc/config.gcc ---- gcc-4.1.0/gcc/config.gcc Mon Feb 6 16:07:46 2006 -+++ gcc-4.1.0-psp/gcc/config.gcc Sun May 7 22:34:17 2006 -@@ -406,12 +406,6 @@ - tm_defines="${tm_defines} FBSD_MAJOR=5" ;; - *-*-freebsd6 | *-*-freebsd[6].*) - tm_defines="${tm_defines} FBSD_MAJOR=6" ;; -- *-*-freebsd7 | *-*-freebsd[7].*) -- tm_defines="${tm_defines} FBSD_MAJOR=7" ;; -- *-*-freebsd8 | *-*-freebsd[8].*) -- tm_defines="${tm_defines} FBSD_MAJOR=8" ;; -- *-*-freebsd9 | *-*-freebsd[9].*) -- tm_defines="${tm_defines} FBSD_MAJOR=9" ;; - *) - echo 'Please update *-*-freebsd* in gcc/config.gcc' - exit 1 -@@ -756,11 +750,6 @@ - tmake_file=bfin/t-bfin-elf - use_collect2=no - ;; --bfin*-uclinux*) -- tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/uclinux.h" -- tmake_file=bfin/t-bfin-elf -- use_collect2=no -- ;; - bfin*-*) - tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" - tmake_file=bfin/t-bfin -@@ -1582,6 +1571,18 @@ - mipstx39-*-elf* | mipstx39el-*-elf*) - tm_file="elfos.h ${tm_file} mips/r3900.h mips/elf.h" - tmake_file=mips/t-r3900 -+ use_fixproto=yes -+ ;; -+mipsallegrex-*-elf* | mipsallegrexel-*-elf*) -+ tm_file="elfos.h ${tm_file} mips/elf.h" -+ tmake_file=mips/t-allegrex -+ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" -+ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" -+ case ${target} in -+ mipsallegrex*-psp-elf*) -+ tm_file="${tm_file} mips/psp.h" -+ ;; -+ esac - use_fixproto=yes - ;; - mmix-knuth-mmixware) -diff -Nbaur gcc-4.1.0/gcc/gcc.c gcc-4.1.0-psp/gcc/gcc.c ---- gcc-4.1.0/gcc/gcc.c Sat Jan 21 18:29:08 2006 -+++ gcc-4.1.0-psp/gcc/gcc.c Sun May 7 22:34:29 2006 -@@ -3250,8 +3250,6 @@ - gcc_libexec_prefix = make_relative_prefix (argv[0], - standard_bindir_prefix, - standard_libexec_prefix); -- if (gcc_exec_prefix) -- putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); - } - else - gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix, -@@ -6148,10 +6146,10 @@ - - /* We need to check standard_exec_prefix/just_machine_suffix/specs - for any override of as, ld and libraries. */ -- specs_file = alloca (strlen (standard_exec_prefix) -+ specs_file = alloca (strlen (gcc_exec_prefix) - + strlen (just_machine_suffix) + sizeof ("specs")); - -- strcpy (specs_file, standard_exec_prefix); -+ strcpy (specs_file, gcc_exec_prefix); - strcat (specs_file, just_machine_suffix); - strcat (specs_file, "specs"); - if (access (specs_file, R_OK) == 0) -diff -Nbaur gcc-4.1.0/gcc/prefix.c gcc-4.1.0-psp/gcc/prefix.c ---- gcc-4.1.0/gcc/prefix.c Sat Jun 25 03:02:01 2005 -+++ gcc-4.1.0-psp/gcc/prefix.c Sun May 7 22:34:29 2006 -@@ -246,13 +246,16 @@ - The returned string is always malloc-ed, and the caller is - responsible for freeing it. */ - -+ -+static const char *old_prefix = PREFIX; -+ - char * - update_path (const char *path, const char *key) - { - char *result, *p; -- const int len = strlen (std_prefix); -+ const int len = strlen (old_prefix); - -- if (! strncmp (path, std_prefix, len) -+ if (! strncmp (path, old_prefix, len) - && (IS_DIR_SEPARATOR(path[len]) - || path[len] == '\0') - && key != 0) -@@ -354,4 +357,6 @@ - set_std_prefix (const char *prefix, int len) - { - std_prefix = save_string (prefix, len); -+ -+ putenv (concat ("GCC_EXEC_PREFIX=", std_prefix, NULL)); - } -diff -Nbaur gcc-4.1.0/gcc/toplev.c gcc-4.1.0-psp/gcc/toplev.c ---- gcc-4.1.0/gcc/toplev.c Sat Feb 4 22:13:20 2006 -+++ gcc-4.1.0-psp/gcc/toplev.c Sun May 7 22:34:29 2006 -@@ -82,6 +82,7 @@ - #include "value-prof.h" - #include "alloc-pool.h" - #include "tree-mudflap.h" -+#include "prefix.h" - - #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO) - #include "dwarf2out.h" -@@ -1434,6 +1435,10 @@ - progname = p; - - xmalloc_set_program_name (progname); -+ -+ p = getenv("GCC_EXEC_PREFIX"); -+ set_std_prefix (p, strlen(p)); -+ - - hex_init (); - -diff -Nbaur gcc-4.1.0/gcc/version.c gcc-4.1.0-psp/gcc/version.c ---- gcc-4.1.0/gcc/version.c Wed Mar 16 06:04:10 2005 -+++ gcc-4.1.0-psp/gcc/version.c Sun May 7 22:37:23 2006 -@@ -8,7 +8,7 @@ - in parentheses. You may also wish to include a number indicating - the revision of your modified compiler. */ - --#define VERSUFFIX "" -+#define VERSUFFIX " (PSPDEV 20060507)" - - /* This is the location of the online document giving instructions for - reporting bugs. If you distribute a modified version of GCC, -@@ -17,7 +17,7 @@ - forward us bugs reported to you, if you determine that they are - not bugs in your modifications.) */ - --const char bug_report_url[] = ""; -+const char bug_report_url[] = ""; - - /* The complete version string, assembled from several pieces. - BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ diff --git a/dkpsp/patches/gdb-6.6.patch b/dkpsp/patches/gdb-6.6.patch deleted file mode 100644 index e34563e..0000000 --- a/dkpsp/patches/gdb-6.6.patch +++ /dev/null @@ -1,2067 +0,0 @@ -diff -Nbaur gdb-6.6/bfd/archures.c gdb-6.6-psp/bfd/archures.c ---- gdb-6.6/bfd/archures.c Wed Oct 25 07:49:20 2006 -+++ gdb-6.6-psp/bfd/archures.c Fri Jun 15 16:17:50 2007 -@@ -162,6 +162,7 @@ - .#define bfd_mach_mips16 16 - .#define bfd_mach_mips5 5 - .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} -+.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *} - .#define bfd_mach_mipsisa32 32 - .#define bfd_mach_mipsisa32r2 33 - .#define bfd_mach_mipsisa64 64 -diff -Nbaur gdb-6.6/bfd/bfd-in2.h gdb-6.6-psp/bfd/bfd-in2.h ---- gdb-6.6/bfd/bfd-in2.h Mon Nov 13 20:39:21 2006 -+++ gdb-6.6-psp/bfd/bfd-in2.h Fri Jun 15 16:17:50 2007 -@@ -1791,6 +1791,7 @@ - #define bfd_mach_mips16 16 - #define bfd_mach_mips5 5 - #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ -+#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */ - #define bfd_mach_mipsisa32 32 - #define bfd_mach_mipsisa32r2 33 - #define bfd_mach_mipsisa64 64 -diff -Nbaur gdb-6.6/bfd/cpu-mips.c gdb-6.6-psp/bfd/cpu-mips.c ---- gdb-6.6/bfd/cpu-mips.c Wed May 4 16:53:06 2005 -+++ gdb-6.6-psp/bfd/cpu-mips.c Fri Jun 15 16:17:50 2007 -@@ -86,6 +86,7 @@ - I_mipsisa64, - I_mipsisa64r2, - I_sb1, -+ I_allegrex, - }; - - #define NN(index) (&arch_info_struct[(index) + 1]) -@@ -118,7 +119,8 @@ - N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)), - N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), - N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), -- N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0), -+ N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)), -+ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", FALSE, 0), - }; - - /* The default architecture is mips:3000, but with a machine number of -diff -Nbaur gdb-6.6/bfd/elfxx-mips.c gdb-6.6-psp/bfd/elfxx-mips.c ---- gdb-6.6/bfd/elfxx-mips.c Fri Nov 3 00:58:10 2006 -+++ gdb-6.6-psp/bfd/elfxx-mips.c Fri Jun 15 16:17:50 2007 -@@ -5012,6 +5012,9 @@ - case E_MIPS_MACH_SB1: - return bfd_mach_mips_sb1; - -+ case E_MIPS_MACH_ALLEGREX: -+ return bfd_mach_mips_allegrex; -+ - default: - switch (flags & EF_MIPS_ARCH) - { -@@ -9124,6 +9127,10 @@ - val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; - break; - -+ case bfd_mach_mips_allegrex: -+ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX; -+ break; -+ - case bfd_mach_mipsisa32: - val = E_MIPS_ARCH_32; - break; -@@ -10881,6 +10888,7 @@ - /* MIPS II extensions. */ - { bfd_mach_mips4000, bfd_mach_mips6000 }, - { bfd_mach_mipsisa32, bfd_mach_mips6000 }, -+ { bfd_mach_mips_allegrex, bfd_mach_mips6000 }, - - /* MIPS I extensions. */ - { bfd_mach_mips6000, bfd_mach_mips3000 }, -diff -Nbaur gdb-6.6/config.sub gdb-6.6-psp/config.sub ---- gdb-6.6/config.sub Tue Sep 26 06:22:50 2006 -+++ gdb-6.6-psp/config.sub Fri Jun 15 16:17:50 2007 -@@ -267,6 +267,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ -@@ -348,6 +349,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -689,6 +691,10 @@ - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint -+ ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` -diff -Nbaur gdb-6.6/configure gdb-6.6-psp/configure ---- gdb-6.6/configure Tue Nov 14 23:26:39 2006 -+++ gdb-6.6-psp/configure Fri Jun 15 16:14:32 2007 -@@ -3271,7 +3271,7 @@ - - # Host dirs don't like to share a cache file either, horribly enough. - # This seems to be due to autoconf 2.5x stupidity. --host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" -+host_configargs="${cache_file_option} --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" - - target_configargs=${baseargs} - -diff -Nbaur gdb-6.6/configure.in gdb-6.6-psp/configure.in ---- gdb-6.6/configure.in Mon Dec 18 07:22:58 2006 -+++ gdb-6.6-psp/configure.in Fri Jun 15 16:14:32 2007 -@@ -2024,7 +2024,7 @@ - - # Host dirs don't like to share a cache file either, horribly enough. - # This seems to be due to autoconf 2.5x stupidity. --host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" -+host_configargs="${cache_file_option} --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" - - target_configargs=${baseargs} - -diff -Nbaur gdb-6.6/gdb/Makefile.in gdb-6.6-psp/gdb/Makefile.in ---- gdb-6.6/gdb/Makefile.in Fri Nov 24 19:54:14 2006 -+++ gdb-6.6-psp/gdb/Makefile.in Fri Jun 15 16:14:32 2007 -@@ -2983,7 +2983,7 @@ - insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \ - $(CDEPS) $(TDEPLIBS) - rm -f insight$(EXEEXT) -- $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ -+ $(CC_LD) -mwindows $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ - -o insight$(EXEEXT) gdbtk-main.o libgdb.a \ - $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) - -diff -Nbaur gdb-6.6/gdb/config/i386/mingw.mh gdb-6.6-psp/gdb/config/i386/mingw.mh ---- gdb-6.6/gdb/config/i386/mingw.mh Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-psp/gdb/config/i386/mingw.mh Fri Jun 15 16:14:33 2007 -@@ -0,0 +1,5 @@ -+MH_CFLAGS=-D_POSIX_ -+XM_FILE=xm-mingw32.h -+NATDEPFILES= i386-nat.o win32-nat.o corelow.o -+NAT_FILE=nm-mingw32.h -+XM_CLIBS= -diff -Nbaur gdb-6.6/gdb/config/i386/mingw.mt gdb-6.6-psp/gdb/config/i386/mingw.mt ---- gdb-6.6/gdb/config/i386/mingw.mt Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-psp/gdb/config/i386/mingw.mt Fri Jun 15 16:14:33 2007 -@@ -0,0 +1,4 @@ -+# Target: Intel x86 running Win32 (MinGW) -+TDEPFILES= i386-tdep.o i386-win32-tdep.o i387-tdep.o -+DEPRECATED_TM_FILE= tm-mingw32.h -+GDBSERVER_DEPFILES= -diff -Nbaur gdb-6.6/gdb/config/i386/nm-mingw32.h gdb-6.6-psp/gdb/config/i386/nm-mingw32.h ---- gdb-6.6/gdb/config/i386/nm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-psp/gdb/config/i386/nm-mingw32.h Fri Jun 15 16:14:33 2007 -@@ -0,0 +1,38 @@ -+/* Native definitions for Intel x86 running MinGW. -+ Copyright (C) 2002 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+#define NO_PTRACE_H -+ -+#define I386_USE_GENERIC_WATCHPOINTS -+ -+#include "i386/nm-i386.h" -+ -+/* Support for hardware-assisted breakpoints and watchpoints. */ -+ -+#define I386_DR_LOW_SET_CONTROL(VAL) cygwin_set_dr7 (VAL) -+extern void cygwin_set_dr7 (unsigned); -+ -+#define I386_DR_LOW_SET_ADDR(N,ADDR) cygwin_set_dr (N,ADDR) -+extern void cygwin_set_dr (int, CORE_ADDR); -+ -+#define I386_DR_LOW_RESET_ADDR(N) -+ -+#define I386_DR_LOW_GET_STATUS() cygwin_get_dr6 () -+extern unsigned cygwin_get_dr6 (void); -diff -Nbaur gdb-6.6/gdb/config/i386/tm-mingw32.h gdb-6.6-psp/gdb/config/i386/tm-mingw32.h ---- gdb-6.6/gdb/config/i386/tm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-psp/gdb/config/i386/tm-mingw32.h Fri Jun 15 16:14:33 2007 -@@ -0,0 +1,21 @@ -+/* Macro definitions for i386 running under Win32. -+ Copyright 1999 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include "i386/tm-cygwin.h" -+ -diff -Nbaur gdb-6.6/gdb/config/i386/xm-mingw32.h gdb-6.6-psp/gdb/config/i386/xm-mingw32.h ---- gdb-6.6/gdb/config/i386/xm-mingw32.h Thu Jan 1 00:00:00 1970 -+++ gdb-6.6-psp/gdb/config/i386/xm-mingw32.h Fri Jun 15 16:14:33 2007 -@@ -0,0 +1,25 @@ -+/* Definitions for hosting on WIN32, building with MinGW, for GDB. -+ Copyright 1999 Free Software Foundation, Inc. -+ -+This file is part of GDB. -+ -+This program is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2 of the License, or -+(at your option) any later version. -+ -+This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program; if not, write to the Free Software -+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include "fopen-bin.h" -+#define getkey getch -+#define DIRNAME_SEPARATOR ';' -+ -+/* Define this if source files use \r\n rather than just \n. */ -+#define CRLF_SOURCE_FILES -diff -Nbaur gdb-6.6/gdb/defs.h gdb-6.6-psp/gdb/defs.h ---- gdb-6.6/gdb/defs.h Thu Sep 21 14:50:51 2006 -+++ gdb-6.6-psp/gdb/defs.h Fri Jun 15 16:14:33 2007 -@@ -1167,7 +1167,7 @@ - /* FIXME, this doesn't work very well if host and executable - filesystems conventions are different. */ - --#ifdef __MSDOS__ -+#if defined(__MSDOS__) || (!defined (__CYGWIN__) && defined (_WIN32)) - # define CANT_FORK - # define GLOBAL_CURDIR - # define DIRNAME_SEPARATOR ';' -diff -Nbaur gdb-6.6/gdb/tui/tui-io.c gdb-6.6-psp/gdb/tui/tui-io.c ---- gdb-6.6/gdb/tui/tui-io.c Fri Dec 23 19:10:02 2005 -+++ gdb-6.6-psp/gdb/tui/tui-io.c Fri Jun 15 16:14:33 2007 -@@ -113,8 +113,11 @@ - - /* For gdb 5.3, prefer to continue the pipe hack as a backup wheel. */ - #define TUI_USE_PIPE_FOR_READLINE --/*#undef TUI_USE_PIPE_FOR_READLINE*/ - -+/* but remove for mingw host */ -+#ifdef __MINGW32__ -+#undef TUI_USE_PIPE_FOR_READLINE -+#endif - /* TUI output files. */ - static struct ui_file *tui_stdout; - static struct ui_file *tui_stderr; -diff -Nbaur gdb-6.6/gdb/win32-nat.c gdb-6.6-psp/gdb/win32-nat.c ---- gdb-6.6/gdb/win32-nat.c Mon May 22 00:04:39 2006 -+++ gdb-6.6-psp/gdb/win32-nat.c Fri Jun 15 16:14:33 2007 -@@ -43,7 +43,11 @@ - #include - #include - #include -+ -+#if defined (__CYGWIN__) - #include -+#endif /* __CYGWIN__ */ -+ - #include - - #include "buildsym.h" -@@ -81,7 +85,65 @@ - CONTEXT_DEBUGGER = (CONTEXT_FULL | CONTEXT_FLOATING_POINT) - }; - #endif --#include -+#ifndef __MINGW32__ -+ #include -+#else -+ #define NOTE_INFO_PROCESS 1 -+ #define NOTE_INFO_THREAD 2 -+ #define NOTE_INFO_MODULE 3 -+ -+ struct win32_core_process_info -+ { -+ DWORD pid; -+ int signal; -+ int command_line_size; -+ char command_line[1]; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_core_thread_info -+ { -+ DWORD tid; -+ BOOL is_active_thread; -+ CONTEXT thread_context; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_core_module_info -+ { -+ void* base_address; -+ int module_name_size; -+ char module_name[1]; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ struct win32_pstatus -+ { -+ unsigned long data_type; -+ union -+ { -+ struct win32_core_process_info process_info; -+ struct win32_core_thread_info thread_info; -+ struct win32_core_module_info module_info; -+ } data ; -+ } -+ #ifdef __GNUC__ -+ __attribute__ ((packed)) -+ #endif -+ ; -+ -+ typedef struct win32_pstatus win32_pstatus_t ; -+ -+#endif - #include - - #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \ -@@ -446,30 +508,23 @@ - static BOOL WINAPI (*psapi_GetModuleInformation) (HANDLE, HMODULE, LPMODULEINFO, DWORD) = NULL; - static DWORD WINAPI (*psapi_GetModuleFileNameExA) (HANDLE, HMODULE, LPSTR, DWORD) = NULL; - --static int --psapi_get_dll_name (DWORD BaseAddress, char *dll_name_ret) --{ -- DWORD len; -- MODULEINFO mi; -- int i; -- HMODULE dh_buf[1]; -- HMODULE *DllHandle = dh_buf; -- DWORD cbNeeded; -- BOOL ok; - -+BOOL -+load_psapi () -+{ - if (!psapi_loaded || - psapi_EnumProcessModules == NULL || - psapi_GetModuleInformation == NULL || - psapi_GetModuleFileNameExA == NULL) - { - if (psapi_loaded) -- goto failed; -+ return FALSE; - psapi_loaded = 1; - psapi_module_handle = LoadLibrary ("psapi.dll"); - if (!psapi_module_handle) - { - /* printf_unfiltered ("error loading psapi.dll: %u", GetLastError ()); */ -- goto failed; -+ return FALSE; - } - psapi_EnumProcessModules = GetProcAddress (psapi_module_handle, "EnumProcessModules"); - psapi_GetModuleInformation = GetProcAddress (psapi_module_handle, "GetModuleInformation"); -@@ -478,8 +533,24 @@ - if (psapi_EnumProcessModules == NULL || - psapi_GetModuleInformation == NULL || - psapi_GetModuleFileNameExA == NULL) -- goto failed; -+ return FALSE; - } -+ return TRUE; -+} -+ -+int -+psapi_get_dll_name (DWORD BaseAddress, char *dll_name_ret) -+{ -+ DWORD len; -+ MODULEINFO mi; -+ int i; -+ HMODULE dh_buf[1]; -+ HMODULE *DllHandle = dh_buf; -+ DWORD cbNeeded; -+ BOOL ok; -+ -+ if (!load_psapi ()) -+ goto failed; - - cbNeeded = 0; - ok = (*psapi_EnumProcessModules) (current_process_handle, -@@ -507,14 +578,14 @@ - DllHandle[i], - &mi, - sizeof (mi))) -- error (_("Can't get module info")); -+ error ("Can't get module info"); - - len = (*psapi_GetModuleFileNameExA) (current_process_handle, - DllHandle[i], - dll_name_ret, - MAX_PATH); - if (len == 0) -- error (_("Error getting dll name: %u."), (unsigned) GetLastError ()); -+ error ("Error getting dll name: %u\n", (unsigned) GetLastError ()); - - if ((DWORD) (mi.lpBaseOfDll) == BaseAddress) - return 1; -@@ -525,6 +596,30 @@ - return 0; - } - -+int -+psapi_get_module_filename (HANDLE hProcess, -+ HMODULE hModule, -+ LPTSTR lpFilename, -+ DWORD nSize) -+{ -+ DWORD len; -+ -+ if (!load_psapi ()) -+ goto failed; -+ -+ len = (*psapi_GetModuleFileNameExA) (hProcess, -+ hModule, -+ lpFilename, -+ nSize); -+ if (len == 0) -+ error ("Error getting file name: %u\n", (unsigned) GetLastError ()); -+ -+failed: -+ lpFilename[0] = '\0'; -+ return 0; -+} -+ -+ - /* Encapsulate the information required in a call to - symbol_file_add_args */ - struct safe_symbol_file_add_args -@@ -753,7 +848,13 @@ - so = XZALLOC (struct so_list); - so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info)); - so->lm_info->load_addr = load_addr; -+ -+#ifdef __CYGWIN__ - cygwin_conv_to_posix_path (buf, so->so_name); -+#else -+ strcpy( so->so_name, buf); -+#endif -+ - strcpy (so->so_original_name, so->so_name); - - solib_end->next = so; -@@ -1734,6 +1835,7 @@ - - if (!ok) - { -+#ifdef __CYGWIN__ - /* Try fall back to Cygwin pid */ - pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); - -@@ -1741,6 +1843,7 @@ - ok = DebugActiveProcess (pid); - - if (!ok) -+#endif /* __CYGWIN__ */ - error (_("Can't attach to process.")); - } - -@@ -1800,13 +1903,14 @@ - static char * - win32_pid_to_exec_file (int pid) - { -+ static char path[MAX_PATH + 1]; -+ char *path_ptr = NULL; -+#ifdef __CYGWIN__ - /* Try to find the process path using the Cygwin internal process list - pid isn't a valid pid, unfortunately. Use current_event.dwProcessId - instead. */ - /* TODO: Also find native Windows processes using CW_GETPINFO_FULL. */ - -- static char path[MAX_PATH + 1]; -- char *path_ptr = NULL; - int cpid; - struct external_pinfo *pinfo; - -@@ -1824,6 +1928,13 @@ - } - } - cygwin_internal (CW_UNLOCK_PINFO); -+#else -+ if (!psapi_get_module_filename (current_process_handle, NULL, path, MAX_PATH)) -+ printf_unfiltered ("error reading the process's file name: %lu", -+ GetLastError ()); -+ else -+ path_ptr = path; -+#endif - return path_ptr; - } - -@@ -1873,8 +1984,16 @@ - char *toexec; - char shell[MAX_PATH + 1]; /* Path to shell */ - const char *sh; -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ HANDLE hStdInput = 0; -+ HANDLE hStdOutput = 0; -+ HANDLE hStdError = 0; -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - int tty; - int ostdin, ostdout, ostderr; -+#endif /* !__MINGW32__ */ - const char *inferior_io_terminal = get_inferior_io_terminal (); - - if (!exec_file) -@@ -1886,7 +2005,12 @@ - if (!useshell) - { - flags = DEBUG_ONLY_THIS_PROCESS; -+#ifdef __CYGWIN__ - cygwin_conv_to_win32_path (exec_file, real_path); -+#else -+ strcpy (real_path, exec_file); -+#endif -+ - toexec = real_path; - } - else -@@ -1895,7 +2019,11 @@ - sh = getenv ("SHELL"); - if (!sh) - sh = "/bin/sh"; -+#ifdef __CYGWIN__ - cygwin_conv_to_win32_path (sh, shell); -+#else -+ strcpy (shell, sh); -+#endif - newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) - + strlen (allargs) + 2); - sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs); -@@ -1946,10 +2074,12 @@ - len = strlen (conv_path_names[j]); - if (strncmp (conv_path_names[j], in_env[i], len) == 0) - { -- if (cygwin_posix_path_list_p (in_env[i] + len)) -+#ifdef __CYGWIN__ -+ if (cygwin_posix_path_list_p (env[i] + len)) - envlen += len -- + cygwin_posix_to_win32_path_list_buf_size (in_env[i] + len); -+ + cygwin_posix_to_win32_path_list_buf_size (env[i] + len); - else -+#endif - envlen += strlen (in_env[i]) + 1; - break; - } -@@ -1976,12 +2106,14 @@ - len = strlen (conv_path_names[j]); - if (strncmp (conv_path_names[j], env[i], len) == 0) - { -+#ifdef __CYGWIN__ - if (cygwin_posix_path_list_p (env[i] + len)) - { - memcpy (temp, env[i], len); - cygwin_posix_to_win32_path_list (env[i] + len, temp + len); - } - else -+#endif - strcpy (temp, env[i]); - break; - } -@@ -1996,6 +2128,20 @@ - *temp = 0; - } - -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ if ( new_console) -+ { -+ hStdInput = GetStdHandle( STD_INPUT_HANDLE); -+ hStdOutput = GetStdHandle( STD_OUTPUT_HANDLE); -+ hStdError = GetStdHandle( STD_ERROR_HANDLE); -+ -+ SetStdHandle( STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); -+ SetStdHandle( STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE); -+ SetStdHandle( STD_ERROR_HANDLE, INVALID_HANDLE_VALUE); -+ } -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - if (!inferior_io_terminal) - tty = ostdin = ostdout = ostderr = -1; - else -@@ -2016,6 +2162,7 @@ - dup2 (tty, 2); - } - } -+#endif /* !__MINGW32__ */ - - win32_init_thread_list (); - ret = CreateProcess (0, -@@ -2028,6 +2175,16 @@ - NULL, /* current directory */ - &si, - &pi); -+#if defined (__MINGW32__) -+ /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */ -+ if ( new_console) -+ { -+ SetStdHandle( STD_INPUT_HANDLE, hStdInput); -+ SetStdHandle( STD_OUTPUT_HANDLE, hStdOutput); -+ SetStdHandle( STD_ERROR_HANDLE, hStdError); -+ } -+ /* END: Fragment of Al Stevens's patch for GDB on Win9x */ -+#else /* !__MINGW32__ */ - if (tty >= 0) - { - close (tty); -@@ -2038,6 +2195,7 @@ - close (ostdout); - close (ostderr); - } -+#endif /* !__MINGW32__ */ - - if (!ret) - error (_("Error creating process %s, (error %d)."), -diff -Nbaur gdb-6.6/include/bin-bugs.h gdb-6.6-psp/include/bin-bugs.h ---- gdb-6.6/include/bin-bugs.h Fri Jul 23 16:40:19 2004 -+++ gdb-6.6-psp/include/bin-bugs.h Fri Jun 15 16:17:50 2007 -@@ -1,3 +1,3 @@ - #ifndef REPORT_BUGS_TO --#define REPORT_BUGS_TO "" -+#define REPORT_BUGS_TO "" - #endif -diff -Nbaur gdb-6.6/include/elf/common.h gdb-6.6-psp/include/elf/common.h ---- gdb-6.6/include/elf/common.h Wed Oct 25 07:49:18 2006 -+++ gdb-6.6-psp/include/elf/common.h Fri Jun 15 16:17:50 2007 -@@ -93,6 +93,7 @@ - #define ET_HIOS 0xFEFF /* Operating system-specific */ - #define ET_LOPROC 0xFF00 /* Processor-specific */ - #define ET_HIPROC 0xFFFF /* Processor-specific */ -+#define ET_PSPEXEC 0xFFA0 /* Sony PSP executable file */ - - /* Values for e_machine, which identifies the architecture. These numbers - are officially assigned by registry@caldera.com. See below for a list of -diff -Nbaur gdb-6.6/include/elf/mips.h gdb-6.6-psp/include/elf/mips.h ---- gdb-6.6/include/elf/mips.h Sat Oct 28 11:13:49 2006 -+++ gdb-6.6-psp/include/elf/mips.h Fri Jun 15 16:17:50 2007 -@@ -216,6 +216,7 @@ - #define E_MIPS_MACH_5400 0x00910000 - #define E_MIPS_MACH_5500 0x00980000 - #define E_MIPS_MACH_9000 0x00990000 -+#define E_MIPS_MACH_ALLEGREX 0x00A20000 - - /* Processor specific section indices. These sections do not actually - exist. Symbols with a st_shndx field corresponding to one of these -diff -Nbaur gdb-6.6/include/opcode/mips.h gdb-6.6-psp/include/opcode/mips.h ---- gdb-6.6/include/opcode/mips.h Tue Jun 6 11:49:48 2006 -+++ gdb-6.6-psp/include/opcode/mips.h Fri Jun 15 16:17:50 2007 -@@ -213,6 +213,83 @@ - #define OP_SH_UDI4 6 - #define OP_MASK_UDI4 0xfffff - -+#define OP_SH_VFPU_DELTA 0 -+#define OP_MASK_VFPU_DELTA 0xfffc -+#define OP_SH_VFPU_IMM3 16 -+#define OP_MASK_VFPU_IMM3 0x7 -+#define OP_SH_VFPU_IMM5 16 -+#define OP_MASK_VFPU_IMM5 0x1f -+#define OP_SH_VFPU_IMM8 16 -+#define OP_MASK_VFPU_IMM8 0xff -+#define OP_SH_VFPU_CC 18 /* Condition code. */ -+#define OP_MASK_VFPU_CC 0x7 -+#define OP_SH_VFPU_CONST 16 -+#define OP_MASK_VFPU_CONST 0x1f -+#define OP_SH_VFPU_COND 0 /* Conditional compare. */ -+#define OP_MASK_VFPU_COND 0xf -+#define OP_SH_VFPU_VMTVC 0 -+#define OP_MASK_VFPU_VMTVC 0xff -+#define OP_SH_VFPU_VMFVC 8 -+#define OP_MASK_VFPU_VMFVC 0xff -+#define OP_SH_VFPU_RWB 1 -+#define OP_MASK_VFPU_RWB 0x1 -+#define OP_SH_VFPU_ROT 16 /* Rotators used in vrot. */ -+#define OP_MASK_VFPU_ROT 0x1f -+#define OP_SH_VFPU_FLOAT16 0 -+#define OP_MASK_VFPU_FLOAT16 0xffff -+ -+/* VFPU registers. */ -+#define OP_SH_VFPU_VD 0 -+#define OP_MASK_VFPU_VD 0x7f -+#define OP_SH_VFPU_VS 8 -+#define OP_MASK_VFPU_VS 0x7f -+#define OP_SH_VFPU_VT 16 -+#define OP_MASK_VFPU_VT 0x7f -+#define OP_SH_VFPU_VT_LO 16 /* Bits 0-4 of vt. */ -+#define OP_MASK_VFPU_VT_LO 0x1f -+#define OP_SH_VFPU_VT_HI 5 /* Right-shifted. */ -+#define OP_MASK_VFPU_VT_HI1 0x1 /* Bit 5 of vt. */ -+#define OP_MASK_VFPU_VT_HI2 0x3 /* Bits 5-6 of vt. */ -+/* Special handling of vs in vmmul instructions. */ -+#define VFPU_OP_VT_VS_VD 0xff800000 -+#define VFPU_OPCODE_VMMUL 0xf0000000 -+ -+/* VFPU prefix instruction operands. The *_SH_* values really specify where -+ the bitfield begins, as VFPU prefix instructions have four operands -+ encoded within the immediate field. */ -+#define VFPU_SH_PFX_NEG 16 -+#define VFPU_MASK_PFX_NEG 0x1 /* Negation. */ -+#define VFPU_SH_PFX_CST 12 -+#define VFPU_MASK_PFX_CST 0x1 /* Constant. */ -+#define VFPU_SH_PFX_ABS_CSTHI 8 -+#define VFPU_MASK_PFX_ABS_CSTHI 0x1 /* Abs/Constant (bit 2). */ -+#define VFPU_MASK_PFX_SWZ_CSTLO 0x3 /* Swizzle/Constant (bits 0-1). */ -+#define VFPU_SH_PFX_MASK 8 -+#define VFPU_MASK_PFX_MASK 0x1 /* Mask. */ -+#define VFPU_MASK_PFX_SAT 0x3 /* Saturation. */ -+ -+/* Special handling of the vrot instructions. */ -+#define VFPU_MASK_OP_SIZE 0x8080 /* Masks the operand size (pair, triple, quad). */ -+#define VFPU_OP_SIZE_PAIR 0x80 -+#define VFPU_OP_SIZE_TRIPLE 0x8000 -+#define VFPU_OP_SIZE_QUAD 0x8080 -+/* Note that these are within the rotators field, and not the full opcode. */ -+#define VFPU_SH_ROT_HI 2 -+#define VFPU_MASK_ROT_HI 0x3 -+#define VFPU_SH_ROT_LO 0 -+#define VFPU_MASK_ROT_LO 0x3 -+#define VFPU_SH_ROT_NEG 4 /* Negation. */ -+#define VFPU_MASK_ROT_NEG 0x1 -+ -+/* VFPU 16-bit floating-point format. */ -+#define VFPU_FLOAT16_EXP_MAX 0x1f -+#define VFPU_SH_FLOAT16_SIGN 15 -+#define VFPU_MASK_FLOAT16_SIGN 0x1 -+#define VFPU_SH_FLOAT16_EXP 10 -+#define VFPU_MASK_FLOAT16_EXP 0x1f -+#define VFPU_SH_FLOAT16_FRAC 0 -+#define VFPU_MASK_FLOAT16_FRAC 0x3ff -+ - /* This structure holds information for a particular instruction. */ - - struct mips_opcode -@@ -301,6 +378,29 @@ - Requires that "+A" or "+E" occur first to set position. - Enforces: 32 < (pos+size) <= 64. - -+ Sony Allegrex VFPU instructions: -+ "?o" -+ "?0" - "?3" -+ "?4" - "?7" -+ "?a" -+ "?b" -+ "?c" -+ "?e" -+ "?f" -+ "?i" -+ "?q" -+ "?r" -+ "?u" -+ "?w" -+ "?d" -+ "?m" -+ "?n" -+ "?s" -+ "?t" -+ "?v" -+ "?x" -+ "?z" -+ - Floating point instructions: - "D" 5 bit destination register (OP_*_FD) - "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up) -@@ -517,6 +617,8 @@ - #define INSN_5400 0x01000000 - /* NEC VR5500 instruction. */ - #define INSN_5500 0x02000000 -+/* Sony Allegrex instruction. */ -+#define INSN_ALLEGREX 0x10000000 - - /* MDMX ASE */ - #define INSN_MDMX 0x04000000 -@@ -571,6 +673,7 @@ - #define CPU_MIPS64 64 - #define CPU_MIPS64R2 65 - #define CPU_SB1 12310201 /* octal 'SB', 01. */ -+#define CPU_ALLEGREX 10111431 /* octal 'AL', 31. */ - - /* Test for membership in an ISA including chip specific ISAs. INSN - is pointer to an element of the opcode table; ISA is the specified -@@ -592,6 +695,7 @@ - || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \ - || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \ - || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \ -+ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \ - || 0) /* Please keep this term for easier source merging. */ - - /* This is a list of macro expanded instructions. -@@ -708,6 +812,16 @@ - M_LL_AB, - M_LLD_AB, - M_LS_A, -+ M_LVHIP, -+ M_LVHIS, -+ M_LVIP, -+ M_LVIQ, -+ M_LVIS, -+ M_LVIT, -+ M_LVLQ_AB, -+ M_LVRQ_AB, -+ M_LVQ_AB, -+ M_LVQ_AB_2, - M_LW_A, - M_LW_AB, - M_LWC0_A, -@@ -797,6 +911,10 @@ - M_SUB_I, - M_SUBU_I, - M_SUBU_I_2, -+ M_SVLQ_AB, -+ M_SVQ_AB, -+ M_SVRQ_AB, -+ M_SVS_AB, - M_TEQ_I, - M_TGE_I, - M_TGEU_I, -@@ -811,14 +929,24 @@ - M_ULH_A, - M_ULHU, - M_ULHU_A, -+ M_ULVQ, -+ M_ULVQ_AB, -+ M_ULVS, - M_ULW, - M_ULW_A, - M_USH, - M_USH_A, -+ M_USVQ, -+ M_USVQ_AB, -+ M_USVS, - M_USW, - M_USW_A, - M_USD, - M_USD_A, -+ M_VCMOVP, -+ M_VCMOVQ, -+ M_VCMOVS, -+ M_VCMOVT, - M_XOR_I, - M_COP0, - M_COP1, -diff -Nbaur gdb-6.6/opcodes/mips-dis.c gdb-6.6-psp/opcodes/mips-dis.c ---- gdb-6.6/opcodes/mips-dis.c Sat Sep 16 19:12:17 2006 -+++ gdb-6.6-psp/opcodes/mips-dis.c Fri Jun 15 16:17:50 2007 -@@ -136,6 +136,139 @@ - "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", - }; - -+static const char * const vfpu_sreg_names[128] = { -+ "S000", "S010", "S020", "S030", "S100", "S110", "S120", "S130", -+ "S200", "S210", "S220", "S230", "S300", "S310", "S320", "S330", -+ "S400", "S410", "S420", "S430", "S500", "S510", "S520", "S530", -+ "S600", "S610", "S620", "S630", "S700", "S710", "S720", "S730", -+ "S001", "S011", "S021", "S031", "S101", "S111", "S121", "S131", -+ "S201", "S211", "S221", "S231", "S301", "S311", "S321", "S331", -+ "S401", "S411", "S421", "S431", "S501", "S511", "S521", "S531", -+ "S601", "S611", "S621", "S631", "S701", "S711", "S721", "S731", -+ "S002", "S012", "S022", "S032", "S102", "S112", "S122", "S132", -+ "S202", "S212", "S222", "S232", "S302", "S312", "S322", "S332", -+ "S402", "S412", "S422", "S432", "S502", "S512", "S522", "S532", -+ "S602", "S612", "S622", "S632", "S702", "S712", "S722", "S732", -+ "S003", "S013", "S023", "S033", "S103", "S113", "S123", "S133", -+ "S203", "S213", "S223", "S233", "S303", "S313", "S323", "S333", -+ "S403", "S413", "S423", "S433", "S503", "S513", "S523", "S533", -+ "S603", "S613", "S623", "S633", "S703", "S713", "S723", "S733" -+}; -+ -+static const char * const vfpu_vpreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "C002", "C012", "C022", "C032", "C102", "C112", "C122", "C132", -+ "C202", "C212", "C222", "C232", "C302", "C312", "C322", "C332", -+ "C402", "C412", "C422", "C432", "C502", "C512", "C522", "C532", -+ "C602", "C612", "C622", "C632", "C702", "C712", "C722", "C732", -+ "R020", "R021", "R022", "R023", "R120", "R121", "R122", "R123", -+ "R220", "R221", "R222", "R223", "R320", "R321", "R322", "R323", -+ "R420", "R421", "R422", "R423", "R520", "R521", "R522", "R523", -+ "R620", "R621", "R622", "R623", "R720", "R721", "R722", "R723" -+}; -+ -+static const char * const vfpu_vtreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "C001", "C011", "C021", "C031", "C101", "C111", "C121", "C131", -+ "C201", "C211", "C221", "C231", "C301", "C311", "C321", "C331", -+ "C401", "C411", "C421", "C431", "C501", "C511", "C521", "C531", -+ "C601", "C611", "C621", "C631", "C701", "C711", "C721", "C731", -+ "R010", "R011", "R012", "R013", "R110", "R111", "R112", "R113", -+ "R210", "R211", "R212", "R213", "R310", "R311", "R312", "R313", -+ "R410", "R411", "R412", "R413", "R510", "R511", "R512", "R513", -+ "R610", "R611", "R612", "R613", "R710", "R711", "R712", "R713" -+}; -+ -+static const char * const vfpu_vqreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "" -+}; -+ -+static const char * const vfpu_mpreg_names[128] = { -+ "M000", "", "M020", "", "M100", "", "M120", "", -+ "M200", "", "M220", "", "M300", "", "M320", "", -+ "M400", "", "M420", "", "M500", "", "M520", "", -+ "M600", "", "M620", "", "M700", "", "M720", "", -+ "E000", "", "E002", "", "E100", "", "E102", "", -+ "E200", "", "E202", "", "E300", "", "E302", "", -+ "E400", "", "E402", "", "E500", "", "E502", "", -+ "E600", "", "E602", "", "E700", "", "E702", "", -+ "M002", "", "M022", "", "M102", "", "M122", "", -+ "M202", "", "M222", "", "M302", "", "M322", "", -+ "M402", "", "M422", "", "M502", "", "M522", "", -+ "M602", "", "M622", "", "M702", "", "M722", "", -+ "E020", "", "E022", "", "E120", "", "E122", "", -+ "E220", "", "E222", "", "E320", "", "E322", "", -+ "E420", "", "E422", "", "E520", "", "E522", "", -+ "E620", "", "E622", "", "E720", "", "E722", "" -+}; -+ -+static const char * const vfpu_mtreg_names[128] = { -+ "M000", "M010", "", "", "M100", "M110", "", "", -+ "M200", "M210", "", "", "M300", "M310", "", "", -+ "M400", "M410", "", "", "M500", "M510", "", "", -+ "M600", "M610", "", "", "M700", "M710", "", "", -+ "E000", "E001", "", "", "E100", "E101", "", "", -+ "E200", "E201", "", "", "E300", "E301", "", "", -+ "E400", "E401", "", "", "E500", "E501", "", "", -+ "E600", "E601", "", "", "E700", "E701", "", "", -+ "M001", "M011", "", "", "M101", "M111", "", "", -+ "M201", "M211", "", "", "M301", "M311", "", "", -+ "M401", "M411", "", "", "M501", "M511", "", "", -+ "M601", "M611", "", "", "M701", "M711", "", "", -+ "E010", "E011", "", "", "E110", "E111", "", "", -+ "E210", "E211", "", "", "E310", "E311", "", "", -+ "E410", "E411", "", "", "E510", "E511", "", "", -+ "E610", "E611", "", "", "E710", "E711", "", "" -+}; -+ -+static const char * const vfpu_mqreg_names[128] = { -+ "M000", "", "", "", "M100", "", "", "", -+ "M200", "", "", "", "M300", "", "", "", -+ "M400", "", "", "", "M500", "", "", "", -+ "M600", "", "", "", "M700", "", "", "", -+ "E000", "", "", "", "E100", "", "", "", -+ "E200", "", "", "", "E300", "", "", "", -+ "E400", "", "", "", "E500", "", "", "", -+ "E600", "", "", "", "E700", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "" -+}; -+ - static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] = - { - { 16, 1, "c0_config1" }, -@@ -312,6 +445,55 @@ - "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" - }; - -+static const char * const vfpu_cond_names[16] = { -+ "FL", "EQ", "LT", "LE", "TR", "NE", "GE", "GT", -+ "EZ", "EN", "EI", "ES", "NZ", "NN", "NI", "NS" -+}; -+ -+static const char * const vfpu_const_names[20] = { -+ "", -+ "VFPU_HUGE", -+ "VFPU_SQRT2", -+ "VFPU_SQRT1_2", -+ "VFPU_2_SQRTPI", -+ "VFPU_2_PI", -+ "VFPU_1_PI", -+ "VFPU_PI_4", -+ "VFPU_PI_2", -+ "VFPU_PI", -+ "VFPU_E", -+ "VFPU_LOG2E", -+ "VFPU_LOG10E", -+ "VFPU_LN2", -+ "VFPU_LN10", -+ "VFPU_2PI", -+ "VFPU_PI_6", -+ "VFPU_LOG10TWO", -+ "VFPU_LOG2TEN", -+ "VFPU_SQRT3_2" -+}; -+ -+#define VFPU_NUM_CONSTANTS \ -+ ((sizeof vfpu_const_names) / (sizeof (vfpu_const_names[0]))) -+const unsigned int vfpu_num_constants = VFPU_NUM_CONSTANTS; -+ -+static const char * const vfpu_rwb_names[4] = { -+ "wt", "wb", "", "" -+}; -+ -+static const char * const pfx_cst_names[8] = { -+ "0", "1", "2", "1/2", "3", "1/3", "1/4", "1/6" -+}; -+ -+static const char * const pfx_swz_names[4] = { -+ "x", "y", "z", "w" -+}; -+ -+static const char * const pfx_sat_names[4] = { -+ "", "[0:1]", "", "[-1:1]" -+}; -+ -+ - struct mips_abi_choice - { - const char * name; -@@ -387,6 +569,8 @@ - mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, - { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5, - mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, -+ { "allegrex", 1, bfd_mach_mips_allegrex, CPU_ALLEGREX, ISA_MIPS2, -+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, - - /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs. - Note that MIPS-3D and MDMX are not applicable to MIPS32. (See -@@ -1198,6 +1382,349 @@ - case 'Z': - (*info->fprintf_func) (info->stream, "$v%ld", - (l >> OP_SH_FT) & OP_MASK_FT); -+ break; -+ -+ case '?': -+ /* VFPU extensions. */ -+ d++; -+ switch (*d) -+ { -+ case '\0': -+ /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, -+ _("# internal error, incomplete VFPU extension sequence (?)")); -+ return; -+ -+ case 'o': -+ delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA; -+ if (delta & 0x8000) -+ delta |= ~0xffff; -+ (*info->fprintf_func) (info->stream, "%d", -+ delta); -+ break; -+ -+ case '0': -+ case '1': -+ case '2': -+ case '3': -+ { -+ unsigned int pos = *d, base = '0'; -+ unsigned int negation = (l >> (pos - (base - VFPU_SH_PFX_NEG))) & VFPU_MASK_PFX_NEG; -+ unsigned int constant = (l >> (pos - (base - VFPU_SH_PFX_CST))) & VFPU_MASK_PFX_CST; -+ unsigned int abs_consthi = -+ (l >> (pos - (base - VFPU_SH_PFX_ABS_CSTHI))) & VFPU_MASK_PFX_ABS_CSTHI; -+ unsigned int swz_constlo = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SWZ_CSTLO; -+ -+ if (negation) -+ (*info->fprintf_func) (info->stream, "-"); -+ if (constant) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_cst_names[(abs_consthi << 2) | swz_constlo]); -+ } -+ else -+ { -+ if (abs_consthi) -+ (*info->fprintf_func) (info->stream, "|%s|", -+ pfx_swz_names[swz_constlo]); -+ else -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_swz_names[swz_constlo]); -+ } -+ } -+ break; -+ -+ case '4': -+ case '5': -+ case '6': -+ case '7': -+ { -+ unsigned int pos = *d, base = '4'; -+ unsigned int mask = (l >> (pos - (base - VFPU_MASK_PFX_MASK))) & VFPU_MASK_PFX_MASK; -+ unsigned int saturation = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SAT; -+ -+ if (mask) -+ (*info->fprintf_func) (info->stream, "m"); -+ else -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_sat_names[saturation]); -+ } -+ break; -+ -+ case 'a': -+ { -+ unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST; -+ if (c < vfpu_num_constants) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_const_names[c]); -+ } -+ break; -+ } -+ -+ case 'b': -+ /* 5-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5); -+ break; -+ -+ case 'c': -+ /* VFPU condition code. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC); -+ break; -+ -+ case 'e': -+ /* 3-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3); -+ break; -+ -+ case 'f': -+ /* Conditional compare. */ -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_cond_names[(l >> OP_SH_VFPU_COND) & OP_MASK_VFPU_COND]); -+ /* Apparently this specifier is unused. */ -+ d++; -+ break; -+ -+ case 'i': -+ /* 8-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "0x%02lx", -+ (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8); -+ break; -+ -+ case 'q': -+ /* VFPU control register (vmtvc). */ -+ (*info->fprintf_func) (info->stream, "$%ld", -+ (l >> OP_SH_VFPU_VMTVC) & OP_MASK_VFPU_VMTVC); -+ break; -+ -+ case 'r': -+ /* VFPU control register (vmfvc). */ -+ (*info->fprintf_func) (info->stream, "$%ld", -+ (l >> OP_SH_VFPU_VMFVC) & OP_MASK_VFPU_VMFVC); -+ break; -+ -+ case 'u': -+ /* Convert a VFPU 16-bit floating-point number to IEEE754. */ -+ { -+ union float2int { -+ unsigned int i; -+ float f; -+ } float2int; -+ unsigned short float16 = (l >> OP_SH_VFPU_FLOAT16) & OP_MASK_VFPU_FLOAT16; -+ unsigned int sign = (float16 >> VFPU_SH_FLOAT16_SIGN) & VFPU_MASK_FLOAT16_SIGN; -+ int exponent = (float16 >> VFPU_SH_FLOAT16_EXP) & VFPU_MASK_FLOAT16_EXP; -+ unsigned int fraction = float16 & VFPU_MASK_FLOAT16_FRAC; -+ char signchar = '+' + ((sign == 1) * 2); -+ -+ if (exponent == VFPU_FLOAT16_EXP_MAX) -+ { -+ if (fraction == 0) -+ (*info->fprintf_func) (info->stream, "%cInf", signchar); -+ else -+ (*info->fprintf_func) (info->stream, "%cNaN", signchar); -+ } -+ else if (exponent == 0 && fraction == 0) -+ { -+ (*info->fprintf_func) (info->stream, "%c0", signchar); -+ } -+ else -+ { -+ if (exponent == 0) -+ { -+ do -+ { -+ fraction <<= 1; -+ exponent--; -+ } -+ while (!(fraction & (VFPU_MASK_FLOAT16_FRAC + 1))); -+ -+ fraction &= VFPU_MASK_FLOAT16_FRAC; -+ } -+ -+ /* Convert to 32-bit single-precision IEEE754. */ -+ float2int.i = sign << 31; -+ float2int.i |= (exponent + 112) << 23; -+ float2int.i |= fraction << 13; -+ (*info->fprintf_func) (info->stream, "%g", float2int.f); -+ } -+ } -+ break; -+ -+ case 'w': -+ { -+ const char *elements[4]; -+ unsigned int opcode = l & VFPU_MASK_OP_SIZE; -+ unsigned int rotators = (l >> OP_SH_VFPU_ROT) & OP_MASK_VFPU_ROT; -+ unsigned int opsize, rothi, rotlo, negation, i; -+ -+ /* Determine the operand size so we'll know how many elements to output. */ -+ if (opcode == VFPU_OP_SIZE_PAIR) -+ opsize = 2; -+ else if (opcode == VFPU_OP_SIZE_TRIPLE) -+ opsize = 3; -+ else -+ opsize = (opcode == VFPU_OP_SIZE_QUAD) * 4; /* Sanity check. */ -+ -+ rothi = (rotators >> VFPU_SH_ROT_HI) & VFPU_MASK_ROT_HI; -+ rotlo = (rotators >> VFPU_SH_ROT_LO) & VFPU_MASK_ROT_LO; -+ negation = (rotators >> VFPU_SH_ROT_NEG) & VFPU_MASK_ROT_NEG; -+ -+ if (rothi == rotlo) -+ { -+ if (negation) -+ { -+ elements[0] = "-s"; -+ elements[1] = "-s"; -+ elements[2] = "-s"; -+ elements[3] = "-s"; -+ } -+ else -+ { -+ elements[0] = "s"; -+ elements[1] = "s"; -+ elements[2] = "s"; -+ elements[3] = "s"; -+ } -+ } -+ else -+ { -+ elements[0] = "0"; -+ elements[1] = "0"; -+ elements[2] = "0"; -+ elements[3] = "0"; -+ } -+ if (negation) -+ elements[rothi] = "-s"; -+ else -+ elements[rothi] = "s"; -+ elements[rotlo] = "c"; -+ -+ (*info->fprintf_func) (info->stream, "["); -+ i = 0; -+ for (;;) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ elements[i++]); -+ if (i >= opsize) -+ break; -+ (*info->fprintf_func) (info->stream, ","); -+ } -+ (*info->fprintf_func) (info->stream, "]"); -+ } -+ break; -+ -+ case 'd': -+ case 'm': -+ case 'n': -+ case 's': -+ case 't': -+ case 'v': -+ case 'x': -+ { -+ unsigned int vreg = 0; -+ -+ /* The first char specifies the bitfield that contains the register number. */ -+ switch (*d) -+ { -+ case 'd': -+ case 'v': -+ case 'x': -+ vreg = (l >> OP_SH_VFPU_VD) & OP_MASK_VFPU_VD; -+ break; -+ -+ case 'm': -+ /* Combine bits 0-4 of vt with bits 5-6 of vt. */ -+ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO) -+ | ((l & OP_MASK_VFPU_VT_HI2) << OP_SH_VFPU_VT_HI); -+ break; -+ -+ case 'n': -+ /* Combine bits 0-4 of vt with bit 5 of vt. */ -+ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO) -+ | ((l & OP_MASK_VFPU_VT_HI1) << OP_SH_VFPU_VT_HI); -+ break; -+ -+ case 's': -+ { -+ unsigned int temp_vreg = l >> OP_SH_VFPU_VS; -+ -+ vreg = temp_vreg & OP_MASK_VFPU_VS; -+ if ((l & VFPU_OP_VT_VS_VD) == VFPU_OPCODE_VMMUL) -+ { -+ /* vmmul instructions have the RXC bit (bit 13) inverted. */ -+ if (temp_vreg & 0x20) -+ vreg = temp_vreg & 0x5f; -+ else -+ vreg |= 0x20; -+ } -+ } -+ break; -+ -+ case 't': -+ vreg = (l >> OP_SH_VFPU_VT) & OP_MASK_VFPU_VT; -+ break; -+ } -+ -+ /* The next char is the register set vreg comes from. */ -+ d++; -+ switch (*d) -+ { -+ case '0': -+ (*info->fprintf_func) (info->stream, "%s.s", -+ vfpu_sreg_names[vreg]); -+ break; -+ -+ case '1': -+ (*info->fprintf_func) (info->stream, "%s.p", -+ vfpu_vpreg_names[vreg]); -+ break; -+ -+ case '2': -+ (*info->fprintf_func) (info->stream, "%s.t", -+ vfpu_vtreg_names[vreg]); -+ break; -+ -+ case '3': -+ (*info->fprintf_func) (info->stream, "%s.q", -+ vfpu_vqreg_names[vreg]); -+ break; -+ -+ case '5': -+ (*info->fprintf_func) (info->stream, "%s.p", -+ vfpu_mpreg_names[vreg]); -+ break; -+ -+ case '6': -+ (*info->fprintf_func) (info->stream, "%s.t", -+ vfpu_mtreg_names[vreg]); -+ break; -+ -+ case '7': -+ (*info->fprintf_func) (info->stream, "%s.q", -+ vfpu_mqreg_names[vreg]); -+ break; -+ -+ default: -+ /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, -+ _("# internal error, undefined vreg modifier(%c)"), -+ *d); -+ break; -+ } -+ -+ /* The last char is unused for disassembly. */ -+ d++; -+ } -+ break; -+ -+ case 'z': -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_rwb_names[(l >> OP_SH_VFPU_RWB) & OP_MASK_VFPU_RWB]); -+ break; -+ } - break; - - default: -diff -Nbaur gdb-6.6/opcodes/mips-opc.c gdb-6.6-psp/opcodes/mips-opc.c ---- gdb-6.6/opcodes/mips-opc.c Tue Jun 6 11:49:48 2006 -+++ gdb-6.6-psp/opcodes/mips-opc.c Fri Jun 15 16:17:50 2007 -@@ -112,6 +112,7 @@ - #define N5 (INSN_5400 | INSN_5500) - #define N54 INSN_5400 - #define N55 INSN_5500 -+#define AL INSN_ALLEGREX - - #define G1 (T3 \ - ) -@@ -299,6 +300,7 @@ - {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 }, - {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 }, - {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 }, -+{"break", "B", 0x0000000d, 0xfc00003f, TRAP, 0, I32|AL }, - {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 }, - {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 }, - {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 }, -@@ -465,8 +467,8 @@ - {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 }, - {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 }, - {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 }, --{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3}, --{"cache", "k,A(b)", 0, (int) M_CACHE_AB, INSN_MACRO, 0, I3|I32|T3}, -+{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3|AL}, -+{"cache", "k,A(b)", 0, (int) M_CACHE_AB, INSN_MACRO, 0, I3|I32|T3|AL}, - {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 }, - {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 }, - {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, -@@ -480,7 +482,9 @@ - {"cftc1", "d,T", 0x41000023, 0xffe007ff, TRAP|LCD|WR_d|RD_C1|FP_S, 0, MT32 }, - {"cftc2", "d,E", 0x41000025, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 }, - {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, -+{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL }, - {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, -+{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL }, - {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 }, - {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, - {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, -@@ -505,13 +509,15 @@ - {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_S|FP_D, 0, I5|I33 }, - {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D }, - {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 }, -+{"max", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, - {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, - {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 }, - {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 }, - {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 }, -+{"min", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, - {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, - {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 }, --{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 }, -+{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5|AL }, - {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, - {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, - /* dctr and dctw are used on the r5000. */ -@@ -598,7 +604,7 @@ - {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 }, - {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, 0, I3 }, - {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, 0, I3 }, --{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5 }, -+{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5|AL }, - {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 }, - {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 }, - {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 }, -@@ -639,16 +645,16 @@ - {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 }, - {"emt", "", 0x41600be1, 0xffffffff, TRAP, 0, MT32 }, - {"emt", "t", 0x41600be1, 0xffe0ffff, TRAP|WR_t, 0, MT32 }, --{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32 }, -+{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32|AL }, - {"evpe", "", 0x41600021, 0xffffffff, TRAP, 0, MT32 }, - {"evpe", "t", 0x41600021, 0xffe0ffff, TRAP|WR_t, 0, MT32 }, --{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 }, -+{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, - {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 }, - {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 }, - {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, - {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 }, - {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 }, --{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 }, -+{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, - {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, - /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with - the same hazard barrier effect. */ -@@ -686,18 +692,10 @@ - {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 }, - {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 }, - {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 }, --{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, --{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, --{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, --{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, --{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ --{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, --{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, --{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, --{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, --{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, -+/* ldc1 is at the bottom of the table. */ -+/* ldc2 is at the bottom of the table. */ -+/* ldc3 is at the bottom of the table. */ -+{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3|AL }, - {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 }, - {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, - {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 }, -@@ -727,8 +725,7 @@ - {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, - {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */ - {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, --{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, --{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, -+/* lwc2 is at the bottom of the table. */ - {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, - {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 }, - {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 }, -@@ -762,11 +759,13 @@ - {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 }, - {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 }, - {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, - {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 }, - {"maddp", "s,t", 0x70000441, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, SMT }, - {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, - {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 }, -@@ -806,7 +805,7 @@ - /* mfc2 is at the bottom of the table. */ - /* mfhc2 is at the bottom of the table. */ - /* mfc3 is at the bottom of the table. */ --{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5 }, -+{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5|AL }, - {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 }, - {"mfhi", "d,9", 0x00000010, 0xff9f07ff, WR_d|RD_HI, 0, D32 }, - {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 }, -@@ -826,7 +825,7 @@ - {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, - {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 }, - {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5|I33 }, --{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 }, -+{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL }, - {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, - {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 }, - {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, -@@ -839,7 +838,7 @@ - {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, - {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 }, - {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5|I33 }, --{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 }, -+{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL }, - {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, - {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 }, - {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, -@@ -856,8 +855,10 @@ - {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4|I33 }, - {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5|I33 }, - {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"msub", "s,t", 0x0000002e, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"msubu", "s,t", 0x0000002f, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, - {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, -@@ -871,7 +872,7 @@ - /* mtc2 is at the bottom of the table. */ - /* mthc2 is at the bottom of the table. */ - /* mtc3 is at the bottom of the table. */ --{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5 }, -+{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5|AL }, - {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 }, - {"mthi", "s,7", 0x00000011, 0xfc1fe7ff, RD_s|WR_HI, 0, D32 }, - {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 }, -@@ -1028,13 +1029,13 @@ - {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 }, - {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 }, - {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 }, --{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|SMT }, --{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|SMT }, --{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|SMT }, --{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|SMT }, --{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|SMT }, --{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|SMT }, --{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|SMT }, -+{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|SMT|AL }, -+{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|SMT|AL }, -+{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|SMT|AL }, - {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3|I33 }, - {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3|I33 }, - {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, -@@ -1066,24 +1067,18 @@ - {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 }, - {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 }, - {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 }, --{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, --{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, --{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, --{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, --{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, --{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, --{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, --{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, --{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, -+/* sdc1 is at the bottom of the table. */ -+/* sdc2 is at the bottom of the table. */ -+/* sdc3 is at the bottom of the table. */ -+/* s.d (sdc1 is at the bottom of the table. */ -+ -+{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3|AL }, - {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 }, - {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, - {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 }, - {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_D, 0, I4|I33 }, --{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 }, --{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 }, -+{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, -+{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, - {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, - {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, - {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 }, -@@ -1175,8 +1170,7 @@ - {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, - {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */ - {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, --{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, --{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, -+/* swc2 is at the bottom of the table. */ - {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 }, - {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 }, - {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 }, -@@ -1260,7 +1254,8 @@ - {"wait", "J", 0x42000020, 0xfe00003f, TRAP, 0, I32|N55 }, - {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 }, - {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 }, --{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 }, -+{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, -+{"wsbw", "d,t", 0x7c0000e0, 0xffe007ff, WR_d|RD_t, 0, AL }, - {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 }, - {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 }, - {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 }, -@@ -1338,6 +1333,319 @@ - {"udi15", "s,+3", 0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, - {"udi15", "+4", 0x7000001f, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, - -+/* Sony Allegrex CPU core. */ -+{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL }, -+{"mfic", "t,G", 0x70000024, 0xffe007ff, LCD|WR_t|RD_C0, 0, AL }, -+{"mtic", "t,G", 0x70000026, 0xffe007ff, COD|RD_t|WR_C0, 0, AL }, -+ -+/* Sony Allegrex VFPU instructions. */ -+{"bvf", "?c,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, AL }, -+{"bvfl", "?c,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, AL }, -+{"bvt", "?c,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, AL }, -+{"bvtl", "?c,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, AL }, -+{"lv.s", "?m0x,?o(b)", 0xc8000000, 0xfc000000, CLD|RD_s|WR_CC, 0, AL }, -+{"lv.s", "?m0x,A(b)", 0, (int) M_LVQ_AB, INSN_MACRO, 0, AL }, -+{"ulv.s", "?m0x,o(b)", 0, (int) M_ULVS, INSN_MACRO, 0, AL }, -+{"lv.q", "?n3x,?o(b)", 0xd8000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lv.q", "?n3x,A(b)", 0, (int) M_LVQ_AB_2, INSN_MACRO, 0, AL }, -+{"ulv.q", "?n3x,?o(b)", 0, (int) M_ULVQ, INSN_MACRO, 0, AL }, -+{"ulv.q", "?n3x,A(b)", 0, (int) M_ULVQ_AB, INSN_MACRO, 0, AL }, -+{"lvi.s", "?t0x,l?y0", 0, (int) M_LVIS, INSN_MACRO, 0, AL }, -+{"lvi.p", "?t1x,?[l?y0,l?y1?]", 0, (int) M_LVIP, INSN_MACRO, 0, AL }, -+{"lvi.t", "?t2x,?[l?y0,l?y1,l?y2?]", 0, (int) M_LVIT, INSN_MACRO, 0, AL }, -+{"lvi.q", "?t3x,?[l?y0,l?y1,l?y2,l?y3?]", 0, (int) M_LVIQ, INSN_MACRO, 0, AL }, -+{"lvhi.s", "?t0x,?[?u?y0,?u?y1?]", 0, (int) M_LVHIS, INSN_MACRO, 0, AL }, -+{"lvhi.p", "?t1x,?[?u?y0,?u?y1,?u?y2,?u?y3?]", 0, (int) M_LVHIP, INSN_MACRO, 0, AL }, -+{"sv.s", "?m0x,?o(b)", 0xe8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL }, -+{"sv.s", "?m0x,A(b)", 0, (int) M_SVS_AB, INSN_MACRO, 0, AL }, -+{"usv.s", "?m0x,o(b)", 0, (int) M_USVS, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,?o(b)", 0xf8000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"sv.q", "?n3x,?o(b),?z", 0xf8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL }, -+{"sv.q", "?n3x,A(b)", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,A(b),?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,A,?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"usv.q", "?n3x,?o(b)", 0, (int) M_USVQ, INSN_MACRO, 0, AL }, -+{"usv.q", "?n3x,A(b)", 0, (int) M_USVQ_AB, INSN_MACRO, 0, AL }, -+{"vwb.q", "?n3x,?o(b)", 0xf8000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"lvl.q", "?n3x,?o(b)", 0xd4000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lvl.q", "?n3x,A(b)", 0, (int) M_LVLQ_AB, INSN_MACRO, 0, AL }, -+{"lvr.q", "?n3x,?o(b)", 0xd4000002, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lvr.q", "?n3x,A(b)", 0, (int) M_LVRQ_AB, INSN_MACRO, 0, AL }, -+{"svl.q", "?n3x,?o(b)", 0xf4000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"svl.q", "?n3x,A(b)", 0, (int) M_SVLQ_AB, INSN_MACRO, 0, AL }, -+{"svr.q", "?n3x,?o(b)", 0xf4000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"svr.q", "?n3x,A(b)", 0, (int) M_SVRQ_AB, INSN_MACRO, 0, AL }, -+{"mtv", "t,?d0z", 0x48e00000, 0xffe0ff80, LCD|WR_t|WR_C2, 0, AL }, -+{"mfv", "t,?d0z", 0x48600000, 0xffe0ff80, COD|RD_t|WR_CC|RD_C2, 0, AL }, -+{"mtvc", "t,?q", 0x48e00000, 0xffe0ff00, LCD|WR_t|WR_C2, 0, AL }, -+{"mfvc", "t,?q", 0x48600000, 0xffe0ff00, COD|RD_t|WR_CC|RD_C2, 0, AL }, -+{"vmtvc", "?q,?s0y", 0xd0510000, 0xffff8000, WR_C2, 0, AL }, -+{"vmfvc", "?d0z,?r", 0xd0500000, 0xffff0080, RD_C2, 0, AL }, -+{"vadd.q", "?d3d,?s3s,?t3t", 0x60008080, 0xff808080, RD_C2, 0, AL }, -+{"vsub.q", "?d3d,?s3s,?t3t", 0x60808080, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.q", "?x3z,?s3y,?t3x", 0x63808080, 0xff808080, RD_C2, 0, AL }, -+{"vmul.q", "?d3d,?s3s,?t3t", 0x64008080, 0xff808080, RD_C2, 0, AL }, -+{"vdot.q", "?d0d,?s3s,?t3t", 0x64808080, 0xff808080, RD_C2, 0, AL }, -+{"vscl.q", "?d3d,?s3s,?t0x", 0x65008080, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.q", "?d0d,?s3y,?t3t", 0x66008080, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.q", "?f2,?s3s,?t3t", 0x6c008080, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.q", "?f1,?s3s", 0x6c008080, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.q", "?f0", 0x6c008080, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.q", "?d3d,?s3s,?t3t", 0x6d008080, 0xff808080, RD_C2, 0, AL }, -+{"vmax.q", "?d3d,?s3s,?t3t", 0x6d808080, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.q", "?d3d,?s3s", 0xd04a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.q", "?d3d,?a", 0xd0608080, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.q", "?d3d,?s3s,?t3t", 0x6e808080, 0xff808080, RD_C2, 0, AL }, -+{"vsge.q", "?d3d,?s3s,?t3t", 0x6f008080, 0xff808080, RD_C2, 0, AL }, -+{"vslt.q", "?d3d,?s3s,?t3t", 0x6f808080, 0xff808080, RD_C2, 0, AL }, -+{"vi2uc.q", "?d0m,?s3w", 0xd03c8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2c.q", "?d0m,?s3w", 0xd03d8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2us.q", "?d1m,?s3w", 0xd03e8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2s.q", "?d1m,?s3w", 0xd03f8080, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.q", "?d3d,?s3s", 0xd0008080, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.q", "?d3d,?s3w", 0xd0018080, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.q", "?d3d,?s3w", 0xd0028080, 0xffff8080, RD_C2, 0, AL }, -+{"vidt.q", "?d3d", 0xd0038080, 0xffffff80, RD_C2, 0, AL }, -+{"vsat0.q", "?d3z,?s3s", 0xd0048080, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.q", "?d3z,?s3s", 0xd0058080, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.q", "?d3d", 0xd0068080, 0xffffff80, RD_C2, 0, AL }, -+{"vone.q", "?d3d", 0xd0078080, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.q", "?x3z,?s3y", 0xd0108080, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.q", "?x3z,?s3y", 0xd0118080, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.q", "?x3z,?s3y", 0xd0128080, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.q", "?x3z,?s3y", 0xd0138080, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.q", "?x3z,?s3y", 0xd0148080, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.q", "?x3z,?s3y", 0xd0158080, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.q", "?x3z,?s3y", 0xd0168080, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.q", "?x3z,?s3y", 0xd0178080, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.q", "?x3z,?s3y", 0xd0188080, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.q", "?x3z,?s3y", 0xd01a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.q", "?x3z,?s3y", 0xd01c8080, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.q", "?d3z", 0xd0218080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.q", "?d3z", 0xd0228080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.q", "?d3z", 0xd0238080, 0xffffff80, RD_C2, 0, AL }, -+{"vf2h.q", "?d1m,?s3s", 0xd0328080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt1.q", "?d3d,?s3s", 0xd0408080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt2.q", "?d3d,?s3s", 0xd0418080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt3.q", "?d3d,?s3s", 0xd0488080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt4.q", "?d3d,?s3s", 0xd0498080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy1.q", "?d3d,?s3s", 0xd0428080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy2.q", "?d3d,?s3s", 0xd0438080, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.q", "?d3d,?s3y", 0xd0448080, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.q", "?d0d,?s3s", 0xd0468080, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.q", "?d0d,?s3s", 0xd0478080, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.q", "?d3m,?s3s,?b", 0xd2008080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.q", "?d3m,?s3s,?b", 0xd2208080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.q", "?d3m,?s3s,?b", 0xd2408080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.q", "?d3m,?s3s,?b", 0xd2608080, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.q", "?d3d,?s3w,?b", 0xd2808080, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.q", "?d3d,?s3s,?e", 0, (int) M_VCMOVQ, INSN_MACRO, 0, AL }, -+{"vcmovt.q", "?d3d,?s3s,?e", 0xd2a08080, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.q", "?d3d,?s3s,?e", 0xd2a88080, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.q", "?v7z,?s7y,?t7x", 0xf0008080, 0xff808080, RD_C2, 0, AL }, -+{"vtfm4.q", "?v3z,?s7y,?t3x", 0xf1808080, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm4.q", "?v3z,?s7y,?t3x", 0xf1808000, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.q", "?x7z,?s7y,?t0x", 0xf2008080, 0xff808080, RD_C2, 0, AL }, -+{"vqmul.q", "?v3z,?s3y,?t3x", 0xf2808080, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.q", "?x7z,?s7y", 0xf3808080, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.q", "?d7z", 0xf3838080, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.q", "?d7z", 0xf3868080, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.q", "?d7z", 0xf3878080, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.q", "?x3z,?s0y,?w", 0xf3a08080, 0xffe08080, RD_C2, 0, AL }, -+{"vt4444.q", "?d1z,?s3w", 0xd0598080, 0xffff8080, RD_C2, 0, AL }, -+{"vt5551.q", "?d1z,?s3w", 0xd05a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vt5650.q", "?d1z,?s3w", 0xd05b8080, 0xffff8080, RD_C2, 0, AL }, -+{"vadd.t", "?d2d,?s2s,?t2t", 0x60008000, 0xff808080, RD_C2, 0, AL }, -+{"vsub.t", "?d2d,?s2s,?t2t", 0x60808000, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.t", "?x2z,?s2y,?t2x", 0x63808000, 0xff808080, RD_C2, 0, AL }, -+{"vmul.t", "?d2d,?s2s,?t2t", 0x64008000, 0xff808080, RD_C2, 0, AL }, -+{"vdot.t", "?d0d,?s2s,?t2t", 0x64808000, 0xff808080, RD_C2, 0, AL }, -+{"vscl.t", "?d2d,?s2s,?t0x", 0x65008000, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.t", "?d0d,?s2y,?t2t", 0x66008000, 0xff808080, RD_C2, 0, AL }, -+{"vcrs.t", "?d2d,?s2y,?t2x", 0x66808000, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.t", "?f2,?s2s,?t2t", 0x6c008000, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.t", "?f1,?s2s", 0x6c008000, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.t", "?f0", 0x6c008000, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.t", "?d2d,?s2s,?t2t", 0x6d008000, 0xff808080, RD_C2, 0, AL }, -+{"vmax.t", "?d2d,?s2s,?t2t", 0x6d808000, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.t", "?d2d,?s2s", 0xd04a8000, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.t", "?d2d,?a", 0xd0608000, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.t", "?d2d,?s2s,?t2t", 0x6e808000, 0xff808080, RD_C2, 0, AL }, -+{"vsge.t", "?d2d,?s2s,?t2t", 0x6f008000, 0xff808080, RD_C2, 0, AL }, -+{"vslt.t", "?d2d,?s2s,?t2t", 0x6f808000, 0xff808080, RD_C2, 0, AL }, -+{"vmov.t", "?d2d,?s2s", 0xd0008000, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.t", "?d2d,?s2w", 0xd0018000, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.t", "?d2d,?s2w", 0xd0028000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat0.t", "?d2z,?s2s", 0xd0048000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.t", "?d2z,?s2s", 0xd0058000, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.t", "?d2d", 0xd0068000, 0xffffff80, RD_C2, 0, AL }, -+{"vone.t", "?d2d", 0xd0078000, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.t", "?x2z,?s2y", 0xd0108000, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.t", "?x2z,?s2y", 0xd0118000, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.t", "?x2z,?s2y", 0xd0128000, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.t", "?x2z,?s2y", 0xd0138000, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.t", "?x2z,?s2y", 0xd0148000, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.t", "?x2z,?s2y", 0xd0158000, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.t", "?x2z,?s2y", 0xd0168000, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.t", "?x2z,?s2y", 0xd0178000, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.t", "?x2z,?s2y", 0xd0188000, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.t", "?x2z,?s2y", 0xd01a8000, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.t", "?x2z,?s2y", 0xd01c8000, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.t", "?d2z", 0xd0218000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.t", "?d2z", 0xd0228000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.t", "?d2z", 0xd0238000, 0xffffff80, RD_C2, 0, AL }, -+{"vocp.t", "?d2d,?s2y", 0xd0448000, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.t", "?d0d,?s2s", 0xd0468000, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.t", "?d0d,?s2s", 0xd0478000, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.t", "?d2m,?s2s,?b", 0xd2008000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.t", "?d2m,?s2s,?b", 0xd2208000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.t", "?d2m,?s2s,?b", 0xd2408000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.t", "?d2m,?s2s,?b", 0xd2608000, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.t", "?d2d,?s2w,?b", 0xd2808000, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.t", "?d2d,?s2s,?e", 0, (int) M_VCMOVT, INSN_MACRO, 0, AL }, -+{"vcmovt.t", "?d2d,?s2s,?e", 0xd2a08000, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.t", "?d2d,?s2s,?e", 0xd2a88000, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.t", "?v6z,?s6y,?t6x", 0xf0008000, 0xff808080, RD_C2, 0, AL }, -+{"vtfm3.t", "?v2z,?s6y,?t2x", 0xf1008000, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm3.t", "?v2z,?s6y,?t2x", 0xf1000080, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.t", "?x6z,?s6y,?t0x", 0xf2008000, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.t", "?x6z,?s6y", 0xf3808000, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.t", "?d6z", 0xf3838000, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.t", "?d6z", 0xf3868000, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.t", "?d6z", 0xf3878000, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.t", "?x2z,?s0y,?w", 0xf3a08000, 0xffe08080, RD_C2, 0, AL }, -+{"vcrsp.t", "?d2z,?s2y,?t2x", 0xf2808000, 0xff808080, RD_C2, 0, AL }, -+{"vadd.p", "?d1d,?s1s,?t1t", 0x60000080, 0xff808080, RD_C2, 0, AL }, -+{"vsub.p", "?d1d,?s1s,?t1t", 0x60800080, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.p", "?x1z,?s1y,?t1x", 0x63800080, 0xff808080, RD_C2, 0, AL }, -+{"vmul.p", "?d1d,?s1s,?t1t", 0x64000080, 0xff808080, RD_C2, 0, AL }, -+{"vdot.p", "?d0d,?s1s,?t1t", 0x64800080, 0xff808080, RD_C2, 0, AL }, -+{"vscl.p", "?d1d,?s1s,?t0x", 0x65000080, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.p", "?d0d,?s1y,?t1t", 0x66000080, 0xff808080, RD_C2, 0, AL }, -+{"vdet.p", "?d0d,?s1s,?t1x", 0x67000080, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.p", "?f2,?s1s,?t1t", 0x6c000080, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.p", "?f1,?s1s", 0x6c000080, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.p", "?f0", 0x6c000080, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.p", "?d1d,?s1s,?t1t", 0x6d000080, 0xff808080, RD_C2, 0, AL }, -+{"vmax.p", "?d1d,?s1s,?t1t", 0x6d800080, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.p", "?d1d,?s1s", 0xd04a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.p", "?d1d,?a", 0xd0600080, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.p", "?d1d,?s1s,?t1t", 0x6e800080, 0xff808080, RD_C2, 0, AL }, -+{"vsge.p", "?d1d,?s1s,?t1t", 0x6f000080, 0xff808080, RD_C2, 0, AL }, -+{"vslt.p", "?d1d,?s1s,?t1t", 0x6f800080, 0xff808080, RD_C2, 0, AL }, -+{"vus2i.p", "?d3m,?s1y", 0xd03a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vs2i.p", "?d3m,?s1y", 0xd03b0080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2us.p", "?d0m,?s1w", 0xd03e0080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2s.p", "?d0m,?s1w", 0xd03f0080, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.p", "?d1d,?s1s", 0xd0000080, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.p", "?d1d,?s1w", 0xd0010080, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.p", "?d1d,?s1w", 0xd0020080, 0xffff8080, RD_C2, 0, AL }, -+{"vidt.p", "?d1d", 0xd0030080, 0xffffff80, RD_C2, 0, AL }, -+{"vsat0.p", "?d1z,?s1s", 0xd0040080, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.p", "?d1z,?s1s", 0xd0050080, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.p", "?d1d", 0xd0060080, 0xffffff80, RD_C2, 0, AL }, -+{"vone.p", "?d1d", 0xd0070080, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.p", "?x1z,?s1y", 0xd0100080, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.p", "?x1z,?s1y", 0xd0110080, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.p", "?x1z,?s1y", 0xd0120080, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.p", "?x1z,?s1y", 0xd0130080, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.p", "?x1z,?s1y", 0xd0140080, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.p", "?x1z,?s1y", 0xd0150080, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.p", "?x1z,?s1y", 0xd0160080, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.p", "?x1z,?s1y", 0xd0170080, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.p", "?x1z,?s1y", 0xd0180080, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.p", "?x1z,?s1y", 0xd01a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.p", "?x1z,?s1y", 0xd01c0080, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.p", "?d1z", 0xd0210080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.p", "?d1z", 0xd0220080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.p", "?d1z", 0xd0230080, 0xffffff80, RD_C2, 0, AL }, -+{"vf2h.p", "?d0m,?s1s", 0xd0320080, 0xffff8080, RD_C2, 0, AL }, -+{"vh2f.p", "?d3d,?s1y", 0xd0330080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy1.p", "?d1d,?s1s", 0xd0420080, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.p", "?d1d,?s1y", 0xd0440080, 0xffff8080, RD_C2, 0, AL }, -+{"vsocp.p", "?d3z,?s1y", 0xd0450080, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.p", "?d0d,?s1s", 0xd0460080, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.p", "?d0d,?s1s", 0xd0470080, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.p", "?d1m,?s1s,?b", 0xd2000080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.p", "?d1m,?s1s,?b", 0xd2200080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.p", "?d1m,?s1s,?b", 0xd2400080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.p", "?d1m,?s1s,?b", 0xd2600080, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.p", "?d1d,?s1w,?b", 0xd2800080, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.p", "?d1d,?s1s,?e", 0, (int) M_VCMOVP, INSN_MACRO, 0, AL }, -+{"vcmovt.p", "?d1d,?s1s,?e", 0xd2a00080, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.p", "?d1d,?s1s,?e", 0xd2a80080, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.p", "?v5z,?s5y,?t5x", 0xf0000080, 0xff808080, RD_C2, 0, AL }, -+{"vtfm2.p", "?v1z,?s5y,?t1x", 0xf0800080, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm2.p", "?v1z,?s5y,?t1x", 0xf0800000, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.p", "?x5z,?s5y,?t0x", 0xf2000080, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.p", "?x5z,?s5y", 0xf3800080, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.p", "?d5z", 0xf3830080, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.p", "?d5z", 0xf3860080, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.p", "?d5z", 0xf3870080, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.p", "?x1z,?s0y,?w", 0xf3a00080, 0xffe08080, RD_C2, 0, AL }, -+{"vadd.s", "?d0d,?s0s,?t0t", 0x60000000, 0xff808080, RD_C2, 0, AL }, -+{"vsub.s", "?d0d,?s0s,?t0t", 0x60800000, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.s", "?x0d,?s0s,?t0t", 0x63800000, 0xff808080, RD_C2, 0, AL }, -+{"vmul.s", "?d0d,?s0s,?t0t", 0x64000000, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.s", "?f2,?s0s,?t0t", 0x6c000000, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.s", "?f1,?s0s", 0x6c000000, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.s", "?f0", 0x6c000000, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.s", "?d0d,?s0s,?t0t", 0x6d000000, 0xff808080, RD_C2, 0, AL }, -+{"vmax.s", "?d0d,?s0s,?t0t", 0x6d800000, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.s", "?d0d,?s0s", 0xd04a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.s", "?d0d,?a", 0xd0600000, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.s", "?d0d,?s0s,?t0t", 0x6e800000, 0xff808080, RD_C2, 0, AL }, -+{"vsge.s", "?d0d,?s0s,?t0t", 0x6f000000, 0xff808080, RD_C2, 0, AL }, -+{"vslt.s", "?d0d,?s0s,?t0t", 0x6f800000, 0xff808080, RD_C2, 0, AL }, -+{"vus2i.s", "?d1m,?s0y", 0xd03a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vs2i.s", "?d1m,?s0y", 0xd03b0000, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.s", "?d0d,?s0s", 0xd0000000, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.s", "?d0d,?s0w", 0xd0010000, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.s", "?d0d,?s0w", 0xd0020000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat0.s", "?d0z,?s0s", 0xd0040000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.s", "?d0z,?s0s", 0xd0050000, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.s", "?d0d", 0xd0060000, 0xffffff80, RD_C2, 0, AL }, -+{"vone.s", "?d0d", 0xd0070000, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.s", "?x0d,?s0s", 0xd0100000, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.s", "?x0d,?s0s", 0xd0110000, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.s", "?x0d,?s0s", 0xd0120000, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.s", "?x0d,?s0s", 0xd0130000, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.s", "?x0d,?s0s", 0xd0140000, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.s", "?x0d,?s0s", 0xd0150000, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.s", "?x0d,?s0s", 0xd0160000, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.s", "?x0d,?s0s", 0xd0170000, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.s", "?x0d,?s0y", 0xd0180000, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.s", "?x0d,?s0y", 0xd01a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.s", "?x0d,?s0y", 0xd01c0000, 0xffff8080, RD_C2, 0, AL }, -+{"vrnds.s", "?s0y", 0xd0200000, 0xffff80ff, RD_C2, 0, AL }, -+{"vrndi.s", "?d0d", 0xd0210000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.s", "?d0d", 0xd0220000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.s", "?d0d", 0xd0230000, 0xffffff80, RD_C2, 0, AL }, -+{"vh2f.s", "?d1d,?s0y", 0xd0330000, 0xffff8080, RD_C2, 0, AL }, -+{"vsbz.s", "?d0d,?s0s", 0xd0360000, 0xffff8080, RD_C2, 0, AL }, -+{"vsbn.s", "?d0d,?s0s,?t0t", 0x61000000, 0xff808080, RD_C2, 0, AL }, -+{"vlgb.s", "?d0d,?s0s", 0xd0370000, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.s", "?d0d,?s0y", 0xd0440000, 0xffff8080, RD_C2, 0, AL }, -+{"vsocp.s", "?d1z,?s0y", 0xd0450000, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.s", "?d0m,?s0s,?b", 0xd2000000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.s", "?d0m,?s0s,?b", 0xd2200000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.s", "?d0m,?s0s,?b", 0xd2400000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.s", "?d0m,?s0s,?b", 0xd2600000, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.s", "?d0d,?s0w,?b", 0xd2800000, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.s", "?d0d,?s0s,?e", 0, (int) M_VCMOVS, INSN_MACRO, 0, AL }, -+{"vcmovt.s", "?d0d,?s0s,?e", 0xd2a00000, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.s", "?d0d,?s0s,?e", 0xd2a80000, 0xfff88080, RD_C2, 0, AL }, -+{"vwbn.s", "?d0d,?s0s,?i", 0xd3000000, 0xff008080, RD_C2, 0, AL }, -+{"vpfxs", "?0,?1,?2,?3", 0xdc000000, 0xff000000, RD_C2, 0, AL }, -+{"vpfxt", "?0,?1,?2,?3", 0xdd000000, 0xff000000, RD_C2, 0, AL }, -+{"vpfxd", "?4,?5,?6,?7", 0xde000000, 0xff000000, RD_C2, 0, AL }, -+{"viim.s", "?t0d,j", 0xdf000000, 0xff800000, RD_C2, 0, AL }, -+{"vfim.s", "?t0d,?u", 0xdf800000, 0xff800000, RD_C2, 0, AL }, -+{"vnop", "", 0xffff0000, 0xffffffff, RD_C2, 0, AL }, -+{"vflush", "", 0xffff040d, 0xffffffff, RD_C2, 0, AL }, -+{"vsync", "", 0xffff0320, 0xffffffff, RD_C2, 0, AL }, -+{"vsync", "i", 0xffff0000, 0xffff0000, RD_C2, 0, AL }, -+ - /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format - instructions so they are here for the latters to take precedence. */ - {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, 0, I1 }, -@@ -1379,6 +1687,36 @@ - {"mfc3", "t,G,H", 0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3, 0, I32 }, - {"mtc3", "t,G", 0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, 0, I1 }, - {"mtc3", "t,G,H", 0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, 0, I32 }, -+ -+/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU -+ instructions so they are here for the latters to take precedence. */ -+/* COP1 ldc1 and sdc1 and COP3 ldc3 and sdc3 also overlap with the VFPU. */ -+{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, -+{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, -+{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, -+{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, -+{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ -+{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, -+{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, -+{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, -+{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, -+{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, -+{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, -+{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, -+{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, -+{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, -+{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, -+{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, -+{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, -+{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, -+{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, -+{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, -+{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, - - /* No hazard protection on coprocessor instructions--they shouldn't - change the state of the processor and if they do it's up to the -diff -Nbaur gdb-6.6/sim/common/sim-signal.c gdb-6.6-psp/sim/common/sim-signal.c ---- gdb-6.6/sim/common/sim-signal.c Tue Nov 29 02:43:06 2005 -+++ gdb-6.6-psp/sim/common/sim-signal.c Fri Jun 15 16:17:50 2007 -@@ -27,7 +27,7 @@ - to not think the process has died (so it can be debugged at the point of - failure). */ - --#ifdef _MSC_VER -+#if defined(_MSC_VER) || defined (__MINGW32__) - #ifndef SIGTRAP - #define SIGTRAP 5 - #endif diff --git a/dkpsp/patches/newlib-1.14.0.patch b/dkpsp/patches/newlib-1.14.0.patch deleted file mode 100644 index 1227057..0000000 --- a/dkpsp/patches/newlib-1.14.0.patch +++ /dev/null @@ -1,8016 +0,0 @@ ---- newlib-1.13.0/config.sub 2004-11-15 20:18:39.000000000 -0500 -+++ newlib-psp/config.sub 2005-07-24 01:06:05.000000000 -0400 -@@ -253,6 +253,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ -@@ -326,6 +327,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ -@@ -665,6 +667,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; ---- newlib-1.13.0/configure 2004-12-16 14:51:28.000000000 -0500 -+++ newlib-psp/configure 2005-07-24 01:06:05.000000000 -0400 -@@ -1507,6 +1507,9 @@ - mips*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ mipsallegrex*-*-*) -+ noconfigdirs="$noconfigdirs target-libgloss" -+ ;; - mips*-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" - ;; ---- newlib-1.13.0/configure.in 2004-12-16 14:51:28.000000000 -0500 -+++ newlib-psp/configure.in 2005-07-24 01:06:05.000000000 -0400 -@@ -716,6 +716,9 @@ - mips*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ mipsallegrex*-*-*) -+ noconfigdirs="$noconfigdirs target-libgloss" -+ ;; - mips*-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" - ;; ---- newlib-1.13.0/newlib/Makefile.am 2004-12-03 18:46:28.000000000 -0500 -+++ newlib-psp/newlib/Makefile.am 2005-12-12 19:16:32.000000000 -0500 -@@ -251,6 +251,18 @@ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ - else true; fi ; \ - done; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ - $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ - for i in $(srcdir)/libc/include/sys/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ ---- newlib-1.13.0/newlib/Makefile.in 2004-12-03 18:46:28.000000000 -0500 -+++ newlib-psp/newlib/Makefile.in 2005-12-12 19:16:32.000000000 -0500 -@@ -214,7 +214,7 @@ - - DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - --TAR = gtar -+TAR = tar - GZIP_ENV = --best - DIST_SUBDIRS = libc libm doc . @EXTRA_DIRS@ - EXPECT = `if test -f $(top_builddir)/../expect/expect; then echo $(top_builddir)/../expect/expect; else echo expect; fi` -@@ -472,7 +472,7 @@ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)newlib.hin$$unique$(LISP)$$tags" \ -- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags newlib.hin $$unique $(LISP) -o $$here/TAGS) -+ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags newlib.hin $$unique $(LISP)) - - mostlyclean-tags: - -@@ -756,6 +756,18 @@ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \ - else true; fi ; \ - done; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ - $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ - for i in $(srcdir)/libc/include/sys/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ ---- newlib-1.13.0/newlib/configure.host 2004-10-05 15:44:24.000000000 -0400 -+++ newlib-psp/newlib/configure.host 2006-04-28 09:34:11.000000000 -0400 -@@ -570,7 +570,14 @@ - ;; - mips*-*-elf*) - default_newlib_io_long_long="yes" -- newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" -+ case "${host}" in -+ mipsallegrex*-psp-*) -+ sys_dir=psp -+ syscall_dir=syscalls -+ newlib_cflags="${newlib_cflags} -G0 -mno-explicit-relocs -DCOMPACT_CTYPE -DCLOCK_PROVIDED -DHAVE_FCNTL -DMALLOC_ALIGNMENT=16 -I${prefix}/psp/sdk/include" ;; -+ *) -+ newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" ;; -+ esac - ;; - mmix-*) - syscall_dir=syscalls ---- newlib-1.13.0/newlib/libc/include/machine/time.h 2000-12-04 14:06:37.000000000 -0500 -+++ newlib-psp/newlib/libc/include/machine/time.h 2005-10-28 12:26:33.000000000 -0400 -@@ -9,6 +9,10 @@ - #endif - #endif /* !__rtems__ */ - -+#if defined(__psp__) -+#define _CLOCKS_PER_SEC_ 1000000 -+#endif -+ - #endif /* _MACHTIME_H_ */ - - ---- newlib-1.13.0/newlib/libc/include/sys/config.h 2004-06-22 17:54:51.000000000 -0400 -+++ newlib-psp/newlib/libc/include/sys/config.h 2005-09-07 13:04:52.000000000 -0400 -@@ -94,6 +94,12 @@ - #endif - #endif - -+/* We compile newlib with -G0 for PSP, but if we're compiling an app with $gp enabled, -+ then _impure_ptr is expected to live in .sdata. */ -+#if defined(__psp__) -+#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -+#endif -+ - #ifdef __xstormy16__ - #define __SMALL_BITFIELDS - #undef INT_MAX ---- newlib-1.13.0/newlib/libc/include/sys/types.h 2003-07-02 16:32:07.000000000 -0400 -+++ newlib-psp/newlib/libc/include/sys/types.h 2005-12-12 19:16:32.000000000 -0500 -@@ -188,52 +188,6 @@ - - typedef unsigned short nlink_t; - --/* We don't define fd_set and friends if we are compiling POSIX -- source, or if we have included (or may include as indicated -- by __USE_W32_SOCKETS) the W32api winsock[2].h header which -- defines Windows versions of them. Note that a program which -- includes the W32api winsock[2].h header must know what it is doing; -- it must not call the cygwin32 select function. --*/ --# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) --# define _SYS_TYPES_FD_SET --# define NBBY 8 /* number of bits in a byte */ --/* -- * Select uses bit masks of file descriptors in longs. -- * These macros manipulate such bit fields (the filesystem macros use chars). -- * FD_SETSIZE may be defined by the user, but the default here -- * should be >= NOFILE (param.h). -- */ --# ifndef FD_SETSIZE --# define FD_SETSIZE 64 --# endif -- --typedef long fd_mask; --# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ --# ifndef howmany --# define howmany(x,y) (((x)+((y)-1))/(y)) --# endif -- --/* We use a macro for fd_set so that including Sockets.h afterwards -- can work. */ --typedef struct _types_fd_set { -- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; --} _types_fd_set; -- --#define fd_set _types_fd_set -- --# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) --# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) --# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) --# define FD_ZERO(p) (__extension__ (void)({ \ -- size_t __i; \ -- char *__tmp = (char *)p; \ -- for (__i = 0; __i < sizeof (*(p)); ++__i) \ -- *__tmp++ = 0; \ --})) -- --# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */ -- - #undef __MS_types__ - #undef _ST_INT32 - ---- newlib-1.13.0/newlib/libc/sys/psp/Makefile.am 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/Makefile.am 2006-04-28 15:21:57.000000000 -0400 -@@ -0,0 +1,65 @@ -+## Process this file with automake to generate Makefile.in -+ -+AUTOMAKE_OPTIONS = cygnus -+ -+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -+ -+noinst_LIBRARIES = lib.a -+ -+LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o \ -+ _gettimeofday.o _kill.o _lseek.o _open.o _read.o \ -+ _sbrk.o _wait.o _write.o clock.o isatty.o time.o \ -+ _link.o _unlink.o sleep.o opendir.o readdir.o \ -+ closedir.o getcwd.o chdir.o mkdir.o rmdir.o \ -+ realpath.o _stat.o truncate.o access.o tzset.o \ -+ __psp_set_errno.o mlock.o _fcntl.o -+ -+SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o \ -+ listen.o recv.o recvfrom.o send.o sendto.o \ -+ setsockopt.o shutdown.o getsockname.o getpeername.o \ -+ inet_ntoa.o -+ -+PIPE_OBJS = pipe.o -+ -+FDMAN_OBJS = fdman.o -+ -+SELECT_OBJS = select.o -+ -+INTERRUPT_OBJS = interrupt.o -+ -+XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o _sprintf_r.o -+ -+NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o -+ -+lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c interrupt.S -+lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) \ -+ $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS) -+ -+all: crt0.o -+ -+$(LIBCGLUE_MULT_OBJS): libcglue.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SOCKET_MULT_OBJS): socket.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(XPRINTF_MULT_OBJS): xprintf.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(NETDB_MULT_OBJS): netdb.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(PIPE_OBJS): pipe.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(FDMAN_OBJS): fdman.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SELECT_OBJS): select.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(INTERRUPT_OBJS): interrupt.S -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+ACLOCAL_AMFLAGS = -I ../../.. -+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host ---- newlib-1.13.0/newlib/libc/sys/psp/Makefile.in 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/Makefile.in 2006-04-28 15:22:03.000000000 -0400 -@@ -0,0 +1,389 @@ -+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am -+ -+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -+# This Makefile.in is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -+# PARTICULAR PURPOSE. -+ -+ -+SHELL = @SHELL@ -+ -+srcdir = @srcdir@ -+top_srcdir = @top_srcdir@ -+VPATH = @srcdir@ -+prefix = @prefix@ -+exec_prefix = @exec_prefix@ -+ -+bindir = @bindir@ -+sbindir = @sbindir@ -+libexecdir = @libexecdir@ -+datadir = @datadir@ -+sysconfdir = @sysconfdir@ -+sharedstatedir = @sharedstatedir@ -+localstatedir = @localstatedir@ -+libdir = @libdir@ -+infodir = @infodir@ -+mandir = @mandir@ -+includedir = @includedir@ -+oldincludedir = /usr/include -+ -+DESTDIR = -+ -+pkgdatadir = $(datadir)/@PACKAGE@ -+pkglibdir = $(libdir)/@PACKAGE@ -+pkgincludedir = $(includedir)/@PACKAGE@ -+ -+top_builddir = . -+ -+ACLOCAL = @ACLOCAL@ -+AUTOCONF = @AUTOCONF@ -+AUTOMAKE = @AUTOMAKE@ -+AUTOHEADER = @AUTOHEADER@ -+ -+INSTALL = @INSTALL@ -+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -+INSTALL_DATA = @INSTALL_DATA@ -+INSTALL_SCRIPT = @INSTALL_SCRIPT@ -+transform = @program_transform_name@ -+ -+NORMAL_INSTALL = : -+PRE_INSTALL = : -+POST_INSTALL = : -+NORMAL_UNINSTALL = : -+PRE_UNINSTALL = : -+POST_UNINSTALL = : -+build_alias = @build_alias@ -+build_triplet = @build@ -+host_alias = @host_alias@ -+host_triplet = @host@ -+target_alias = @target_alias@ -+target_triplet = @target@ -+AR = @AR@ -+AS = @AS@ -+CC = @CC@ -+CPP = @CPP@ -+EXEEXT = @EXEEXT@ -+HAVE_LIB = @HAVE_LIB@ -+LDFLAGS = @LDFLAGS@ -+LIB = @LIB@ -+LTLIB = @LTLIB@ -+MAINT = @MAINT@ -+MAKEINFO = @MAKEINFO@ -+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -+OBJEXT = @OBJEXT@ -+PACKAGE = @PACKAGE@ -+RANLIB = @RANLIB@ -+VERSION = @VERSION@ -+aext = @aext@ -+libm_machine_dir = @libm_machine_dir@ -+machine_dir = @machine_dir@ -+newlib_basedir = @newlib_basedir@ -+oext = @oext@ -+sys_dir = @sys_dir@ -+ -+AUTOMAKE_OPTIONS = cygnus -+ -+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -+ -+noinst_LIBRARIES = lib.a -+ -+LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o _gettimeofday.o _kill.o _lseek.o _open.o _read.o _sbrk.o _wait.o _write.o clock.o isatty.o time.o _link.o _unlink.o sleep.o opendir.o readdir.o closedir.o getcwd.o chdir.o mkdir.o rmdir.o realpath.o _stat.o truncate.o access.o tzset.o __psp_set_errno.o mlock.o _fcntl.o -+ -+ -+SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o listen.o recv.o recvfrom.o send.o sendto.o setsockopt.o shutdown.o getsockname.o getpeername.o inet_ntoa.o -+ -+ -+PIPE_OBJS = pipe.o -+ -+FDMAN_OBJS = fdman.o -+ -+SELECT_OBJS = select.o -+ -+INTERRUPT_OBJS = interrupt.o -+ -+XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o _sprintf_r.o -+ -+NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o -+ -+lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c interrupt.S -+lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS) -+ -+ -+ACLOCAL_AMFLAGS = -I ../../.. -+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host -+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs -+CONFIG_CLEAN_FILES = -+LIBRARIES = $(noinst_LIBRARIES) -+ -+ -+DEFS = @DEFS@ -I. -I$(srcdir) -+CPPFLAGS = @CPPFLAGS@ -+LIBS = @LIBS@ -+lib_a_DEPENDENCIES = _close.o _exit.o _fork.o _fstat.o _getpid.o \ -+_gettimeofday.o _kill.o _lseek.o _open.o _read.o _sbrk.o _wait.o \ -+_write.o clock.o isatty.o time.o _link.o _unlink.o sleep.o opendir.o \ -+readdir.o closedir.o getcwd.o chdir.o mkdir.o rmdir.o realpath.o \ -+_stat.o truncate.o access.o tzset.o __psp_set_errno.o mlock.o _fcntl.o \ -+socket.o accept.o bind.o connect.o getsockopt.o listen.o recv.o \ -+recvfrom.o send.o sendto.o setsockopt.o shutdown.o getsockname.o \ -+getpeername.o inet_ntoa.o vxprintf.o _xprintf.o __sout.o vsnprintf.o \ -+snprintf.o vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o \ -+asprintf.o vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o \ -+_sprintf_r.o h_errno.o gethostbyaddr.o gethostbyname.o pipe.o fdman.o \ -+select.o interrupt.o -+lib_a_OBJECTS = libcglue.o socket.o pspcwd.o xprintf.o netdb.o pipe.o \ -+fdman.o select.o interrupt.o -+CFLAGS = @CFLAGS@ -+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+CCLD = $(CC) -+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -+DIST_COMMON = README Makefile.am Makefile.in aclocal.m4 configure \ -+configure.in -+ -+ -+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -+ -+TAR = tar -+GZIP_ENV = --best -+SOURCES = $(lib_a_SOURCES) -+OBJECTS = $(lib_a_OBJECTS) -+ -+all: all-redirect -+.SUFFIXES: -+.SUFFIXES: .S .c .o .s -+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) -+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile -+ -+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -+ cd $(top_builddir) \ -+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -+ -+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ -+ ../../../acinclude.m4 ../../../aclocal.m4 \ -+ ../../../libtool.m4 -+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -+ -+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) -+ $(SHELL) ./config.status --recheck -+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) -+ cd $(srcdir) && $(AUTOCONF) -+ -+mostlyclean-noinstLIBRARIES: -+ -+clean-noinstLIBRARIES: -+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -+ -+distclean-noinstLIBRARIES: -+ -+maintainer-clean-noinstLIBRARIES: -+ -+.c.o: -+ $(COMPILE) -c $< -+ -+.s.o: -+ $(COMPILE) -c $< -+ -+.S.o: -+ $(COMPILE) -c $< -+ -+mostlyclean-compile: -+ -rm -f *.o core *.core -+ -+clean-compile: -+ -+distclean-compile: -+ -rm -f *.tab.c -+ -+maintainer-clean-compile: -+ -+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) -+ -rm -f lib.a -+ $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) -+ $(RANLIB) lib.a -+ -+tags: TAGS -+ -+ID: $(HEADERS) $(SOURCES) $(LISP) -+ list='$(SOURCES) $(HEADERS)'; \ -+ unique=`for i in $$list; do echo $$i; done | \ -+ awk ' { files[$$0] = 1; } \ -+ END { for (i in files) print i; }'`; \ -+ here=`pwd` && cd $(srcdir) \ -+ && mkid -f$$here/ID $$unique $(LISP) -+ -+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) -+ tags=; \ -+ here=`pwd`; \ -+ list='$(SOURCES) $(HEADERS)'; \ -+ unique=`for i in $$list; do echo $$i; done | \ -+ awk ' { files[$$0] = 1; } \ -+ END { for (i in files) print i; }'`; \ -+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ -+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) -+ -+mostlyclean-tags: -+ -+clean-tags: -+ -+distclean-tags: -+ -rm -f TAGS ID -+ -+maintainer-clean-tags: -+ -+distdir = $(PACKAGE)-$(VERSION) -+top_distdir = $(distdir) -+ -+# This target untars the dist file and tries a VPATH configuration. Then -+# it guarantees that the distribution is self-contained by making another -+# tarfile. -+distcheck: dist -+ -rm -rf $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz -+ mkdir $(distdir)/=build -+ mkdir $(distdir)/=inst -+ dc_install_base=`cd $(distdir)/=inst && pwd`; \ -+ cd $(distdir)/=build \ -+ && ../configure --srcdir=.. --prefix=$$dc_install_base \ -+ && $(MAKE) $(AM_MAKEFLAGS) \ -+ && $(MAKE) $(AM_MAKEFLAGS) dvi \ -+ && $(MAKE) $(AM_MAKEFLAGS) check \ -+ && $(MAKE) $(AM_MAKEFLAGS) install \ -+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ -+ && $(MAKE) $(AM_MAKEFLAGS) dist -+ -rm -rf $(distdir) -+ @banner="$(distdir).tar.gz is ready for distribution"; \ -+ dashes=`echo "$$banner" | sed s/./=/g`; \ -+ echo "$$dashes"; \ -+ echo "$$banner"; \ -+ echo "$$dashes" -+dist: distdir -+ -chmod -R a+r $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -+ -rm -rf $(distdir) -+dist-all: distdir -+ -chmod -R a+r $(distdir) -+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -+ -rm -rf $(distdir) -+distdir: $(DISTFILES) -+ -rm -rf $(distdir) -+ mkdir $(distdir) -+ -chmod 777 $(distdir) -+ @for file in $(DISTFILES); do \ -+ if test -f $$file; then d=.; else d=$(srcdir); fi; \ -+ if test -d $$d/$$file; then \ -+ cp -pr $$d/$$file $(distdir)/$$file; \ -+ else \ -+ test -f $(distdir)/$$file \ -+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ -+ || cp -p $$d/$$file $(distdir)/$$file || :; \ -+ fi; \ -+ done -+info-am: -+info: info-am -+dvi-am: -+dvi: dvi-am -+check-am: -+check: check-am -+installcheck-am: -+installcheck: installcheck-am -+install-info-am: -+install-info: install-info-am -+install-exec-am: -+install-exec: install-exec-am -+ -+install-data-am: -+install-data: install-data-am -+ -+install-am: all-am -+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -+install: install-am -+uninstall-am: -+uninstall: uninstall-am -+all-am: Makefile $(LIBRARIES) -+all-redirect: all-am -+install-strip: -+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -+installdirs: -+ -+ -+mostlyclean-generic: -+ -+clean-generic: -+ -+distclean-generic: -+ -rm -f Makefile $(CONFIG_CLEAN_FILES) -+ -rm -f config.cache config.log stamp-h stamp-h[0-9]* -+ -+maintainer-clean-generic: -+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ -+ mostlyclean-tags mostlyclean-generic -+ -+mostlyclean: mostlyclean-am -+ -+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ -+ mostlyclean-am -+ -+clean: clean-am -+ -+distclean-am: distclean-noinstLIBRARIES distclean-compile \ -+ distclean-tags distclean-generic clean-am -+ -+distclean: distclean-am -+ -rm -f config.status -+ -+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ -+ maintainer-clean-compile maintainer-clean-tags \ -+ maintainer-clean-generic distclean-am -+ @echo "This command is intended for maintainers to use;" -+ @echo "it deletes files that may require special tools to rebuild." -+ -+maintainer-clean: maintainer-clean-am -+ -rm -f config.status -+ -+.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -+mostlyclean-compile distclean-compile clean-compile \ -+maintainer-clean-compile tags mostlyclean-tags distclean-tags \ -+clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -+check-am installcheck-am installcheck install-info-am install-info \ -+install-exec-am install-exec install-data-am install-data install-am \ -+install uninstall-am uninstall all-redirect all-am all installdirs \ -+mostlyclean-generic distclean-generic clean-generic \ -+maintainer-clean-generic clean mostlyclean distclean maintainer-clean -+ -+ -+all: crt0.o -+ -+$(LIBCGLUE_MULT_OBJS): libcglue.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SOCKET_MULT_OBJS): socket.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(XPRINTF_MULT_OBJS): xprintf.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(NETDB_MULT_OBJS): netdb.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(PIPE_OBJS): pipe.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(FDMAN_OBJS): fdman.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SELECT_OBJS): select.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(INTERRUPT_OBJS): interrupt.S -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+# Tell versions [3.59,3.63) of GNU make to not export all variables. -+# Otherwise a system limit (for SysV at least) may be exceeded. -+.NOEXPORT: ---- newlib-1.13.0/newlib/libc/sys/psp/README 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/README 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,16 @@ -+Newlib for PSP -+-- -+ -+This sys/psp directory depends on PSPSDK headers. It expects them to live in -+${prefix}/psp/sdk/include (see newlib/configure.host). -+ -+I used automake 1.4-p6 to generate aclocal.m4 and Makefile.in: -+ -+ aclocal -I ../../.. -+ automake --cygnus -+ -+Autoconf refused to work for me, so I copied configure from sys/sh and modified -+$ac_unique_file to point libcglue.c. -+ -+-- -+Marcus R. Brown ---- newlib-1.13.0/newlib/libc/sys/psp/aclocal.m4 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/aclocal.m4 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,1185 @@ -+dnl aclocal.m4 generated automatically by aclocal 1.4-p6 -+ -+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl This program is distributed in the hope that it will be useful, -+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -+dnl PARTICULAR PURPOSE. -+ -+# lib-prefix.m4 serial 4 (gettext-0.14.2) -+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+ -+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -+dnl require excessive bracketing. -+ifdef([AC_HELP_STRING], -+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) -+ -+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -+dnl to access previously installed libraries. The basic assumption is that -+dnl a user will want packages to use other packages he previously installed -+dnl with the same --prefix option. -+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -+dnl libraries, but is otherwise very convenient. -+AC_DEFUN([AC_LIB_PREFIX], -+[ -+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) -+ AC_REQUIRE([AC_PROG_CC]) -+ AC_REQUIRE([AC_CANONICAL_HOST]) -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ dnl By default, look in $includedir and $libdir. -+ use_additional=yes -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ AC_LIB_ARG_WITH([lib-prefix], -+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib -+ --without-lib-prefix don't search for libraries in includedir and libdir], -+[ -+ if test "X$withval" = "Xno"; then -+ use_additional=no -+ else -+ if test "X$withval" = "X"; then -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ else -+ additional_includedir="$withval/include" -+ additional_libdir="$withval/lib" -+ fi -+ fi -+]) -+ if test $use_additional = yes; then -+ dnl Potentially add $additional_includedir to $CPPFLAGS. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/include, -+ dnl 2. if it's already present in $CPPFLAGS, -+ dnl 3. if it's /usr/local/include and we are using GCC on Linux, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_includedir" != "X/usr/include"; then -+ haveit= -+ for x in $CPPFLAGS; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-I$additional_includedir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test "X$additional_includedir" = "X/usr/local/include"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ if test -d "$additional_includedir"; then -+ dnl Really add $additional_includedir to $CPPFLAGS. -+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" -+ fi -+ fi -+ fi -+ fi -+ dnl Potentially add $additional_libdir to $LDFLAGS. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/lib, -+ dnl 2. if it's already present in $LDFLAGS, -+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_libdir" != "X/usr/lib"; then -+ haveit= -+ for x in $LDFLAGS; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test "X$additional_libdir" = "X/usr/local/lib"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux*) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ dnl Really add $additional_libdir to $LDFLAGS. -+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" -+ fi -+ fi -+ fi -+ fi -+ fi -+]) -+ -+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -+dnl acl_final_exec_prefix, containing the values to which $prefix and -+dnl $exec_prefix will expand at the end of the configure script. -+AC_DEFUN([AC_LIB_PREPARE_PREFIX], -+[ -+ dnl Unfortunately, prefix and exec_prefix get only finally determined -+ dnl at the end of configure. -+ if test "X$prefix" = "XNONE"; then -+ acl_final_prefix="$ac_default_prefix" -+ else -+ acl_final_prefix="$prefix" -+ fi -+ if test "X$exec_prefix" = "XNONE"; then -+ acl_final_exec_prefix='${prefix}' -+ else -+ acl_final_exec_prefix="$exec_prefix" -+ fi -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" -+ prefix="$acl_save_prefix" -+]) -+ -+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -+dnl variables prefix and exec_prefix bound to the values they will have -+dnl at the end of the configure script. -+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -+[ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ $1 -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+]) -+ -+# lib-link.m4 serial 6 (gettext-0.14.3) -+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Bruno Haible. -+ -+AC_PREREQ(2.50) -+ -+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -+dnl the libraries corresponding to explicit and implicit dependencies. -+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -+dnl augments the CPPFLAGS variable. -+AC_DEFUN([AC_LIB_LINKFLAGS], -+[ -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) -+ define([Name],[translit([$1],[./-], [___])]) -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ -+ AC_LIB_LINKFLAGS_BODY([$1], [$2]) -+ ac_cv_lib[]Name[]_libs="$LIB[]NAME" -+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" -+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME" -+ ]) -+ LIB[]NAME="$ac_cv_lib[]Name[]_libs" -+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" -+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags" -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) -+ AC_SUBST([LIB]NAME) -+ AC_SUBST([LTLIB]NAME) -+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the -+ dnl results of this search when this library appears as a dependency. -+ HAVE_LIB[]NAME=yes -+ undefine([Name]) -+ undefine([NAME]) -+]) -+ -+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -+dnl searches for libname and the libraries corresponding to explicit and -+dnl implicit dependencies, together with the specified include files and -+dnl the ability to compile and link the specified testcode. If found, it -+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -+[ -+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) -+ AC_REQUIRE([AC_LIB_RPATH]) -+ define([Name],[translit([$1],[./-], [___])]) -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -+ -+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME -+ dnl accordingly. -+ AC_LIB_LINKFLAGS_BODY([$1], [$2]) -+ -+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, -+ dnl because if the user has installed lib[]Name and not disabled its use -+ dnl via --without-lib[]Name-prefix, he wants to use it. -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) -+ -+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ -+ ac_save_LIBS="$LIBS" -+ LIBS="$LIBS $LIB[]NAME" -+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) -+ LIBS="$ac_save_LIBS" -+ ]) -+ if test "$ac_cv_lib[]Name" = yes; then -+ HAVE_LIB[]NAME=yes -+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) -+ AC_MSG_CHECKING([how to link with lib[]$1]) -+ AC_MSG_RESULT([$LIB[]NAME]) -+ else -+ HAVE_LIB[]NAME=no -+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need -+ dnl $INC[]NAME either. -+ CPPFLAGS="$ac_save_CPPFLAGS" -+ LIB[]NAME= -+ LTLIB[]NAME= -+ fi -+ AC_SUBST([HAVE_LIB]NAME) -+ AC_SUBST([LIB]NAME) -+ AC_SUBST([LTLIB]NAME) -+ undefine([Name]) -+ undefine([NAME]) -+]) -+ -+dnl Determine the platform dependent parameters needed to use rpath: -+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -+dnl hardcode_direct, hardcode_minus_L. -+AC_DEFUN([AC_LIB_RPATH], -+[ -+ dnl Tell automake >= 1.10 to complain if config.rpath is missing. -+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) -+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS -+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld -+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host -+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir -+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ -+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ -+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh -+ . ./conftest.sh -+ rm -f ./conftest.sh -+ acl_cv_rpath=done -+ ]) -+ wl="$acl_cv_wl" -+ libext="$acl_cv_libext" -+ shlibext="$acl_cv_shlibext" -+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" -+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" -+ hardcode_direct="$acl_cv_hardcode_direct" -+ hardcode_minus_L="$acl_cv_hardcode_minus_L" -+ dnl Determine whether the user wants rpath handling at all. -+ AC_ARG_ENABLE(rpath, -+ [ --disable-rpath do not hardcode runtime library paths], -+ :, enable_rpath=yes) -+]) -+ -+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -+dnl the libraries corresponding to explicit and implicit dependencies. -+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -+AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -+[ -+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], -+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) -+ dnl By default, look in $includedir and $libdir. -+ use_additional=yes -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ AC_LIB_ARG_WITH([lib$1-prefix], -+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib -+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -+[ -+ if test "X$withval" = "Xno"; then -+ use_additional=no -+ else -+ if test "X$withval" = "X"; then -+ AC_LIB_WITH_FINAL_PREFIX([ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ ]) -+ else -+ additional_includedir="$withval/include" -+ additional_libdir="$withval/lib" -+ fi -+ fi -+]) -+ dnl Search the library and its dependencies in $additional_libdir and -+ dnl $LDFLAGS. Using breadth-first-seach. -+ LIB[]NAME= -+ LTLIB[]NAME= -+ INC[]NAME= -+ rpathdirs= -+ ltrpathdirs= -+ names_already_handled= -+ names_next_round='$1 $2' -+ while test -n "$names_next_round"; do -+ names_this_round="$names_next_round" -+ names_next_round= -+ for name in $names_this_round; do -+ already_handled= -+ for n in $names_already_handled; do -+ if test "$n" = "$name"; then -+ already_handled=yes -+ break -+ fi -+ done -+ if test -z "$already_handled"; then -+ names_already_handled="$names_already_handled $name" -+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS -+ dnl or AC_LIB_HAVE_LINKFLAGS call. -+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` -+ eval value=\"\$HAVE_LIB$uppername\" -+ if test -n "$value"; then -+ if test "$value" = yes; then -+ eval value=\"\$LIB$uppername\" -+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" -+ eval value=\"\$LTLIB$uppername\" -+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" -+ else -+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined -+ dnl that this library doesn't exist. So just drop it. -+ : -+ fi -+ else -+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS -+ dnl and the already constructed $LIBNAME/$LTLIBNAME. -+ found_dir= -+ found_la= -+ found_so= -+ found_a= -+ if test $use_additional = yes; then -+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then -+ found_dir="$additional_libdir" -+ found_so="$additional_libdir/lib$name.$shlibext" -+ if test -f "$additional_libdir/lib$name.la"; then -+ found_la="$additional_libdir/lib$name.la" -+ fi -+ else -+ if test -f "$additional_libdir/lib$name.$libext"; then -+ found_dir="$additional_libdir" -+ found_a="$additional_libdir/lib$name.$libext" -+ if test -f "$additional_libdir/lib$name.la"; then -+ found_la="$additional_libdir/lib$name.la" -+ fi -+ fi -+ fi -+ fi -+ if test "X$found_dir" = "X"; then -+ for x in $LDFLAGS $LTLIB[]NAME; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ case "$x" in -+ -L*) -+ dir=`echo "X$x" | sed -e 's/^X-L//'` -+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then -+ found_dir="$dir" -+ found_so="$dir/lib$name.$shlibext" -+ if test -f "$dir/lib$name.la"; then -+ found_la="$dir/lib$name.la" -+ fi -+ else -+ if test -f "$dir/lib$name.$libext"; then -+ found_dir="$dir" -+ found_a="$dir/lib$name.$libext" -+ if test -f "$dir/lib$name.la"; then -+ found_la="$dir/lib$name.la" -+ fi -+ fi -+ fi -+ ;; -+ esac -+ if test "X$found_dir" != "X"; then -+ break -+ fi -+ done -+ fi -+ if test "X$found_dir" != "X"; then -+ dnl Found the library. -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" -+ if test "X$found_so" != "X"; then -+ dnl Linking with a shared library. We attempt to hardcode its -+ dnl directory into the executable's runpath, unless it's the -+ dnl standard /usr/lib. -+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then -+ dnl No hardcoding is needed. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" -+ else -+ dnl Use an explicit option to hardcode DIR into the resulting -+ dnl binary. -+ dnl Potentially add DIR to ltrpathdirs. -+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. -+ haveit= -+ for x in $ltrpathdirs; do -+ if test "X$x" = "X$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ ltrpathdirs="$ltrpathdirs $found_dir" -+ fi -+ dnl The hardcoding into $LIBNAME is system dependent. -+ if test "$hardcode_direct" = yes; then -+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the -+ dnl resulting binary. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" -+ else -+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then -+ dnl Use an explicit option to hardcode DIR into the resulting -+ dnl binary. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" -+ dnl Potentially add DIR to rpathdirs. -+ dnl The rpathdirs will be appended to $LIBNAME at the end. -+ haveit= -+ for x in $rpathdirs; do -+ if test "X$x" = "X$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ rpathdirs="$rpathdirs $found_dir" -+ fi -+ else -+ dnl Rely on "-L$found_dir". -+ dnl But don't add it if it's already contained in the LDFLAGS -+ dnl or the already constructed $LIBNAME -+ haveit= -+ for x in $LDFLAGS $LIB[]NAME; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-L$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" -+ fi -+ if test "$hardcode_minus_L" != no; then -+ dnl FIXME: Not sure whether we should use -+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" -+ dnl here. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" -+ else -+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH -+ dnl here, because this doesn't fit in flags passed to the -+ dnl compiler. So give up. No hardcoding. This affects only -+ dnl very old systems. -+ dnl FIXME: Not sure whether we should use -+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" -+ dnl here. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" -+ fi -+ fi -+ fi -+ fi -+ else -+ if test "X$found_a" != "X"; then -+ dnl Linking with a static library. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" -+ else -+ dnl We shouldn't come here, but anyway it's good to have a -+ dnl fallback. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" -+ fi -+ fi -+ dnl Assume the include files are nearby. -+ additional_includedir= -+ case "$found_dir" in -+ */lib | */lib/) -+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` -+ additional_includedir="$basedir/include" -+ ;; -+ esac -+ if test "X$additional_includedir" != "X"; then -+ dnl Potentially add $additional_includedir to $INCNAME. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/include, -+ dnl 2. if it's /usr/local/include and we are using GCC on Linux, -+ dnl 3. if it's already present in $CPPFLAGS or the already -+ dnl constructed $INCNAME, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_includedir" != "X/usr/include"; then -+ haveit= -+ if test "X$additional_includedir" = "X/usr/local/include"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ for x in $CPPFLAGS $INC[]NAME; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-I$additional_includedir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_includedir"; then -+ dnl Really add $additional_includedir to $INCNAME. -+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" -+ fi -+ fi -+ fi -+ fi -+ fi -+ dnl Look for dependencies. -+ if test -n "$found_la"; then -+ dnl Read the .la file. It defines the variables -+ dnl dlname, library_names, old_library, dependency_libs, current, -+ dnl age, revision, installed, dlopen, dlpreopen, libdir. -+ save_libdir="$libdir" -+ case "$found_la" in -+ */* | *\\*) . "$found_la" ;; -+ *) . "./$found_la" ;; -+ esac -+ libdir="$save_libdir" -+ dnl We use only dependency_libs. -+ for dep in $dependency_libs; do -+ case "$dep" in -+ -L*) -+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` -+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. -+ dnl But don't add it -+ dnl 1. if it's the standard /usr/lib, -+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux, -+ dnl 3. if it's already present in $LDFLAGS or the already -+ dnl constructed $LIBNAME, -+ dnl 4. if it doesn't exist as a directory. -+ if test "X$additional_libdir" != "X/usr/lib"; then -+ haveit= -+ if test "X$additional_libdir" = "X/usr/local/lib"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux* | gnu* | k*bsd*-gnu) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ haveit= -+ for x in $LDFLAGS $LIB[]NAME; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ dnl Really add $additional_libdir to $LIBNAME. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" -+ fi -+ fi -+ haveit= -+ for x in $LDFLAGS $LTLIB[]NAME; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ dnl Really add $additional_libdir to $LTLIBNAME. -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" -+ fi -+ fi -+ fi -+ fi -+ ;; -+ -R*) -+ dir=`echo "X$dep" | sed -e 's/^X-R//'` -+ if test "$enable_rpath" != no; then -+ dnl Potentially add DIR to rpathdirs. -+ dnl The rpathdirs will be appended to $LIBNAME at the end. -+ haveit= -+ for x in $rpathdirs; do -+ if test "X$x" = "X$dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ rpathdirs="$rpathdirs $dir" -+ fi -+ dnl Potentially add DIR to ltrpathdirs. -+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. -+ haveit= -+ for x in $ltrpathdirs; do -+ if test "X$x" = "X$dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ ltrpathdirs="$ltrpathdirs $dir" -+ fi -+ fi -+ ;; -+ -l*) -+ dnl Handle this in the next round. -+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` -+ ;; -+ *.la) -+ dnl Handle this in the next round. Throw away the .la's -+ dnl directory; it is already contained in a preceding -L -+ dnl option. -+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` -+ ;; -+ *) -+ dnl Most likely an immediate library name. -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" -+ ;; -+ esac -+ done -+ fi -+ else -+ dnl Didn't find the library; assume it is in the system directories -+ dnl known to the linker and runtime loader. (All the system -+ dnl directories known to the linker should also be known to the -+ dnl runtime loader, otherwise the system is severely misconfigured.) -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" -+ fi -+ fi -+ fi -+ done -+ done -+ if test "X$rpathdirs" != "X"; then -+ if test -n "$hardcode_libdir_separator"; then -+ dnl Weird platform: only the last -rpath option counts, the user must -+ dnl pass all path elements in one option. We can arrange that for a -+ dnl single library, but not when more than one $LIBNAMEs are used. -+ alldirs= -+ for found_dir in $rpathdirs; do -+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" -+ done -+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. -+ acl_save_libdir="$libdir" -+ libdir="$alldirs" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" -+ else -+ dnl The -rpath options are cumulative. -+ for found_dir in $rpathdirs; do -+ acl_save_libdir="$libdir" -+ libdir="$found_dir" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" -+ done -+ fi -+ fi -+ if test "X$ltrpathdirs" != "X"; then -+ dnl When using libtool, the option that works for both libraries and -+ dnl executables is -R. The -R options are cumulative. -+ for found_dir in $ltrpathdirs; do -+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" -+ done -+ fi -+]) -+ -+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -+dnl unless already present in VAR. -+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -+dnl contains two or three consecutive elements that belong together. -+AC_DEFUN([AC_LIB_APPENDTOVAR], -+[ -+ for element in [$2]; do -+ haveit= -+ for x in $[$1]; do -+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) -+ if test "X$x" = "X$element"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ [$1]="${[$1]}${[$1]:+ }$element" -+ fi -+ done -+]) -+ -+# lib-ld.m4 serial 3 (gettext-0.13) -+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl Subroutines of libtool.m4, -+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -+dnl with libtool.m4. -+ -+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -+AC_DEFUN([AC_LIB_PROG_LD_GNU], -+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -+[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -+case `$LD -v 2>&1 conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi -+ac_prog=ld -+if test "$GCC" = yes; then -+ # Check if gcc -print-prog-name=ld gives a path. -+ AC_MSG_CHECKING([for ld used by GCC]) -+ case $host in -+ *-*-mingw*) -+ # gcc leaves a trailing carriage return which upsets mingw -+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; -+ *) -+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; -+ esac -+ case $ac_prog in -+ # Accept absolute paths. -+ [[\\/]* | [A-Za-z]:[\\/]*)] -+ [re_direlt='/[^/][^/]*/\.\./'] -+ # Canonicalize the path of ld -+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` -+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do -+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` -+ done -+ test -z "$LD" && LD="$ac_prog" -+ ;; -+ "") -+ # If it fails, then pretend we aren't using GCC. -+ ac_prog=ld -+ ;; -+ *) -+ # If it is relative, then search for the first ld in PATH. -+ with_gnu_ld=unknown -+ ;; -+ esac -+elif test "$with_gnu_ld" = yes; then -+ AC_MSG_CHECKING([for GNU ld]) -+else -+ AC_MSG_CHECKING([for non-GNU ld]) -+fi -+AC_CACHE_VAL(acl_cv_path_LD, -+[if test -z "$LD"; then -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" -+ for ac_dir in $PATH; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then -+ acl_cv_path_LD="$ac_dir/$ac_prog" -+ # Check to see if the program is GNU ld. I'd rather use --version, -+ # but apparently some GNU ld's only accept -v. -+ # Break only if it was the GNU/non-GNU ld that we prefer. -+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in -+ *GNU* | *'with BFD'*) -+ test "$with_gnu_ld" != no && break ;; -+ *) -+ test "$with_gnu_ld" != yes && break ;; -+ esac -+ fi -+ done -+ IFS="$ac_save_ifs" -+else -+ acl_cv_path_LD="$LD" # Let the user override the test with a path. -+fi]) -+LD="$acl_cv_path_LD" -+if test -n "$LD"; then -+ AC_MSG_RESULT($LD) -+else -+ AC_MSG_RESULT(no) -+fi -+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -+AC_LIB_PROG_LD_GNU -+]) -+ -+dnl This provides configure definitions used by all the newlib -+dnl configure.in files. -+ -+dnl Basic newlib configury. This calls basic introductory stuff, -+dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs -+dnl configure.host. The only argument is the relative path to the top -+dnl newlib directory. -+ -+AC_DEFUN(NEWLIB_CONFIGURE, -+[ -+dnl Default to --enable-multilib -+AC_ARG_ENABLE(multilib, -+[ --enable-multilib build many library versions (default)], -+[case "${enableval}" in -+ yes) multilib=yes ;; -+ no) multilib=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; -+ esac], [multilib=yes])dnl -+ -+dnl Support --enable-target-optspace -+AC_ARG_ENABLE(target-optspace, -+[ --enable-target-optspace optimize for space], -+[case "${enableval}" in -+ yes) target_optspace=yes ;; -+ no) target_optspace=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; -+ esac], [target_optspace=])dnl -+ -+dnl Support --enable-malloc-debugging - currently only supported for Cygwin -+AC_ARG_ENABLE(malloc-debugging, -+[ --enable-malloc-debugging indicate malloc debugging requested], -+[case "${enableval}" in -+ yes) malloc_debugging=yes ;; -+ no) malloc_debugging=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;; -+ esac], [malloc_debugging=])dnl -+ -+dnl Support --enable-newlib-multithread -+AC_ARG_ENABLE(newlib-multithread, -+[ --enable-newlib-multithread enable support for multiple threads], -+[case "${enableval}" in -+ yes) newlib_multithread=yes ;; -+ no) newlib_multithread=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;; -+ esac], [newlib_multithread=yes])dnl -+ -+dnl Support --enable-newlib-iconv -+AC_ARG_ENABLE(newlib-iconv, -+[ --enable-newlib-iconv enable iconv library support], -+[if test "${newlib_iconv+set}" != set; then -+ case "${enableval}" in -+ yes) newlib_iconv=yes ;; -+ no) newlib_iconv=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;; -+ esac -+ fi], [newlib_iconv=${newlib_iconv}])dnl -+ -+dnl Support --enable-newlib-elix-level -+AC_ARG_ENABLE(newlib-elix-level, -+[ --enable-newlib-elix-level supply desired elix library level (1-4)], -+[case "${enableval}" in -+ 0) newlib_elix_level=0 ;; -+ 1) newlib_elix_level=1 ;; -+ 2) newlib_elix_level=2 ;; -+ 3) newlib_elix_level=3 ;; -+ 4) newlib_elix_level=4 ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;; -+ esac], [newlib_elix_level=0])dnl -+ -+dnl Support --disable-newlib-io-float -+AC_ARG_ENABLE(newlib-io-float, -+[ --disable-newlib-io-float disable printf/scanf family float support], -+[case "${enableval}" in -+ yes) newlib_io_float=yes ;; -+ no) newlib_io_float=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;; -+ esac], [newlib_io_float=yes])dnl -+ -+dnl Support --disable-newlib-supplied-syscalls -+AC_ARG_ENABLE(newlib-supplied-syscalls, -+[ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls], -+[case "${enableval}" in -+ yes) newlib_may_supply_syscalls=yes ;; -+ no) newlib_may_supply_syscalls=no ;; -+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;; -+ esac], [newlib_may_supply_syscalls=yes])dnl -+ -+AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes) -+ -+dnl We may get other options which we don't document: -+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir -+ -+test -z "[$]{with_target_subdir}" && with_target_subdir=. -+ -+if test "[$]{srcdir}" = "."; then -+ if test "[$]{with_target_subdir}" != "."; then -+ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" -+ else -+ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" -+ fi -+else -+ newlib_basedir="[$]{srcdir}/$1" -+fi -+AC_SUBST(newlib_basedir) -+ -+AC_CANONICAL_SYSTEM -+ -+AM_INIT_AUTOMAKE(newlib, 1.13.0) -+ -+# FIXME: We temporarily define our own version of AC_PROG_CC. This is -+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -+# are probably using a cross compiler, which will not be able to fully -+# link an executable. This should really be fixed in autoconf -+# itself. -+ -+AC_DEFUN(LIB_AC_PROG_CC, -+[AC_BEFORE([$0], [AC_PROG_CPP])dnl -+AC_CHECK_PROG(CC, gcc, gcc) -+if test -z "$CC"; then -+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) -+ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -+fi -+ -+AC_PROG_CC_GNU -+ -+if test $ac_cv_prog_gcc = yes; then -+ GCC=yes -+dnl Check whether -g works, even if CFLAGS is set, in case the package -+dnl plays around with CFLAGS (such as to build both debugging and -+dnl normal versions of a library), tasteless as that idea is. -+ ac_test_CFLAGS="${CFLAGS+set}" -+ ac_save_CFLAGS="$CFLAGS" -+ CFLAGS= -+ AC_PROG_CC_G -+ if test "$ac_test_CFLAGS" = set; then -+ CFLAGS="$ac_save_CFLAGS" -+ elif test $ac_cv_prog_cc_g = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-O2" -+ fi -+else -+ GCC= -+ test "${CFLAGS+set}" = set || CFLAGS="-g" -+fi -+]) -+ -+LIB_AC_PROG_CC -+ -+AC_CHECK_TOOL(AS, as) -+AC_CHECK_TOOL(AR, ar) -+AC_CHECK_TOOL(RANLIB, ranlib, :) -+ -+AC_PROG_INSTALL -+ -+AM_MAINTAINER_MODE -+ -+# We need AC_EXEEXT to keep automake happy in cygnus mode. However, -+# at least currently, we never actually build a program, so we never -+# need to use $(EXEEXT). Moreover, the test for EXEEXT normally -+# fails, because we are probably configuring with a cross compiler -+# which can't create executables. So we include AC_EXEEXT to keep -+# automake happy, but we don't execute it, since we don't care about -+# the result. -+if false; then -+ AC_EXEEXT -+fi -+ -+. [$]{newlib_basedir}/configure.host -+ -+newlib_cflags="[$]{newlib_cflags} -fno-builtin" -+ -+NEWLIB_CFLAGS=${newlib_cflags} -+AC_SUBST(NEWLIB_CFLAGS) -+ -+LDFLAGS=${ldflags} -+AC_SUBST(LDFLAGS) -+ -+AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0) -+AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1) -+AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2) -+AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3) -+AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4) -+ -+AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes) -+ -+# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we -+# use oext, which is set in configure.host based on the target platform. -+OBJEXT=${oext} -+ -+AC_SUBST(OBJEXT) -+AC_SUBST(oext) -+AC_SUBST(aext) -+ -+AC_SUBST(libm_machine_dir) -+AC_SUBST(machine_dir) -+AC_SUBST(sys_dir) -+]) -+ -+# Do all the work for Automake. This macro actually does too much -- -+# some checks are only needed if your package does certain things. -+# But this isn't really a big deal. -+ -+# serial 1 -+ -+dnl Usage: -+dnl AM_INIT_AUTOMAKE(package,version, [no-define]) -+ -+AC_DEFUN([AM_INIT_AUTOMAKE], -+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -+AC_REQUIRE([AC_PROG_INSTALL]) -+PACKAGE=[$1] -+AC_SUBST(PACKAGE) -+VERSION=[$2] -+AC_SUBST(VERSION) -+dnl test to see if srcdir already configured -+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then -+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -+fi -+ifelse([$3],, -+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -+AC_REQUIRE([AM_SANITY_CHECK]) -+AC_REQUIRE([AC_ARG_PROGRAM]) -+dnl FIXME This is truly gross. -+missing_dir=`cd $ac_aux_dir && pwd` -+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) -+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) -+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -+AC_REQUIRE([AC_PROG_MAKE_SET])]) -+ -+# Copyright 2002 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2, or (at your option) -+# any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -+ -+# AM_AUTOMAKE_VERSION(VERSION) -+# ---------------------------- -+# Automake X.Y traces this macro to ensure aclocal.m4 has been -+# generated from the m4 files accompanying Automake X.Y. -+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) -+ -+# AM_SET_CURRENT_AUTOMAKE_VERSION -+# ------------------------------- -+# Call AM_AUTOMAKE_VERSION so it can be traced. -+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -+ [AM_AUTOMAKE_VERSION([1.4-p6])]) -+ -+# -+# Check to make sure that the build environment is sane. -+# -+ -+AC_DEFUN([AM_SANITY_CHECK], -+[AC_MSG_CHECKING([whether build environment is sane]) -+# Just in case -+sleep 1 -+echo timestamp > conftestfile -+# Do `set' in a subshell so we don't clobber the current shell's -+# arguments. Must try -L first in case configure is actually a -+# symlink; some systems play weird games with the mod time of symlinks -+# (eg FreeBSD returns the mod time of the symlink's containing -+# directory). -+if ( -+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` -+ if test "[$]*" = "X"; then -+ # -L didn't work. -+ set X `ls -t $srcdir/configure conftestfile` -+ fi -+ if test "[$]*" != "X $srcdir/configure conftestfile" \ -+ && test "[$]*" != "X conftestfile $srcdir/configure"; then -+ -+ # If neither matched, then we have a broken ls. This can happen -+ # if, for instance, CONFIG_SHELL is bash and it inherits a -+ # broken ls alias from the environment. This has actually -+ # happened. Such a system could not be considered "sane". -+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -+alias in your environment]) -+ fi -+ -+ test "[$]2" = conftestfile -+ ) -+then -+ # Ok. -+ : -+else -+ AC_MSG_ERROR([newly created file is older than distributed files! -+Check your system clock]) -+fi -+rm -f conftest* -+AC_MSG_RESULT(yes)]) -+ -+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -+dnl The program must properly implement --version. -+AC_DEFUN([AM_MISSING_PROG], -+[AC_MSG_CHECKING(for working $2) -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if ($2 --version) < /dev/null > /dev/null 2>&1; then -+ $1=$2 -+ AC_MSG_RESULT(found) -+else -+ $1="$3/missing $2" -+ AC_MSG_RESULT(missing) -+fi -+AC_SUBST($1)]) -+ -+# Define a conditional. -+ -+AC_DEFUN([AM_CONDITIONAL], -+[AC_SUBST($1_TRUE) -+AC_SUBST($1_FALSE) -+if $2; then -+ $1_TRUE= -+ $1_FALSE='#' -+else -+ $1_TRUE='#' -+ $1_FALSE= -+fi]) -+ -+# Add --enable-maintainer-mode option to configure. -+# From Jim Meyering -+ -+# serial 1 -+ -+AC_DEFUN([AM_MAINTAINER_MODE], -+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) -+ dnl maintainer-mode is disabled by default -+ AC_ARG_ENABLE(maintainer-mode, -+[ --enable-maintainer-mode enable make rules and dependencies not useful -+ (and sometimes confusing) to the casual installer], -+ USE_MAINTAINER_MODE=$enableval, -+ USE_MAINTAINER_MODE=no) -+ AC_MSG_RESULT($USE_MAINTAINER_MODE) -+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) -+ MAINT=$MAINTAINER_MODE_TRUE -+ AC_SUBST(MAINT)dnl -+] -+) -+ ---- newlib-1.13.0/newlib/libc/sys/psp/arpa/inet.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/arpa/inet.h 2006-05-02 11:27:30.000000000 -0400 -@@ -0,0 +1,26 @@ -+/* arpa/inet.h - Functions for converting IP addresses between strings and numbers */ -+ -+#ifndef _ARPA_INET_H_ -+#define _ARPA_INET_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+in_addr_t sceNetInetInetAddr(const char *ip); -+int sceNetInetInetAton(const char *ip, struct in_addr *in); -+const char* sceNetInetInetNtop(int af, const void *src, char *dst, socklen_t cnt); -+int sceNetInetInetPton(int af, const char *src, void *dst); -+ -+char *inet_ntoa(struct in_addr in); -+#define inet_addr sceNetInetInetAddr -+#define inet_aton sceNetInetInetAton -+#define inet_ntop sceNetInetInetNtop -+#define inet_pton sceNetInetInetPton -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* _ARPA_INET_H_ */ ---- newlib-1.13.0/newlib/libc/sys/psp/confdefs.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/confdefs.h 2005-10-12 15:36:20.000000000 -0400 -@@ -0,0 +1 @@ -+ ---- newlib-1.13.0/newlib/libc/sys/psp/configure 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/configure 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,1880 @@ -+#! /bin/sh -+ -+# Guess values for system-dependent variables and create Makefiles. -+# Generated automatically using autoconf version 2.13 -+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -+# -+# This configure script is free software; the Free Software Foundation -+# gives unlimited permission to copy, distribute and modify it. -+ -+# Defaults: -+ac_help= -+ac_default_prefix=/usr/local -+# Any additions from configure.in: -+ac_help="$ac_help -+ --enable-multilib build many library versions (default)" -+ac_help="$ac_help -+ --enable-target-optspace optimize for space" -+ac_help="$ac_help -+ --enable-malloc-debugging indicate malloc debugging requested" -+ac_help="$ac_help -+ --enable-newlib-multithread enable support for multiple threads" -+ac_help="$ac_help -+ --enable-newlib-iconv enable iconv library support" -+ac_help="$ac_help -+ --enable-newlib-elix-level supply desired elix library level (1-4)" -+ac_help="$ac_help -+ --disable-newlib-io-float disable printf/scanf family float support" -+ac_help="$ac_help -+ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls" -+ac_help="$ac_help -+ --enable-maintainer-mode enable make rules and dependencies not useful -+ (and sometimes confusing) to the casual installer" -+ -+# Initialize some variables set by options. -+# The variables have the same names as the options, with -+# dashes changed to underlines. -+build=NONE -+cache_file=./config.cache -+exec_prefix=NONE -+host=NONE -+no_create= -+nonopt=NONE -+no_recursion= -+prefix=NONE -+program_prefix=NONE -+program_suffix=NONE -+program_transform_name=s,x,x, -+silent= -+site= -+srcdir= -+target=NONE -+verbose= -+x_includes=NONE -+x_libraries=NONE -+bindir='${exec_prefix}/bin' -+sbindir='${exec_prefix}/sbin' -+libexecdir='${exec_prefix}/libexec' -+datadir='${prefix}/share' -+sysconfdir='${prefix}/etc' -+sharedstatedir='${prefix}/com' -+localstatedir='${prefix}/var' -+libdir='${exec_prefix}/lib' -+includedir='${prefix}/include' -+oldincludedir='/usr/include' -+infodir='${prefix}/info' -+mandir='${prefix}/man' -+ -+# Initialize some other variables. -+subdirs= -+MFLAGS= MAKEFLAGS= -+SHELL=${CONFIG_SHELL-/bin/sh} -+# Maximum number of lines to put in a shell here document. -+ac_max_here_lines=12 -+ -+ac_prev= -+for ac_option -+do -+ -+ # If the previous option needs an argument, assign it. -+ if test -n "$ac_prev"; then -+ eval "$ac_prev=\$ac_option" -+ ac_prev= -+ continue -+ fi -+ -+ case "$ac_option" in -+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; -+ *) ac_optarg= ;; -+ esac -+ -+ # Accept the important Cygnus configure options, so we can diagnose typos. -+ -+ case "$ac_option" in -+ -+ -bindir | --bindir | --bindi | --bind | --bin | --bi) -+ ac_prev=bindir ;; -+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) -+ bindir="$ac_optarg" ;; -+ -+ -build | --build | --buil | --bui | --bu) -+ ac_prev=build ;; -+ -build=* | --build=* | --buil=* | --bui=* | --bu=*) -+ build="$ac_optarg" ;; -+ -+ -cache-file | --cache-file | --cache-fil | --cache-fi \ -+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) -+ ac_prev=cache_file ;; -+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ -+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) -+ cache_file="$ac_optarg" ;; -+ -+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da) -+ ac_prev=datadir ;; -+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ -+ | --da=*) -+ datadir="$ac_optarg" ;; -+ -+ -disable-* | --disable-*) -+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then -+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } -+ fi -+ ac_feature=`echo $ac_feature| sed 's/-/_/g'` -+ eval "enable_${ac_feature}=no" ;; -+ -+ -enable-* | --enable-*) -+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then -+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } -+ fi -+ ac_feature=`echo $ac_feature| sed 's/-/_/g'` -+ case "$ac_option" in -+ *=*) ;; -+ *) ac_optarg=yes ;; -+ esac -+ eval "enable_${ac_feature}='$ac_optarg'" ;; -+ -+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ -+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ -+ | --exec | --exe | --ex) -+ ac_prev=exec_prefix ;; -+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ -+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ -+ | --exec=* | --exe=* | --ex=*) -+ exec_prefix="$ac_optarg" ;; -+ -+ -gas | --gas | --ga | --g) -+ # Obsolete; use --with-gas. -+ with_gas=yes ;; -+ -+ -help | --help | --hel | --he) -+ # Omit some internal or obsolete options to make the list less imposing. -+ # This message is too long to be a string in the A/UX 3.1 sh. -+ cat << EOF -+Usage: configure [options] [host] -+Options: [defaults in brackets after descriptions] -+Configuration: -+ --cache-file=FILE cache test results in FILE -+ --help print this message -+ --no-create do not create output files -+ --quiet, --silent do not print \`checking...' messages -+ --version print the version of autoconf that created configure -+Directory and file names: -+ --prefix=PREFIX install architecture-independent files in PREFIX -+ [$ac_default_prefix] -+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -+ [same as prefix] -+ --bindir=DIR user executables in DIR [EPREFIX/bin] -+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] -+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec] -+ --datadir=DIR read-only architecture-independent data in DIR -+ [PREFIX/share] -+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] -+ --sharedstatedir=DIR modifiable architecture-independent data in DIR -+ [PREFIX/com] -+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] -+ --libdir=DIR object code libraries in DIR [EPREFIX/lib] -+ --includedir=DIR C header files in DIR [PREFIX/include] -+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] -+ --infodir=DIR info documentation in DIR [PREFIX/info] -+ --mandir=DIR man documentation in DIR [PREFIX/man] -+ --srcdir=DIR find the sources in DIR [configure dir or ..] -+ --program-prefix=PREFIX prepend PREFIX to installed program names -+ --program-suffix=SUFFIX append SUFFIX to installed program names -+ --program-transform-name=PROGRAM -+ run sed PROGRAM on installed program names -+EOF -+ cat << EOF -+Host type: -+ --build=BUILD configure for building on BUILD [BUILD=HOST] -+ --host=HOST configure for HOST [guessed] -+ --target=TARGET configure for TARGET [TARGET=HOST] -+Features and packages: -+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -+ --x-includes=DIR X include files are in DIR -+ --x-libraries=DIR X library files are in DIR -+EOF -+ if test -n "$ac_help"; then -+ echo "--enable and --with options recognized:$ac_help" -+ fi -+ exit 0 ;; -+ -+ -host | --host | --hos | --ho) -+ ac_prev=host ;; -+ -host=* | --host=* | --hos=* | --ho=*) -+ host="$ac_optarg" ;; -+ -+ -includedir | --includedir | --includedi | --included | --include \ -+ | --includ | --inclu | --incl | --inc) -+ ac_prev=includedir ;; -+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ -+ | --includ=* | --inclu=* | --incl=* | --inc=*) -+ includedir="$ac_optarg" ;; -+ -+ -infodir | --infodir | --infodi | --infod | --info | --inf) -+ ac_prev=infodir ;; -+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) -+ infodir="$ac_optarg" ;; -+ -+ -libdir | --libdir | --libdi | --libd) -+ ac_prev=libdir ;; -+ -libdir=* | --libdir=* | --libdi=* | --libd=*) -+ libdir="$ac_optarg" ;; -+ -+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ -+ | --libexe | --libex | --libe) -+ ac_prev=libexecdir ;; -+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ -+ | --libexe=* | --libex=* | --libe=*) -+ libexecdir="$ac_optarg" ;; -+ -+ -localstatedir | --localstatedir | --localstatedi | --localstated \ -+ | --localstate | --localstat | --localsta | --localst \ -+ | --locals | --local | --loca | --loc | --lo) -+ ac_prev=localstatedir ;; -+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ -+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ -+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) -+ localstatedir="$ac_optarg" ;; -+ -+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) -+ ac_prev=mandir ;; -+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) -+ mandir="$ac_optarg" ;; -+ -+ -nfp | --nfp | --nf) -+ # Obsolete; use --without-fp. -+ with_fp=no ;; -+ -+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -+ | --no-cr | --no-c) -+ no_create=yes ;; -+ -+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) -+ no_recursion=yes ;; -+ -+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ -+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ -+ | --oldin | --oldi | --old | --ol | --o) -+ ac_prev=oldincludedir ;; -+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ -+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ -+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) -+ oldincludedir="$ac_optarg" ;; -+ -+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) -+ ac_prev=prefix ;; -+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) -+ prefix="$ac_optarg" ;; -+ -+ -program-prefix | --program-prefix | --program-prefi | --program-pref \ -+ | --program-pre | --program-pr | --program-p) -+ ac_prev=program_prefix ;; -+ -program-prefix=* | --program-prefix=* | --program-prefi=* \ -+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) -+ program_prefix="$ac_optarg" ;; -+ -+ -program-suffix | --program-suffix | --program-suffi | --program-suff \ -+ | --program-suf | --program-su | --program-s) -+ ac_prev=program_suffix ;; -+ -program-suffix=* | --program-suffix=* | --program-suffi=* \ -+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) -+ program_suffix="$ac_optarg" ;; -+ -+ -program-transform-name | --program-transform-name \ -+ | --program-transform-nam | --program-transform-na \ -+ | --program-transform-n | --program-transform- \ -+ | --program-transform | --program-transfor \ -+ | --program-transfo | --program-transf \ -+ | --program-trans | --program-tran \ -+ | --progr-tra | --program-tr | --program-t) -+ ac_prev=program_transform_name ;; -+ -program-transform-name=* | --program-transform-name=* \ -+ | --program-transform-nam=* | --program-transform-na=* \ -+ | --program-transform-n=* | --program-transform-=* \ -+ | --program-transform=* | --program-transfor=* \ -+ | --program-transfo=* | --program-transf=* \ -+ | --program-trans=* | --program-tran=* \ -+ | --progr-tra=* | --program-tr=* | --program-t=*) -+ program_transform_name="$ac_optarg" ;; -+ -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ silent=yes ;; -+ -+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -+ ac_prev=sbindir ;; -+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -+ | --sbi=* | --sb=*) -+ sbindir="$ac_optarg" ;; -+ -+ -sharedstatedir | --sharedstatedir | --sharedstatedi \ -+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ -+ | --sharedst | --shareds | --shared | --share | --shar \ -+ | --sha | --sh) -+ ac_prev=sharedstatedir ;; -+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ -+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ -+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ -+ | --sha=* | --sh=*) -+ sharedstatedir="$ac_optarg" ;; -+ -+ -site | --site | --sit) -+ ac_prev=site ;; -+ -site=* | --site=* | --sit=*) -+ site="$ac_optarg" ;; -+ -+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) -+ ac_prev=srcdir ;; -+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) -+ srcdir="$ac_optarg" ;; -+ -+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ -+ | --syscon | --sysco | --sysc | --sys | --sy) -+ ac_prev=sysconfdir ;; -+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ -+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) -+ sysconfdir="$ac_optarg" ;; -+ -+ -target | --target | --targe | --targ | --tar | --ta | --t) -+ ac_prev=target ;; -+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) -+ target="$ac_optarg" ;; -+ -+ -v | -verbose | --verbose | --verbos | --verbo | --verb) -+ verbose=yes ;; -+ -+ -version | --version | --versio | --versi | --vers) -+ echo "configure generated by autoconf version 2.13" -+ exit 0 ;; -+ -+ -with-* | --with-*) -+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then -+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } -+ fi -+ ac_package=`echo $ac_package| sed 's/-/_/g'` -+ case "$ac_option" in -+ *=*) ;; -+ *) ac_optarg=yes ;; -+ esac -+ eval "with_${ac_package}='$ac_optarg'" ;; -+ -+ -without-* | --without-*) -+ ac_package=`echo $ac_option|sed -e 's/-*without-//'` -+ # Reject names that are not valid shell variable names. -+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then -+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } -+ fi -+ ac_package=`echo $ac_package| sed 's/-/_/g'` -+ eval "with_${ac_package}=no" ;; -+ -+ --x) -+ # Obsolete; use --with-x. -+ with_x=yes ;; -+ -+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ -+ | --x-incl | --x-inc | --x-in | --x-i) -+ ac_prev=x_includes ;; -+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ -+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) -+ x_includes="$ac_optarg" ;; -+ -+ -x-libraries | --x-libraries | --x-librarie | --x-librari \ -+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) -+ ac_prev=x_libraries ;; -+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ -+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) -+ x_libraries="$ac_optarg" ;; -+ -+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } -+ ;; -+ -+ *) -+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then -+ echo "configure: warning: $ac_option: invalid host type" 1>&2 -+ fi -+ if test "x$nonopt" != xNONE; then -+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } -+ fi -+ nonopt="$ac_option" -+ ;; -+ -+ esac -+done -+ -+if test -n "$ac_prev"; then -+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -+fi -+ -+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -+ -+# File descriptor usage: -+# 0 standard input -+# 1 file creation -+# 2 errors and warnings -+# 3 some systems may open it to /dev/tty -+# 4 used on the Kubota Titan -+# 6 checking for... messages and results -+# 5 compiler messages saved in config.log -+if test "$silent" = yes; then -+ exec 6>/dev/null -+else -+ exec 6>&1 -+fi -+exec 5>./config.log -+ -+echo "\ -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+" 1>&5 -+ -+# Strip out --no-create and --no-recursion so they do not pile up. -+# Also quote any args containing shell metacharacters. -+ac_configure_args= -+for ac_arg -+do -+ case "$ac_arg" in -+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -+ | --no-cr | --no-c) ;; -+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; -+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) -+ ac_configure_args="$ac_configure_args '$ac_arg'" ;; -+ *) ac_configure_args="$ac_configure_args $ac_arg" ;; -+ esac -+done -+ -+# NLS nuisances. -+# Only set these to C if already set. These must not be set unconditionally -+# because not all systems understand e.g. LANG=C (notably SCO). -+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -+# Non-C LC_CTYPE values break the ctype check. -+if test "${LANG+set}" = set; then LANG=C; export LANG; fi -+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -+ -+# confdefs.h avoids OS command line length limits that DEFS can exceed. -+rm -rf conftest* confdefs.h -+# AIX cpp loses on an empty file, so make sure it contains at least a newline. -+echo > confdefs.h -+ -+# A filename unique to this package, relative to the directory that -+# configure is in, which we can look for to find out if srcdir is correct. -+ac_unique_file=libcglue.c -+ -+# Find the source files, if location was not specified. -+if test -z "$srcdir"; then -+ ac_srcdir_defaulted=yes -+ # Try the directory containing this script, then its parent. -+ ac_prog=$0 -+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` -+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. -+ srcdir=$ac_confdir -+ if test ! -r $srcdir/$ac_unique_file; then -+ srcdir=.. -+ fi -+else -+ ac_srcdir_defaulted=no -+fi -+if test ! -r $srcdir/$ac_unique_file; then -+ if test "$ac_srcdir_defaulted" = yes; then -+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } -+ else -+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } -+ fi -+fi -+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` -+ -+# Prefer explicitly selected file to automatically selected ones. -+if test -z "$CONFIG_SITE"; then -+ if test "x$prefix" != xNONE; then -+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" -+ else -+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -+ fi -+fi -+for ac_site_file in $CONFIG_SITE; do -+ if test -r "$ac_site_file"; then -+ echo "loading site script $ac_site_file" -+ . "$ac_site_file" -+ fi -+done -+ -+if test -r "$cache_file"; then -+ echo "loading cache $cache_file" -+ . $cache_file -+else -+ echo "creating cache $cache_file" -+ > $cache_file -+fi -+ -+ac_ext=c -+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -+cross_compiling=$ac_cv_prog_cc_cross -+ -+ac_exeext= -+ac_objext=o -+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then -+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. -+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then -+ ac_n= ac_c=' -+' ac_t=' ' -+ else -+ ac_n=-n ac_c= ac_t= -+ fi -+else -+ ac_n= ac_c='\c' ac_t= -+fi -+ -+ -+ -+ac_aux_dir= -+for ac_dir in ../../../.. $srcdir/../../../..; do -+ if test -f $ac_dir/install-sh; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install-sh -c" -+ break -+ elif test -f $ac_dir/install.sh; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install.sh -c" -+ break -+ fi -+done -+if test -z "$ac_aux_dir"; then -+ { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } -+fi -+ac_config_guess=$ac_aux_dir/config.guess -+ac_config_sub=$ac_aux_dir/config.sub -+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -+ -+ -+am__api_version="1.4" -+# Find a good install program. We prefer a C program (faster), -+# so one script is as good as another. But avoid the broken or -+# incompatible versions: -+# SysV /etc/install, /usr/sbin/install -+# SunOS /usr/etc/install -+# IRIX /sbin/install -+# AIX /bin/install -+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -+# AFS /usr/afsws/bin/install, which mishandles nonexistent args -+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# ./install, which can be erroneously created by make from ./install.sh. -+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -+echo "configure:578: checking for a BSD compatible install" >&5 -+if test -z "$INSTALL"; then -+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" -+ for ac_dir in $PATH; do -+ # Account for people who put trailing slashes in PATH elements. -+ case "$ac_dir/" in -+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; -+ *) -+ # OSF1 and SCO ODT 3.0 have their own names for install. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ if test -f $ac_dir/$ac_prog; then -+ if test $ac_prog = install && -+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ else -+ ac_cv_path_install="$ac_dir/$ac_prog -c" -+ break 2 -+ fi -+ fi -+ done -+ ;; -+ esac -+ done -+ IFS="$ac_save_IFS" -+ -+fi -+ if test "${ac_cv_path_install+set}" = set; then -+ INSTALL="$ac_cv_path_install" -+ else -+ # As a last resort, use the slow shell script. We don't cache a -+ # path for INSTALL within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the path is relative. -+ INSTALL="$ac_install_sh" -+ fi -+fi -+echo "$ac_t""$INSTALL" 1>&6 -+ -+# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -+# It thinks the first close brace ends the variable substitution. -+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -+ -+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' -+ -+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -+ -+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -+echo "configure:631: checking whether build environment is sane" >&5 -+# Just in case -+sleep 1 -+echo timestamp > conftestfile -+# Do `set' in a subshell so we don't clobber the current shell's -+# arguments. Must try -L first in case configure is actually a -+# symlink; some systems play weird games with the mod time of symlinks -+# (eg FreeBSD returns the mod time of the symlink's containing -+# directory). -+if ( -+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` -+ if test "$*" = "X"; then -+ # -L didn't work. -+ set X `ls -t $srcdir/configure conftestfile` -+ fi -+ if test "$*" != "X $srcdir/configure conftestfile" \ -+ && test "$*" != "X conftestfile $srcdir/configure"; then -+ -+ # If neither matched, then we have a broken ls. This can happen -+ # if, for instance, CONFIG_SHELL is bash and it inherits a -+ # broken ls alias from the environment. This has actually -+ # happened. Such a system could not be considered "sane". -+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -+alias in your environment" 1>&2; exit 1; } -+ fi -+ -+ test "$2" = conftestfile -+ ) -+then -+ # Ok. -+ : -+else -+ { echo "configure: error: newly created file is older than distributed files! -+Check your system clock" 1>&2; exit 1; } -+fi -+rm -f conftest* -+echo "$ac_t""yes" 1>&6 -+if test "$program_transform_name" = s,x,x,; then -+ program_transform_name= -+else -+ # Double any \ or $. echo might interpret backslashes. -+ cat <<\EOF_SED > conftestsed -+s,\\,\\\\,g; s,\$,$$,g -+EOF_SED -+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`" -+ rm -f conftestsed -+fi -+test "$program_prefix" != NONE && -+ program_transform_name="s,^,${program_prefix},; $program_transform_name" -+# Use a double $ so make ignores it. -+test "$program_suffix" != NONE && -+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" -+ -+# sed with no file args requires a program. -+test "$program_transform_name" = "" && program_transform_name="s,x,x," -+ -+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -+echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 -+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftestmake <<\EOF -+all: -+ @echo 'ac_maketemp="${MAKE}"' -+EOF -+# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -+if test -n "$ac_maketemp"; then -+ eval ac_cv_prog_make_${ac_make}_set=yes -+else -+ eval ac_cv_prog_make_${ac_make}_set=no -+fi -+rm -f conftestmake -+fi -+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ SET_MAKE= -+else -+ echo "$ac_t""no" 1>&6 -+ SET_MAKE="MAKE=${MAKE-make}" -+fi -+ -+if test $host != $build; then -+ ac_tool_prefix=${host_alias}- -+else -+ ac_tool_prefix= -+fi -+ -+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -+echo "configure:721: checking for Cygwin environment" >&5 -+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+ rm -rf conftest* -+ ac_cv_cygwin=yes -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ ac_cv_cygwin=no -+fi -+rm -f conftest* -+rm -f conftest* -+fi -+ -+echo "$ac_t""$ac_cv_cygwin" 1>&6 -+CYGWIN= -+test "$ac_cv_cygwin" = yes && CYGWIN=yes -+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -+echo "configure:754: checking for mingw32 environment" >&5 -+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+ rm -rf conftest* -+ ac_cv_mingw32=yes -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ ac_cv_mingw32=no -+fi -+rm -f conftest* -+rm -f conftest* -+fi -+ -+echo "$ac_t""$ac_cv_mingw32" 1>&6 -+MINGW32= -+test "$ac_cv_mingw32" = yes && MINGW32=yes -+ -+# Check whether --enable-multilib or --disable-multilib was given. -+if test "${enable_multilib+set}" = set; then -+ enableval="$enable_multilib" -+ case "${enableval}" in -+ yes) multilib=yes ;; -+ no) multilib=no ;; -+ *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; -+ esac -+else -+ multilib=yes -+fi -+ -+# Check whether --enable-target-optspace or --disable-target-optspace was given. -+if test "${enable_target_optspace+set}" = set; then -+ enableval="$enable_target_optspace" -+ case "${enableval}" in -+ yes) target_optspace=yes ;; -+ no) target_optspace=no ;; -+ *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; -+ esac -+else -+ target_optspace= -+fi -+ -+# Check whether --enable-malloc-debugging or --disable-malloc-debugging was given. -+if test "${enable_malloc_debugging+set}" = set; then -+ enableval="$enable_malloc_debugging" -+ case "${enableval}" in -+ yes) malloc_debugging=yes ;; -+ no) malloc_debugging=no ;; -+ *) { echo "configure: error: bad value ${enableval} for malloc-debugging option" 1>&2; exit 1; } ;; -+ esac -+else -+ malloc_debugging= -+fi -+ -+# Check whether --enable-newlib-multithread or --disable-newlib-multithread was given. -+if test "${enable_newlib_multithread+set}" = set; then -+ enableval="$enable_newlib_multithread" -+ case "${enableval}" in -+ yes) newlib_multithread=yes ;; -+ no) newlib_multithread=no ;; -+ *) { echo "configure: error: bad value ${enableval} for newlib-multithread option" 1>&2; exit 1; } ;; -+ esac -+else -+ newlib_multithread=yes -+fi -+ -+# Check whether --enable-newlib-iconv or --disable-newlib-iconv was given. -+if test "${enable_newlib_iconv+set}" = set; then -+ enableval="$enable_newlib_iconv" -+ if test "${newlib_iconv+set}" != set; then -+ case "${enableval}" in -+ yes) newlib_iconv=yes ;; -+ no) newlib_iconv=no ;; -+ *) { echo "configure: error: bad value ${enableval} for newlib-iconv option" 1>&2; exit 1; } ;; -+ esac -+ fi -+else -+ newlib_iconv=${newlib_iconv} -+fi -+ -+# Check whether --enable-newlib-elix-level or --disable-newlib-elix-level was given. -+if test "${enable_newlib_elix_level+set}" = set; then -+ enableval="$enable_newlib_elix_level" -+ case "${enableval}" in -+ 0) newlib_elix_level=0 ;; -+ 1) newlib_elix_level=1 ;; -+ 2) newlib_elix_level=2 ;; -+ 3) newlib_elix_level=3 ;; -+ 4) newlib_elix_level=4 ;; -+ *) { echo "configure: error: bad value ${enableval} for newlib-elix-level option" 1>&2; exit 1; } ;; -+ esac -+else -+ newlib_elix_level=0 -+fi -+ -+# Check whether --enable-newlib-io-float or --disable-newlib-io-float was given. -+if test "${enable_newlib_io_float+set}" = set; then -+ enableval="$enable_newlib_io_float" -+ case "${enableval}" in -+ yes) newlib_io_float=yes ;; -+ no) newlib_io_float=no ;; -+ *) { echo "configure: error: bad value ${enableval} for newlib-io-float option" 1>&2; exit 1; } ;; -+ esac -+else -+ newlib_io_float=yes -+fi -+ -+# Check whether --enable-newlib-supplied-syscalls or --disable-newlib-supplied-syscalls was given. -+if test "${enable_newlib_supplied_syscalls+set}" = set; then -+ enableval="$enable_newlib_supplied_syscalls" -+ case "${enableval}" in -+ yes) newlib_may_supply_syscalls=yes ;; -+ no) newlib_may_supply_syscalls=no ;; -+ *) { echo "configure: error: bad value ${enableval} for newlib-supplied-syscalls option" 1>&2; exit 1; } ;; -+ esac -+else -+ newlib_may_supply_syscalls=yes -+fi -+ -+ -+ -+if test x${newlib_may_supply_syscalls} = xyes; then -+ MAY_SUPPLY_SYSCALLS_TRUE= -+ MAY_SUPPLY_SYSCALLS_FALSE='#' -+else -+ MAY_SUPPLY_SYSCALLS_TRUE='#' -+ MAY_SUPPLY_SYSCALLS_FALSE= -+fi -+ -+ -+test -z "${with_target_subdir}" && with_target_subdir=. -+ -+if test "${srcdir}" = "."; then -+ if test "${with_target_subdir}" != "."; then -+ newlib_basedir="${srcdir}/${with_multisrctop}../../../.." -+ else -+ newlib_basedir="${srcdir}/${with_multisrctop}../../.." -+ fi -+else -+ newlib_basedir="${srcdir}/../../.." -+fi -+ -+ -+ -+# Do some error checking and defaulting for the host and target type. -+# The inputs are: -+# configure --host=HOST --target=TARGET --build=BUILD NONOPT -+# -+# The rules are: -+# 1. You are not allowed to specify --host, --target, and nonopt at the -+# same time. -+# 2. Host defaults to nonopt. -+# 3. If nonopt is not specified, then host defaults to the current host, -+# as determined by config.guess. -+# 4. Target and build default to nonopt. -+# 5. If nonopt is not specified, then target and build default to host. -+ -+# The aliases save the names the user supplied, while $host etc. -+# will get canonicalized. -+case $host---$target---$nonopt in -+NONE---*---* | *---NONE---* | *---*---NONE) ;; -+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -+esac -+ -+ -+# Make sure we can run config.sub. -+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -+fi -+ -+echo $ac_n "checking host system type""... $ac_c" 1>&6 -+echo "configure:936: checking host system type" >&5 -+ -+host_alias=$host -+case "$host_alias" in -+NONE) -+ case $nonopt in -+ NONE) -+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : -+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } -+ fi ;; -+ *) host_alias=$nonopt ;; -+ esac ;; -+esac -+ -+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$host" 1>&6 -+ -+echo $ac_n "checking target system type""... $ac_c" 1>&6 -+echo "configure:957: checking target system type" >&5 -+ -+target_alias=$target -+case "$target_alias" in -+NONE) -+ case $nonopt in -+ NONE) target_alias=$host_alias ;; -+ *) target_alias=$nonopt ;; -+ esac ;; -+esac -+ -+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$target" 1>&6 -+ -+echo $ac_n "checking build system type""... $ac_c" 1>&6 -+echo "configure:975: checking build system type" >&5 -+ -+build_alias=$build -+case "$build_alias" in -+NONE) -+ case $nonopt in -+ NONE) build_alias=$host_alias ;; -+ *) build_alias=$nonopt ;; -+ esac ;; -+esac -+ -+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -+echo "$ac_t""$build" 1>&6 -+ -+test "$host_alias" != "$target_alias" && -+ test "$program_prefix$program_suffix$program_transform_name" = \ -+ NONENONEs,x,x, && -+ program_prefix=${target_alias}- -+ -+ -+ -+PACKAGE=newlib -+ -+VERSION=1.13.0 -+ -+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then -+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -+fi -+cat >> confdefs.h <> confdefs.h <&6 -+echo "configure:1018: checking for working aclocal-${am__api_version}" >&5 -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then -+ ACLOCAL=aclocal-${am__api_version} -+ echo "$ac_t""found" 1>&6 -+else -+ ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" -+ echo "$ac_t""missing" 1>&6 -+fi -+ -+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -+echo "configure:1031: checking for working autoconf" >&5 -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if (autoconf --version) < /dev/null > /dev/null 2>&1; then -+ AUTOCONF=autoconf -+ echo "$ac_t""found" 1>&6 -+else -+ AUTOCONF="$missing_dir/missing autoconf" -+ echo "$ac_t""missing" 1>&6 -+fi -+ -+echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 -+echo "configure:1044: checking for working automake-${am__api_version}" >&5 -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then -+ AUTOMAKE=automake-${am__api_version} -+ echo "$ac_t""found" 1>&6 -+else -+ AUTOMAKE="$missing_dir/missing automake-${am__api_version}" -+ echo "$ac_t""missing" 1>&6 -+fi -+ -+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -+echo "configure:1057: checking for working autoheader" >&5 -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if (autoheader --version) < /dev/null > /dev/null 2>&1; then -+ AUTOHEADER=autoheader -+ echo "$ac_t""found" 1>&6 -+else -+ AUTOHEADER="$missing_dir/missing autoheader" -+ echo "$ac_t""missing" 1>&6 -+fi -+ -+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -+echo "configure:1070: checking for working makeinfo" >&5 -+# Run test in a subshell; some versions of sh will print an error if -+# an executable is not found, even if stderr is redirected. -+# Redirect stdin to placate older versions of autoconf. Sigh. -+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then -+ MAKEINFO=makeinfo -+ echo "$ac_t""found" 1>&6 -+else -+ MAKEINFO="$missing_dir/missing makeinfo" -+ echo "$ac_t""missing" 1>&6 -+fi -+ -+ -+ -+# FIXME: We temporarily define our own version of AC_PROG_CC. This is -+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -+# are probably using a cross compiler, which will not be able to fully -+# link an executable. This should really be fixed in autoconf -+# itself. -+ -+ -+ -+# Extract the first word of "gcc", so it can be a program name with args. -+set dummy gcc; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1095: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_CC="gcc" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+fi -+fi -+CC="$ac_cv_prog_CC" -+if test -n "$CC"; then -+ echo "$ac_t""$CC" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+if test -z "$CC"; then -+ # Extract the first word of "cc", so it can be a program name with args. -+set dummy cc; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1125: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_prog_rejected=no -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then -+ ac_prog_rejected=yes -+ continue -+ fi -+ ac_cv_prog_CC="cc" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+if test $ac_prog_rejected = yes; then -+ # We found a bogon in the path, so make sure we never use it. -+ set dummy $ac_cv_prog_CC -+ shift -+ if test $# -gt 0; then -+ # We chose a different compiler from the bogus one. -+ # However, it has the same basename, so the bogon will be chosen -+ # first if we set CC to just the basename; use the full file name. -+ shift -+ set dummy "$ac_dir/$ac_word" "$@" -+ shift -+ ac_cv_prog_CC="$@" -+ fi -+fi -+fi -+fi -+CC="$ac_cv_prog_CC" -+if test -n "$CC"; then -+ echo "$ac_t""$CC" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -+fi -+ -+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -+echo "configure:1174: checking whether we are using GNU C" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+ ac_cv_prog_gcc=yes -+else -+ ac_cv_prog_gcc=no -+fi -+fi -+ -+echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -+ -+if test $ac_cv_prog_gcc = yes; then -+ GCC=yes -+ ac_test_CFLAGS="${CFLAGS+set}" -+ ac_save_CFLAGS="$CFLAGS" -+ CFLAGS= -+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -+echo "configure:1198: checking whether ${CC-cc} accepts -g" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ echo 'void f(){}' > conftest.c -+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then -+ ac_cv_prog_cc_g=yes -+else -+ ac_cv_prog_cc_g=no -+fi -+rm -f conftest* -+ -+fi -+ -+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -+ if test "$ac_test_CFLAGS" = set; then -+ CFLAGS="$ac_save_CFLAGS" -+ elif test $ac_cv_prog_cc_g = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-O2" -+ fi -+else -+ GCC= -+ test "${CFLAGS+set}" = set || CFLAGS="-g" -+fi -+ -+ -+# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -+set dummy ${ac_tool_prefix}as; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1229: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$AS"; then -+ ac_cv_prog_AS="$AS" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_AS="${ac_tool_prefix}as" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+ test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" -+fi -+fi -+AS="$ac_cv_prog_AS" -+if test -n "$AS"; then -+ echo "$ac_t""$AS" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ -+ -+# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -+set dummy ${ac_tool_prefix}ar; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1261: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$AR"; then -+ ac_cv_prog_AR="$AR" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_AR="${ac_tool_prefix}ar" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+ test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" -+fi -+fi -+AR="$ac_cv_prog_AR" -+if test -n "$AR"; then -+ echo "$ac_t""$AR" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ -+ -+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -+set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1293: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+fi -+fi -+RANLIB="$ac_cv_prog_RANLIB" -+if test -n "$RANLIB"; then -+ echo "$ac_t""$RANLIB" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+ -+if test -z "$ac_cv_prog_RANLIB"; then -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "ranlib", so it can be a program name with args. -+set dummy ranlib; ac_word=$2 -+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -+echo "configure:1325: checking for $ac_word" >&5 -+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -+ ac_dummy="$PATH" -+ for ac_dir in $ac_dummy; do -+ test -z "$ac_dir" && ac_dir=. -+ if test -f $ac_dir/$ac_word; then -+ ac_cv_prog_RANLIB="ranlib" -+ break -+ fi -+ done -+ IFS="$ac_save_ifs" -+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -+fi -+fi -+RANLIB="$ac_cv_prog_RANLIB" -+if test -n "$RANLIB"; then -+ echo "$ac_t""$RANLIB" 1>&6 -+else -+ echo "$ac_t""no" 1>&6 -+fi -+ -+else -+ RANLIB=":" -+fi -+fi -+ -+ -+# Find a good install program. We prefer a C program (faster), -+# so one script is as good as another. But avoid the broken or -+# incompatible versions: -+# SysV /etc/install, /usr/sbin/install -+# SunOS /usr/etc/install -+# IRIX /sbin/install -+# AIX /bin/install -+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -+# AFS /usr/afsws/bin/install, which mishandles nonexistent args -+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# ./install, which can be erroneously created by make from ./install.sh. -+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -+echo "configure:1370: checking for a BSD compatible install" >&5 -+if test -z "$INSTALL"; then -+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" -+ for ac_dir in $PATH; do -+ # Account for people who put trailing slashes in PATH elements. -+ case "$ac_dir/" in -+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; -+ *) -+ # OSF1 and SCO ODT 3.0 have their own names for install. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ if test -f $ac_dir/$ac_prog; then -+ if test $ac_prog = install && -+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ else -+ ac_cv_path_install="$ac_dir/$ac_prog -c" -+ break 2 -+ fi -+ fi -+ done -+ ;; -+ esac -+ done -+ IFS="$ac_save_IFS" -+ -+fi -+ if test "${ac_cv_path_install+set}" = set; then -+ INSTALL="$ac_cv_path_install" -+ else -+ # As a last resort, use the slow shell script. We don't cache a -+ # path for INSTALL within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the path is relative. -+ INSTALL="$ac_install_sh" -+ fi -+fi -+echo "$ac_t""$INSTALL" 1>&6 -+ -+# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -+# It thinks the first close brace ends the variable substitution. -+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -+ -+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' -+ -+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -+ -+ -+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -+echo "configure:1424: checking whether to enable maintainer-specific portions of Makefiles" >&5 -+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -+if test "${enable_maintainer_mode+set}" = set; then -+ enableval="$enable_maintainer_mode" -+ USE_MAINTAINER_MODE=$enableval -+else -+ USE_MAINTAINER_MODE=no -+fi -+ -+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 -+ -+ -+if test $USE_MAINTAINER_MODE = yes; then -+ MAINTAINER_MODE_TRUE= -+ MAINTAINER_MODE_FALSE='#' -+else -+ MAINTAINER_MODE_TRUE='#' -+ MAINTAINER_MODE_FALSE= -+fi -+ MAINT=$MAINTAINER_MODE_TRUE -+ -+ -+ -+# We need AC_EXEEXT to keep automake happy in cygnus mode. However, -+# at least currently, we never actually build a program, so we never -+# need to use $(EXEEXT). Moreover, the test for EXEEXT normally -+# fails, because we are probably configuring with a cross compiler -+# which can't create executables. So we include AC_EXEEXT to keep -+# automake happy, but we don't execute it, since we don't care about -+# the result. -+if false; then -+ -+ -+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -+echo "configure:1458: checking for executable suffix" >&5 -+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then -+ ac_cv_exeext=.exe -+else -+ rm -f conftest* -+ echo 'int main () { return 0; }' > conftest.$ac_ext -+ ac_cv_exeext= -+ if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ for file in conftest.*; do -+ case $file in -+ *.c | *.o | *.obj) ;; -+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; -+ esac -+ done -+ else -+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } -+ fi -+ rm -f conftest* -+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -+fi -+fi -+ -+EXEEXT="" -+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -+echo "$ac_t""${ac_cv_exeext}" 1>&6 -+ac_exeext=$EXEEXT -+ -+fi -+ -+. ${newlib_basedir}/configure.host -+ -+newlib_cflags="${newlib_cflags} -fno-builtin" -+ -+NEWLIB_CFLAGS=${newlib_cflags} -+ -+ -+LDFLAGS=${ldflags} -+ -+ -+ -+ -+if test x${newlib_elix_level} = x0; then -+ ELIX_LEVEL_0_TRUE= -+ ELIX_LEVEL_0_FALSE='#' -+else -+ ELIX_LEVEL_0_TRUE='#' -+ ELIX_LEVEL_0_FALSE= -+fi -+ -+ -+if test x${newlib_elix_level} = x1; then -+ ELIX_LEVEL_1_TRUE= -+ ELIX_LEVEL_1_FALSE='#' -+else -+ ELIX_LEVEL_1_TRUE='#' -+ ELIX_LEVEL_1_FALSE= -+fi -+ -+ -+if test x${newlib_elix_level} = x2; then -+ ELIX_LEVEL_2_TRUE= -+ ELIX_LEVEL_2_FALSE='#' -+else -+ ELIX_LEVEL_2_TRUE='#' -+ ELIX_LEVEL_2_FALSE= -+fi -+ -+ -+if test x${newlib_elix_level} = x3; then -+ ELIX_LEVEL_3_TRUE= -+ ELIX_LEVEL_3_FALSE='#' -+else -+ ELIX_LEVEL_3_TRUE='#' -+ ELIX_LEVEL_3_FALSE= -+fi -+ -+ -+if test x${newlib_elix_level} = x4; then -+ ELIX_LEVEL_4_TRUE= -+ ELIX_LEVEL_4_FALSE='#' -+else -+ ELIX_LEVEL_4_TRUE='#' -+ ELIX_LEVEL_4_FALSE= -+fi -+ -+ -+ -+if test x${use_libtool} = xyes; then -+ USE_LIBTOOL_TRUE= -+ USE_LIBTOOL_FALSE='#' -+else -+ USE_LIBTOOL_TRUE='#' -+ USE_LIBTOOL_FALSE= -+fi -+ -+# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we -+# use oext, which is set in configure.host based on the target platform. -+OBJEXT=${oext} -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+trap '' 1 2 15 -+cat > confcache <<\EOF -+# This file is a shell script that caches the results of configure -+# tests run on this system so they can be shared between configure -+# scripts and configure runs. It is not useful on other systems. -+# If it contains results you don't want to keep, you may remove or edit it. -+# -+# By default, configure uses ./config.cache as the cache file, -+# creating it if it does not exist already. You can give configure -+# the --cache-file=FILE option to use a different cache file; that is -+# what configure does when it calls configure scripts in -+# subdirectories, so they share the cache. -+# Giving --cache-file=/dev/null disables caching, for debugging configure. -+# config.status only pays attention to the cache file if you give it the -+# --recheck option to rerun configure. -+# -+EOF -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, don't put newlines in cache variables' values. -+# Ultrix sh set writes to stderr and can't be redirected directly, -+# and sets the high bit in the cache file unless we assign to the vars. -+(set) 2>&1 | -+ case `(ac_space=' '; set | grep ac_space) 2>&1` in -+ *ac_space=\ *) -+ # `set' does not quote correctly, so add quotes (double-quote substitution -+ # turns \\\\ into \\, and sed turns \\ into \). -+ sed -n \ -+ -e "s/'/'\\\\''/g" \ -+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" -+ ;; -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' -+ ;; -+ esac >> confcache -+if cmp -s $cache_file confcache; then -+ : -+else -+ if test -w $cache_file; then -+ echo "updating cache $cache_file" -+ cat confcache > $cache_file -+ else -+ echo "not updating unwritable cache $cache_file" -+ fi -+fi -+rm -f confcache -+ -+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 -+ -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+# Let make expand exec_prefix. -+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ -+# Any assignment to VPATH causes Sun make to only execute -+# the first set of double-colon rules, so remove it if not needed. -+# If there is a colon in the path, we need to keep it. -+if test "x$srcdir" = x.; then -+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -+fi -+ -+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -+ -+# Transform confdefs.h into DEFS. -+# Protect against shell expansion while executing Makefile rules. -+# Protect against Makefile macro expansion. -+cat > conftest.defs <<\EOF -+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -+s%\[%\\&%g -+s%\]%\\&%g -+s%\$%$$%g -+EOF -+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -+rm -f conftest.defs -+ -+ -+# Without the "./", some shells look in PATH for config.status. -+: ${CONFIG_STATUS=./config.status} -+ -+echo creating $CONFIG_STATUS -+rm -f $CONFIG_STATUS -+cat > $CONFIG_STATUS </dev/null | sed 1q`: -+# -+# $0 $ac_configure_args -+# -+# Compiler output produced by configure, useful for debugging -+# configure, is in ./config.log if it exists. -+ -+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -+for ac_option -+do -+ case "\$ac_option" in -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" -+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v) -+ echo "$CONFIG_STATUS generated by autoconf version 2.13" -+ exit 0 ;; -+ -help | --help | --hel | --he | --h) -+ echo "\$ac_cs_usage"; exit 0 ;; -+ *) echo "\$ac_cs_usage"; exit 1 ;; -+ esac -+done -+ -+ac_given_srcdir=$srcdir -+ac_given_INSTALL="$INSTALL" -+ -+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -+EOF -+cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -+$ac_vpsub -+$extrasub -+s%@SHELL@%$SHELL%g -+s%@CFLAGS@%$CFLAGS%g -+s%@CPPFLAGS@%$CPPFLAGS%g -+s%@CXXFLAGS@%$CXXFLAGS%g -+s%@FFLAGS@%$FFLAGS%g -+s%@DEFS@%$DEFS%g -+s%@LDFLAGS@%$LDFLAGS%g -+s%@LIBS@%$LIBS%g -+s%@exec_prefix@%$exec_prefix%g -+s%@prefix@%$prefix%g -+s%@program_transform_name@%$program_transform_name%g -+s%@bindir@%$bindir%g -+s%@sbindir@%$sbindir%g -+s%@libexecdir@%$libexecdir%g -+s%@datadir@%$datadir%g -+s%@sysconfdir@%$sysconfdir%g -+s%@sharedstatedir@%$sharedstatedir%g -+s%@localstatedir@%$localstatedir%g -+s%@libdir@%$libdir%g -+s%@includedir@%$includedir%g -+s%@oldincludedir@%$oldincludedir%g -+s%@infodir@%$infodir%g -+s%@mandir@%$mandir%g -+s%@MAY_SUPPLY_SYSCALLS_TRUE@%$MAY_SUPPLY_SYSCALLS_TRUE%g -+s%@MAY_SUPPLY_SYSCALLS_FALSE@%$MAY_SUPPLY_SYSCALLS_FALSE%g -+s%@newlib_basedir@%$newlib_basedir%g -+s%@host@%$host%g -+s%@host_alias@%$host_alias%g -+s%@host_cpu@%$host_cpu%g -+s%@host_vendor@%$host_vendor%g -+s%@host_os@%$host_os%g -+s%@target@%$target%g -+s%@target_alias@%$target_alias%g -+s%@target_cpu@%$target_cpu%g -+s%@target_vendor@%$target_vendor%g -+s%@target_os@%$target_os%g -+s%@build@%$build%g -+s%@build_alias@%$build_alias%g -+s%@build_cpu@%$build_cpu%g -+s%@build_vendor@%$build_vendor%g -+s%@build_os@%$build_os%g -+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -+s%@INSTALL_DATA@%$INSTALL_DATA%g -+s%@PACKAGE@%$PACKAGE%g -+s%@VERSION@%$VERSION%g -+s%@ACLOCAL@%$ACLOCAL%g -+s%@AUTOCONF@%$AUTOCONF%g -+s%@AUTOMAKE@%$AUTOMAKE%g -+s%@AUTOHEADER@%$AUTOHEADER%g -+s%@MAKEINFO@%$MAKEINFO%g -+s%@SET_MAKE@%$SET_MAKE%g -+s%@CC@%$CC%g -+s%@AS@%$AS%g -+s%@AR@%$AR%g -+s%@RANLIB@%$RANLIB%g -+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -+s%@MAINT@%$MAINT%g -+s%@EXEEXT@%$EXEEXT%g -+s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g -+s%@ELIX_LEVEL_0_TRUE@%$ELIX_LEVEL_0_TRUE%g -+s%@ELIX_LEVEL_0_FALSE@%$ELIX_LEVEL_0_FALSE%g -+s%@ELIX_LEVEL_1_TRUE@%$ELIX_LEVEL_1_TRUE%g -+s%@ELIX_LEVEL_1_FALSE@%$ELIX_LEVEL_1_FALSE%g -+s%@ELIX_LEVEL_2_TRUE@%$ELIX_LEVEL_2_TRUE%g -+s%@ELIX_LEVEL_2_FALSE@%$ELIX_LEVEL_2_FALSE%g -+s%@ELIX_LEVEL_3_TRUE@%$ELIX_LEVEL_3_TRUE%g -+s%@ELIX_LEVEL_3_FALSE@%$ELIX_LEVEL_3_FALSE%g -+s%@ELIX_LEVEL_4_TRUE@%$ELIX_LEVEL_4_TRUE%g -+s%@ELIX_LEVEL_4_FALSE@%$ELIX_LEVEL_4_FALSE%g -+s%@USE_LIBTOOL_TRUE@%$USE_LIBTOOL_TRUE%g -+s%@USE_LIBTOOL_FALSE@%$USE_LIBTOOL_FALSE%g -+s%@OBJEXT@%$OBJEXT%g -+s%@oext@%$oext%g -+s%@aext@%$aext%g -+s%@libm_machine_dir@%$libm_machine_dir%g -+s%@machine_dir@%$machine_dir%g -+s%@sys_dir@%$sys_dir%g -+ -+CEOF -+EOF -+ -+cat >> $CONFIG_STATUS <<\EOF -+ -+# Split the substitutions into bite-sized pieces for seds with -+# small command number limits, like on Digital OSF/1 and HP-UX. -+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -+ac_file=1 # Number of current file. -+ac_beg=1 # First line for current file. -+ac_end=$ac_max_sed_cmds # Line after last line for current file. -+ac_more_lines=: -+ac_sed_cmds="" -+while $ac_more_lines; do -+ if test $ac_beg -gt 1; then -+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file -+ else -+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file -+ fi -+ if test ! -s conftest.s$ac_file; then -+ ac_more_lines=false -+ rm -f conftest.s$ac_file -+ else -+ if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds="sed -f conftest.s$ac_file" -+ else -+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" -+ fi -+ ac_file=`expr $ac_file + 1` -+ ac_beg=$ac_end -+ ac_end=`expr $ac_end + $ac_max_sed_cmds` -+ fi -+done -+if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds=cat -+fi -+EOF -+ -+cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then -+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". -+ case "$ac_file" in -+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` -+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; -+ *) ac_file_in="${ac_file}.in" ;; -+ esac -+ -+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. -+ -+ # Remove last slash and all that follows it. Not all systems have dirname. -+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` -+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then -+ # The file is in a subdirectory. -+ test ! -d "$ac_dir" && mkdir "$ac_dir" -+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" -+ # A "../" for each directory in $ac_dir_suffix. -+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` -+ else -+ ac_dir_suffix= ac_dots= -+ fi -+ -+ case "$ac_given_srcdir" in -+ .) srcdir=. -+ if test -z "$ac_dots"; then top_srcdir=. -+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; -+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; -+ *) # Relative path. -+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" -+ top_srcdir="$ac_dots$ac_given_srcdir" ;; -+ esac -+ -+ case "$ac_given_INSTALL" in -+ [/$]*) INSTALL="$ac_given_INSTALL" ;; -+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;; -+ esac -+ -+ echo creating "$ac_file" -+ rm -f "$ac_file" -+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." -+ case "$ac_file" in -+ *Makefile*) ac_comsub="1i\\ -+# $configure_input" ;; -+ *) ac_comsub= ;; -+ esac -+ -+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` -+ sed -e "$ac_comsub -+s%@configure_input@%$configure_input%g -+s%@srcdir@%$srcdir%g -+s%@top_srcdir@%$top_srcdir%g -+s%@INSTALL@%$INSTALL%g -+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -+fi; done -+rm -f conftest.s* -+ -+EOF -+cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -+ -+exit 0 -+EOF -+chmod +x $CONFIG_STATUS -+rm -fr confdefs* $ac_clean_files -+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 -+ ---- newlib-1.13.0/newlib/libc/sys/psp/configure.in 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/configure.in 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,12 @@ -+dnl This is the newlib/libc/sys/psp configure.in file. -+dnl Process this file with autoconf to produce a configure script. -+ -+AC_PREREQ(2.5) -+AC_INIT(libcglue.c) -+ -+dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. -+AC_CONFIG_AUX_DIR(../../../..) -+ -+NEWLIB_CONFIGURE(../../..) -+ -+AC_OUTPUT(Makefile) ---- newlib-1.13.0/newlib/libc/sys/psp/crt0.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/crt0.c 2006-03-13 00:00:00.000000000 -0500 -@@ -0,0 +1,3 @@ -+/* The real crt0.c lives in PSPSDK. */ -+ -+void _start() { } ---- newlib-1.13.0/newlib/libc/sys/psp/fdman.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/fdman.c 2006-05-02 11:02:56.000000000 -0400 -@@ -0,0 +1,115 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * fdman.c - File descriptor management. -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ */ -+#include -+#include -+#include "fdman.h" -+ -+extern int pspDisableInterrupts(); -+extern void pspEnableInterrupts(int); -+ -+static __psp_descriptormap_type __psp_descriptor_data_pool[__PSP_FILENO_MAX]; -+__psp_descriptormap_type *__psp_descriptormap [__PSP_FILENO_MAX]; -+ -+void __psp_fdman_init() -+{ -+ int scefd; -+ -+ /* Initialize descriptor data*/ -+ memset(__psp_descriptor_data_pool, 0, sizeof(__psp_descriptormap_type) *__PSP_FILENO_MAX); -+ /* Initialize descriptor map*/ -+ memset(__psp_descriptormap, 0, sizeof(__psp_descriptormap_type*)*__PSP_FILENO_MAX); -+ -+ scefd = sceKernelStdin(); -+ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) { -+ __psp_descriptormap[0] = &__psp_descriptor_data_pool[0]; -+ __psp_descriptormap[0]->sce_descriptor = scefd; -+ __psp_descriptormap[0]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+ scefd = sceKernelStdout(); -+ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) { -+ __psp_descriptormap[1] = &__psp_descriptor_data_pool[1]; -+ __psp_descriptormap[1]->sce_descriptor = scefd; -+ __psp_descriptormap[1]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+ scefd = sceKernelStderr(); -+ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) { -+ __psp_descriptormap[2] = &__psp_descriptor_data_pool[2]; -+ __psp_descriptormap[2]->sce_descriptor = scefd; -+ __psp_descriptormap[2]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+} -+ -+int __psp_fdman_get_new_descriptor() -+{ -+ int i = 0; -+ int inten; -+ -+ inten = pspDisableInterrupts(); /* lock here to make thread safe */ -+ for (i = 0; i < __PSP_FILENO_MAX; i++) { -+ if (__psp_descriptormap[i] == NULL) { -+ __psp_descriptormap[i] = &__psp_descriptor_data_pool[i]; -+ __psp_descriptormap[i]->ref_count++; -+ pspEnableInterrupts(inten); /* release lock */ -+ return i; -+ } -+ } -+ pspEnableInterrupts(inten); /* release lock */ -+ -+ errno = ENOMEM; -+ return -1; -+} -+ -+int __psp_fdman_get_dup_descriptor(int fd) -+{ -+ int i = 0; -+ int inten; -+ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ inten = pspDisableInterrupts(); /* lock here to make thread safe */ -+ for (i = 0; i < __PSP_FILENO_MAX; i++) { -+ if (__psp_descriptormap[i] == NULL) { -+ __psp_descriptormap[i] = &__psp_descriptor_data_pool[fd]; -+ __psp_descriptormap[i]->ref_count++; -+ pspEnableInterrupts(inten); /* release lock */ -+ return i; -+ } -+ } -+ pspEnableInterrupts(inten); /* release lock */ -+ -+ errno = ENOMEM; -+ return -1; -+} -+ -+void __psp_fdman_release_descriptor(int fd) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return; -+ } -+ -+ __psp_descriptormap[fd]->ref_count--; -+ -+ if (__psp_descriptormap[fd]->ref_count == 0) { -+ -+ if (__psp_descriptormap[fd]->filename != NULL) { -+ free(__psp_descriptormap[fd]->filename); -+ } -+ __psp_descriptormap[fd]->filename = NULL; -+ __psp_descriptormap[fd]->sce_descriptor = 0; -+ __psp_descriptormap[fd]->type = 0; -+ __psp_descriptormap[fd]->flags = 0; -+ -+ } -+ __psp_descriptormap[fd] = NULL; -+} ---- newlib-1.13.0/newlib/libc/sys/psp/fdman.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/fdman.h 2006-04-28 10:06:39.000000000 -0400 -@@ -0,0 +1,44 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * fdman.h - File descriptor management. -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ */ -+ -+#ifndef _FDMAN_H_ -+ #define _FDMAN_H_ -+ -+ #define __PSP_FILENO_MAX 1024 -+ -+ #define __PSP_IS_FD_VALID(FD) \ -+ ( (FD >= 0) && (FD < __PSP_FILENO_MAX) && (__psp_descriptormap[FD] != NULL) ) -+ -+ #define __PSP_IS_FD_OF_TYPE(FD, TYPE) \ -+ ( (__PSP_IS_FD_VALID(FD)) && (__psp_descriptormap[FD]->type == TYPE) ) -+ -+ typedef enum { -+ __PSP_DESCRIPTOR_TYPE_FILE , -+ __PSP_DESCRIPTOR_TYPE_PIPE , -+ __PSP_DESCRIPTOR_TYPE_SOCKET, -+ __PSP_DESCRIPTOR_TYPE_TTY -+ } __psp_fdman_fd_types; -+ -+ typedef struct { -+ char * filename; -+ u8 type; -+ u32 sce_descriptor; -+ u32 flags; -+ u32 ref_count; -+ } __psp_descriptormap_type; -+ -+ extern __psp_descriptormap_type *__psp_descriptormap[__PSP_FILENO_MAX]; -+ -+ void __psp_fdman_init(); -+ int __psp_fdman_get_new_descriptor(); -+ int __psp_fdman_get_dup_descriptor(int fd); -+ void __psp_fdman_release_descriptor(int fd); -+ -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/include/netdb.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/include/netdb.h 2006-05-02 11:27:30.000000000 -0400 -@@ -0,0 +1,36 @@ -+/* Simple gethostbyname and gethostbyaddr replacements, note not thread safe */ -+#ifndef __NETDB_H__ -+#define __NETDB_H__ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#define NETDB_INTERNAL -1 /* see errno */ -+#define NETDB_SUCCESS 0 /* no problem */ -+#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ -+#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ -+#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -+#define NO_DATA 4 /* Valid name, no data record of requested type */ -+#define NO_ADDRESS NO_DATA /* no address, look for MX record */ -+ -+extern int h_errno; -+ -+struct hostent -+{ -+ char *h_name; -+ char **h_aliases; -+ int h_addrtype; -+ int h_length; -+ char **h_addr_list; -+ char *h_addr; -+}; -+ -+struct hostent *gethostbyaddr(const void *addr, int len, int type); -+struct hostent *gethostbyname(const char *name); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/interrupt.S 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/interrupt.S 2006-05-02 11:28:43.000000000 -0400 -@@ -0,0 +1,66 @@ -+ -+ .set noreorder -+ .set noat -+ -+ .global pspDisableInterrupts -+ .ent pspDisableInterrupts -+ -+pspDisableInterrupts: -+ mfic $v0, $0 -+ mtic $0, $0 -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ jr $ra -+ nop -+ -+ .end pspDisableInterrupts -+ -+ .global pspEnableInterrupts -+ .ent pspEnableInterrupts -+ -+pspEnableInterrupts: -+ mtic $a0, $0 -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ jr $ra -+ nop -+ -+ .end pspEnableInterrupts ---- newlib-1.13.0/newlib/libc/sys/psp/libcglue.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/libcglue.c 2006-05-02 11:03:27.000000000 -0400 -@@ -0,0 +1,898 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * libcglue.c - Newlib-compatible system calls. -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * Copyright (c) 2005 Jim Paris -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "fdman.h" -+ -+extern char __psp_cwd[MAXPATHLEN + 1]; -+extern void __psp_init_cwd(char *argv_0); -+extern int __psp_path_absolute(const char *in, char *out, int len); -+extern int pspDisableInterrupts(); -+extern void pspEnableInterrupts(int); -+ -+/* The following functions are defined in socket.c. They have weak linkage so -+ that the user doesn't have to link against the PSP network libraries if they -+ don't use the sockets API. */ -+extern int __psp_socket_close(int s) __attribute__((weak)); -+extern ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags) __attribute__((weak)); -+extern ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags) __attribute__((weak)); -+ -+extern int pipe(int fildes[2]); -+extern int __psp_pipe_close(int filedes); -+extern int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len); -+extern int __psp_pipe_read(int fd, void *buf, size_t len); -+extern int __psp_pipe_write(int fd, const void *buf, size_t size); -+extern int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len); -+ -+int __psp_set_errno(int code); -+ -+#ifdef F___psp_set_errno -+int __psp_set_errno(int code) -+{ -+ if ((code & 0x80010000) == 0x80010000) { -+ errno = code & 0xFFFF; -+ return -1; -+ } -+ return code; -+} -+#endif -+ -+#ifdef F_getcwd -+char *getcwd(char *buf, size_t size) -+{ -+ if(!buf) { -+ errno = EINVAL; -+ return NULL; -+ } -+ -+ if(strlen(__psp_cwd) >= size) { -+ errno = ERANGE; -+ return NULL; -+ } -+ -+ strcpy(buf, __psp_cwd); -+ return buf; -+} -+#endif -+ -+#ifdef F_chdir -+int chdir(const char *path) -+{ -+ char dest[MAXPATHLEN + 1]; -+ SceUID uid; -+ -+ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ /* sceIoChdir doesn't give an indication of whether it worked, -+ so test for existence by attempting to open the dir */ -+ uid = sceIoDopen(dest); -+ if(uid < 0) { -+ errno = ENOTDIR; -+ return -1; -+ } -+ sceIoDclose(uid); -+ -+ sceIoChdir(dest); -+ strcpy(__psp_cwd, dest); -+ return 0; -+} -+#endif -+ -+#ifdef F_mkdir -+int mkdir(const char *pathname, mode_t mode) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoMkdir(dest, mode)); -+} -+#endif -+ -+#ifdef F_rmdir -+int rmdir(const char *pathname) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoRmdir(dest)); -+} -+#endif -+ -+#ifdef F_realpath -+char *realpath(const char *path, char *resolved_path) -+{ -+ if(!path || !resolved_path) { -+ errno = EINVAL; -+ return NULL; -+ } -+ if(__psp_path_absolute(path, resolved_path, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return NULL; -+ } -+ if(access(resolved_path, F_OK) < 0) { -+ errno = ENOENT; -+ return NULL; -+ } -+ return resolved_path; -+} -+#endif -+ -+/* Wrappers of the standard open(), close(), read(), write(), unlink() and lseek() routines. */ -+#ifdef F__open -+int _open(const char *name, int flags, int mode) -+{ -+ int scefd, fd; -+ int sce_flags; -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(name, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ /* O_RDONLY starts at 0, where PSP_O_RDONLY starts at 1, so remap the read/write -+ flags by adding 1. */ -+ sce_flags = (flags & O_ACCMODE) + 1; -+ -+ /* Translate standard open flags into the flags understood by the PSP kernel. */ -+ if (flags & O_APPEND) { -+ sce_flags |= PSP_O_APPEND; -+ } -+ if (flags & O_CREAT) { -+ sce_flags |= PSP_O_CREAT; -+ } -+ if (flags & O_TRUNC) { -+ sce_flags |= PSP_O_TRUNC; -+ } -+ if (flags & O_EXCL) { -+ sce_flags |= PSP_O_EXCL; -+ } -+ if (flags & O_NONBLOCK) { -+ sce_flags |= PSP_O_NBLOCK; -+ } -+ -+ scefd = sceIoOpen(dest, sce_flags, mode); -+ if (scefd >= 0) { -+ fd = __psp_fdman_get_new_descriptor(); -+ if (fd != -1) { -+ __psp_descriptormap[fd]->sce_descriptor = scefd; -+ __psp_descriptormap[fd]->type = __PSP_DESCRIPTOR_TYPE_FILE; -+ __psp_descriptormap[fd]->flags = flags; -+ __psp_descriptormap[fd]->filename = strdup(dest); -+ return fd; -+ } -+ else { -+ sceIoClose(scefd); -+ errno = ENOMEM; -+ return -1; -+ } -+ } -+ else { -+ return __psp_set_errno(scefd); -+ } -+ -+} -+#endif -+ -+#ifdef F__close -+int _close(int fd) -+{ -+ int ret = 0; -+ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ if (__psp_descriptormap[fd]->ref_count == 1) { -+ ret = __psp_set_errno(sceIoClose(__psp_descriptormap[fd]->sce_descriptor)); -+ } -+ __psp_fdman_release_descriptor(fd); -+ return ret; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ return __psp_pipe_close(fd); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_close != NULL) { -+ ret = __psp_socket_close(fd); -+ return ret; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F__read -+int _read(int fd, void *buf, size_t size) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ return __psp_set_errno(sceIoRead(__psp_descriptormap[fd]->sce_descriptor, buf, size)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) { -+ return __psp_pipe_nonblocking_read(fd, buf, size); -+ } -+ else { -+ return __psp_pipe_read(fd, buf, size); -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_recv != NULL) { -+ return __psp_socket_recv(fd, buf, size, 0); -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+ -+} -+#endif -+ -+#ifdef F__write -+int _write(int fd, const void *buf, size_t size) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ return __psp_set_errno(sceIoWrite(__psp_descriptormap[fd]->sce_descriptor, buf, size)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) { -+ return __psp_pipe_nonblocking_write(fd, buf, size); -+ } -+ else { -+ return __psp_pipe_write(fd, buf, size); -+ } -+ break; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_send != NULL) { -+ return __psp_socket_send(fd, buf, size, 0); -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F__lseek -+off_t _lseek(int fd, off_t offset, int whence) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ /* We don't have to do anything with the whence argument because SEEK_* == PSP_SEEK_*. */ -+ return (off_t) __psp_set_errno(sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, offset, whence)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+ -+} -+#endif -+ -+#ifdef F__unlink -+int _unlink(const char *path) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoRemove(dest)); -+} -+#endif -+ -+#ifdef F__link -+int _link(const char *name1, const char *name2) -+{ -+ errno = ENOSYS; -+ return -1; /* not supported */ -+} -+#endif -+ -+#ifdef F_opendir -+DIR *opendir(const char *filename) -+{ -+ char dest[MAXPATHLEN + 1]; -+ DIR *dirp; -+ SceUID uid; -+ -+ /* Normalize pathname so that opendir(".") works */ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENOENT; -+ return NULL; -+ } -+ -+ dirp = (DIR *)malloc(sizeof(DIR)); -+ -+ uid = sceIoDopen(dest); -+ -+ if (uid < 0) -+ { -+ free(dirp); -+ (void) __psp_set_errno(uid); -+ return NULL; -+ } -+ -+ dirp->uid = uid; -+ -+ return dirp; -+} -+#endif -+ -+#ifdef F_readdir -+struct dirent *readdir(DIR *dirp) -+{ -+ int ret; -+ -+ /* Zero the dirent, to avoid possible problems with sceIoDread */ -+ memset(&dirp->de, 0, sizeof(struct dirent)); -+ -+ ret = sceIoDread(dirp->uid, (SceIoDirent *)&dirp->de); -+ if (ret == 0) { -+ /* EOF */ -+ errno = 0; -+ return NULL; -+ } -+ if (ret < 0) { -+ (void) __psp_set_errno(ret); -+ return NULL; -+ } -+ -+ return &dirp->de; -+} -+#endif -+ -+#ifdef F_closedir -+int closedir(DIR *dirp) -+{ -+ if (dirp != NULL) -+ { -+ int uid; -+ uid = dirp->uid; -+ free (dirp); -+ return __psp_set_errno(sceIoDclose(uid)); -+ } -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+/* Time routines. These wrap around the routines provided by the kernel. */ -+#ifdef F__gettimeofday -+int _gettimeofday(struct timeval *tp, struct timezone *tzp) -+{ -+ return __psp_set_errno(sceKernelLibcGettimeofday(tp, tzp)); -+} -+ -+#endif -+ -+#if defined(F_clock) -+clock_t clock(void) -+{ -+ return sceKernelLibcClock(); -+} -+#endif -+ -+#if defined(F_time) -+time_t time(time_t *t) -+{ -+ return __psp_set_errno(sceKernelLibcTime(t)); -+} -+#endif -+ -+#if defined(F_sleep) -+unsigned int sleep(unsigned int secs) { -+ while(secs--) { -+ sceKernelDelayThreadCB(1000000); -+ } -+ return 0; -+} -+#endif -+ -+/* PSP-compatible sbrk(). */ -+#if defined(F__sbrk) || defined(F_glue__sbrk) -+/* TODO: Currently our default heap is set to the maximum available block size -+ when sbrk() is first called. Sony seems to always use a default of 64KB, -+ with the expectation that user programs will override the default size with -+ their own desired size. The only reason I can think of them doing this is -+ to allow each PRX to have their own seperate heap. I think that their -+ method is overkill for most user programs. -+ -+ What I'd like to do instead is to use the default of 64KB for PRXes as Sony -+ does, but use the maximum available block size for executables. This avoids -+ the requirement of specifying the heap size manually in user programs. -+ However, we currently don't have a clean way to distinguish PRXes and normal -+ executables, so this code needs to be revisited once we do come up with a -+ way. */ -+#define DEFAULT_PRX_HEAP_SIZE_KB 64 -+ -+/* If defined it specifies the desired size of the heap, in KB. */ -+extern unsigned int sce_newlib_heap_kb_size __attribute__((weak)); -+extern int __pspsdk_is_prx __attribute__((weak)); -+ -+/* UID of the memory block that represents the heap. */ -+static SceUID __psp_heap_blockid; -+ -+void * _sbrk(ptrdiff_t incr) -+{ -+ static void * heap_bottom = NULL; -+ static void * heap_top = NULL; -+ static void * heap_ptr = NULL; -+ -+ /* Has our heap been initialized? */ -+ if (heap_bottom == NULL) { -+ /* No, initialize the heap. */ -+ SceSize heap_size; -+ -+ if (&sce_newlib_heap_kb_size != NULL) { -+ heap_size = sce_newlib_heap_kb_size * 1024; -+ } else { -+ if (&__pspsdk_is_prx != NULL) { -+ heap_size = DEFAULT_PRX_HEAP_SIZE_KB * 1024; -+ } else { -+ heap_size = sceKernelMaxFreeMemSize(); -+ } -+ } -+ -+ __psp_heap_blockid = sceKernelAllocPartitionMemory(2, "block", PSP_SMEM_Low, heap_size, NULL); -+ if (__psp_heap_blockid > 0) { -+ heap_bottom = sceKernelGetBlockHeadAddr(__psp_heap_blockid); -+ heap_ptr = heap_bottom; -+ heap_top = (unsigned char *) heap_bottom + heap_size; -+ } -+ } -+ -+ void * heap_addr = (void *) -1; -+ void * next_heap_ptr = (void *) ((ptrdiff_t) heap_ptr + incr); -+ if ((heap_bottom != NULL) && (next_heap_ptr >= heap_bottom) && (next_heap_ptr < heap_top)) { -+ heap_addr = heap_ptr; -+ heap_ptr = next_heap_ptr; -+ } -+ -+ return heap_addr; -+} -+ -+/* Free the heap. */ -+int __psp_free_heap(void) -+{ -+ if (__psp_heap_blockid > 0) { -+ return sceKernelFreePartitionMemory(__psp_heap_blockid); -+ } -+ -+ return __psp_heap_blockid; -+} -+#endif -+ -+/* Other POSIX routines that must be defined. */ -+#ifdef F__fstat -+int _fstat(int fd, struct stat *sbuf) -+{ -+ int ret; -+ SceOff oldpos; -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ memset(sbuf, '\0', sizeof(struct stat)); -+ sbuf->st_mode = S_IFCHR; -+ return 0; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ if (__psp_descriptormap[fd]->filename != NULL) { -+ ret = stat(__psp_descriptormap[fd]->filename, sbuf); -+ -+ /* Find true size of the open file */ -+ oldpos = sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_CUR); -+ if (oldpos != (off_t) -1) { -+ sbuf->st_size = (off_t) sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_END); -+ sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, oldpos, SEEK_SET); -+ } -+ return ret; -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F_isatty -+int isatty(int fd) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return 0; -+ } -+ -+ if (__psp_descriptormap[fd]->type == __PSP_DESCRIPTOR_TYPE_TTY) { -+ return 1; -+ } -+ else { -+ return 0; -+ } -+} -+#endif -+ -+#ifdef F__stat -+static time_t psp_to_epoch_time(ScePspDateTime psp_time) -+{ -+ struct tm conv_time; -+ conv_time.tm_year = psp_time.year; -+ conv_time.tm_mon = psp_time.month; -+ conv_time.tm_mday = psp_time.day; -+ conv_time.tm_hour = psp_time.hour; -+ conv_time.tm_min = psp_time.minute; -+ conv_time.tm_sec = psp_time.second; -+ conv_time.tm_isdst = -1; -+ return mktime(&conv_time); -+} -+ -+int _stat(const char *filename, struct stat *buf) -+{ -+ SceIoStat psp_stat; -+ char dest[MAXPATHLEN + 1]; -+ int ret; -+ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ memset(buf, '\0', sizeof(struct stat)); -+ ret = sceIoGetstat(dest, &psp_stat); -+ if (ret < 0) { -+ return __psp_set_errno(ret); -+ } -+ -+ buf->st_ctime = psp_to_epoch_time(psp_stat.st_ctime); -+ buf->st_atime = psp_to_epoch_time(psp_stat.st_atime); -+ buf->st_mtime = psp_to_epoch_time(psp_stat.st_mtime); -+ -+ buf->st_mode = (psp_stat.st_mode & 0xfff) | -+ ((FIO_S_ISLNK(psp_stat.st_mode))?(S_IFLNK):(0)) | -+ ((FIO_S_ISREG(psp_stat.st_mode))?(S_IFREG):(0)) | -+ ((FIO_S_ISDIR(psp_stat.st_mode))?(S_IFDIR):(0)); -+ buf->st_size = psp_stat.st_size; -+ return 0; -+} -+#endif -+ -+/* from stat.h in ps2sdk, this function may be correct */ -+#define FIO_CST_SIZE 0x0004 -+ -+#ifdef F_truncate -+int truncate(const char *filename, off_t length) -+{ -+ SceIoStat psp_stat; -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ psp_stat.st_size = length; -+ if(length < 0) -+ { -+ errno = EINVAL; -+ return -1; -+ } -+ return __psp_set_errno(sceIoChstat(dest, &psp_stat, FIO_CST_SIZE)); -+} -+#endif -+ -+/* Unsupported newlib system calls. */ -+#ifdef F__fork -+pid_t fork(void) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F__getpid -+pid_t _getpid(void) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F__kill -+int _kill(int unused, int unused2) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+#endif -+ -+#ifdef F__wait -+pid_t _wait(int *unused) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F_access -+int access(const char *fn, int flags) -+{ -+ struct stat s; -+ if (stat(fn, &s)) -+ return -1; -+ if (s.st_mode & S_IFDIR) -+ return 0; -+ if (flags & W_OK) -+ { -+ if (s.st_mode & S_IWRITE) -+ return 0; -+ errno = EACCES; -+ return -1; -+ } -+ return 0; -+} -+#endif -+ -+#ifdef F__fcntl -+int _fcntl(int fd, int cmd, ...) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch (cmd) -+ { -+ case F_DUPFD: -+ { -+ return __psp_fdman_get_dup_descriptor(fd); -+ break; -+ } -+ case F_GETFL: -+ { -+ return __psp_descriptormap[fd]->flags; -+ break; -+ } -+ case F_SETFL: -+ { -+ int newfl; -+ va_list args; -+ -+ va_start (args, cmd); /* Initialize the argument list. */ -+ newfl = va_arg(args, int); -+ va_end (args); /* Clean up. */ -+ -+ __psp_descriptormap[fd]->flags = newfl; -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (newfl & O_NONBLOCK) -+ { -+ int one = 1; -+ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&one, sizeof(one)); -+ } -+ else -+ { -+ int zero = 0; -+ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&zero, sizeof(zero)); -+ } -+ break; -+ default: -+ break; -+ } -+ return 0; -+ break; -+ } -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif /* F__fcntl */ -+ -+#ifdef F_tzset -+void tzset(void) -+{ -+ static int initialized = 0; -+ -+ if (!initialized) -+ { -+ initialized = 1; -+ -+ /* Don't init if TZ has already been set once, this probably means the user -+ wanted to override what we would set below. */ -+ if (getenv("TZ") == NULL) -+ { -+ /* Initialize timezone from PSP configuration */ -+ int tzOffset = 0; -+ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_TIMEZONE, &tzOffset); -+ int tzOffsetAbs = tzOffset < 0 ? -tzOffset : tzOffset; -+ int hours = tzOffsetAbs / 60; -+ int minutes = tzOffsetAbs - hours * 60; -+ int pspDaylight = 0; -+ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS, &pspDaylight); -+ static char tz[18]; -+ sprintf(tz, "GMT%s%02i:%02i%s", tzOffset < 0 ? "+" : "-", hours, minutes, pspDaylight ? "daylight" : ""); -+ setenv("TZ", tz, 1); -+ } -+ } -+ -+ _tzset_r(_REENT); -+} -+#endif -+ -+#ifdef F_mlock -+static unsigned int lock_count = 0; -+static unsigned int intr_flags = 0; -+ -+void __malloc_lock(struct _reent *ptr) -+{ -+ unsigned int flags = pspDisableInterrupts(); -+ -+ if (lock_count == 0) { -+ intr_flags = flags; -+ } -+ -+ lock_count++; -+} -+ -+void __malloc_unlock(struct _reent *ptr) -+{ -+ if (--lock_count == 0) { -+ pspEnableInterrupts(intr_flags); -+ } -+} -+#endif -+ -+/* Exit. */ -+#if defined(F__exit) || defined(F_glue__exit) -+extern int sce_newlib_nocreate_thread_in_start __attribute__((weak)); -+ -+extern int __psp_free_heap(void); -+ -+void _exit(int status) -+{ -+ if (&sce_newlib_nocreate_thread_in_start == NULL) { -+ /* Free the heap created by _sbrk(). */ -+ __psp_free_heap(); -+ -+ sceKernelSelfStopUnloadModule(1, 0, NULL); -+ } else { -+ if (status == 0) { -+ /* Free the heap created by _sbrk(). */ -+ __psp_free_heap(); -+ } -+ -+ sceKernelExitThread(status); -+ } -+ -+ while (1) ; -+} -+ -+/* Note: This function is being linked into _exit.o. -+ -+ Because __psp_libc_init is a weak import in crt0.c, the linker -+ chooses to ignore an object file in libc.a that contains just this -+ function, since it's not necessary for successful compilation. -+ -+ By putting it instead in _exit.o, which is already used by crt0.c, -+ the linker sees __psp_libc_init and resolves the symbol properly. -+*/ -+void __psp_libc_init(int argc, char *argv[]) -+{ -+ (void) argc; -+ -+ /* Initialize cwd from this program's path */ -+ __psp_init_cwd(argv[0]); -+ -+ /* Initialize filedescriptor management */ -+ __psp_fdman_init(); -+} -+ -+#endif /* F__exit */ -+ ---- newlib-1.13.0/newlib/libc/sys/psp/netdb.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/netdb.c 2006-03-13 00:00:00.000000000 -0500 -@@ -0,0 +1,101 @@ -+/* Simple gethostbyname and gethostbyaddr replacements using the resolver lib */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MAX_NAME 512 -+ -+#ifdef F_h_errno -+int h_errno = NETDB_SUCCESS; -+#endif -+ -+#ifdef F_gethostbyaddr -+struct hostent *gethostbyaddr(const void *addr, int len, int type) -+{ -+ static struct hostent ent; -+ char buf[1024]; -+ static char sname[MAX_NAME] = ""; -+ static struct in_addr saddr = { 0 }; -+ static char *addrlist[2] = { (char *) &saddr, NULL }; -+ int rid; -+ int err; -+ -+ if((len != sizeof(struct in_addr)) || (type != AF_INET) || (addr == NULL)) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ memcpy(&saddr, addr, len); -+ -+ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0) -+ { -+ h_errno = NO_RECOVERY; -+ return NULL; -+ } -+ -+ err = sceNetResolverStartAtoN(rid, &saddr, sname, sizeof(sname), 2, 3); -+ sceNetResolverDelete(rid); -+ if(err < 0) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ ent.h_name = sname; -+ ent.h_aliases = 0; -+ ent.h_addrtype = AF_INET; -+ ent.h_length = sizeof(struct in_addr); -+ ent.h_addr_list = addrlist; -+ ent.h_addr = (char *) &saddr; -+ -+ return &ent; -+} -+#endif -+ -+#ifdef F_gethostbyname -+struct hostent *gethostbyname(const char *name) -+{ -+ static struct hostent ent; -+ char buf[1024]; -+ static char sname[MAX_NAME] = ""; -+ static struct in_addr saddr = { 0 }; -+ static char *addrlist[2] = { (char *) &saddr, NULL }; -+ int rid; -+ -+ if(sceNetInetInetAton(name, &saddr) == 0) -+ { -+ int err; -+ -+ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0) -+ { -+ h_errno = NO_RECOVERY; -+ return NULL; -+ } -+ -+ err = sceNetResolverStartNtoA(rid, name, &saddr, 2, 3); -+ sceNetResolverDelete(rid); -+ if(err < 0) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ } -+ -+ snprintf(sname, MAX_NAME, "%s", name); -+ ent.h_name = sname; -+ ent.h_aliases = 0; -+ ent.h_addrtype = AF_INET; -+ ent.h_length = sizeof(struct in_addr); -+ ent.h_addr_list = addrlist; -+ ent.h_addr = (char *) &saddr; -+ -+ return &ent; -+} -+ -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/netinet/in.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/netinet/in.h 2006-05-02 11:27:30.000000000 -0400 -@@ -0,0 +1,271 @@ -+/* $NetBSD: in.h,v 1.71 2005/08/05 09:21:25 elad Exp $ */ -+ -+/* -+ * Copyright (c) 1982, 1986, 1990, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)in.h 8.3 (Berkeley) 1/3/94 -+ */ -+ -+/* -+ * Constants and structures defined by the internet system, -+ * Per RFC 790, September 1981, and numerous additions. -+ */ -+ -+#ifndef _NETINET_IN_H_ -+#define _NETINET_IN_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+typedef uint32_t in_addr_t; -+typedef uint16_t in_port_t; -+ -+/* -+ * Protocols -+ */ -+#define IPPROTO_IP 0 /* dummy for IP */ -+#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ -+#define IPPROTO_ICMP 1 /* control message protocol */ -+#define IPPROTO_IGMP 2 /* group mgmt protocol */ -+#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ -+#define IPPROTO_IPV4 4 /* IP header */ -+#define IPPROTO_IPIP 4 /* IP inside IP */ -+#define IPPROTO_TCP 6 /* tcp */ -+#define IPPROTO_EGP 8 /* exterior gateway protocol */ -+#define IPPROTO_PUP 12 /* pup */ -+#define IPPROTO_UDP 17 /* user datagram protocol */ -+#define IPPROTO_IDP 22 /* xns idp */ -+#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ -+#define IPPROTO_IPV6 41 /* IP6 header */ -+#define IPPROTO_ROUTING 43 /* IP6 routing header */ -+#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ -+#define IPPROTO_RSVP 46 /* resource reservation */ -+#define IPPROTO_GRE 47 /* GRE encaps RFC 1701 */ -+#define IPPROTO_ESP 50 /* encap. security payload */ -+#define IPPROTO_AH 51 /* authentication header */ -+#define IPPROTO_MOBILE 55 /* IP Mobility RFC 2004 */ -+#define IPPROTO_IPV6_ICMP 58 /* IPv6 ICMP */ -+#define IPPROTO_ICMPV6 58 /* ICMP6 */ -+#define IPPROTO_NONE 59 /* IP6 no next header */ -+#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ -+#define IPPROTO_EON 80 /* ISO cnlp */ -+#define IPPROTO_ETHERIP 97 /* Ethernet-in-IP */ -+#define IPPROTO_ENCAP 98 /* encapsulation header */ -+#define IPPROTO_PIM 103 /* Protocol indep. multicast */ -+#define IPPROTO_IPCOMP 108 /* IP Payload Comp. Protocol */ -+#define IPPROTO_VRRP 112 /* VRRP RFC 2338 */ -+ -+#define IPPROTO_RAW 255 /* raw IP packet */ -+#define IPPROTO_MAX 256 -+ -+/* last return value of *_input(), meaning "all job for this pkt is done". */ -+#define IPPROTO_DONE 257 -+ -+/* sysctl placeholder for (FAST_)IPSEC */ -+#define CTL_IPPROTO_IPSEC 258 -+ -+ -+/* -+ * Local port number conventions: -+ * -+ * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), -+ * unless a kernel is compiled with IPNOPRIVPORTS defined. -+ * -+ * When a user does a bind(2) or connect(2) with a port number of zero, -+ * a non-conflicting local port address is chosen. -+ * -+ * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although -+ * that is settable by sysctl(3); net.inet.ip.anonportmin and -+ * net.inet.ip.anonportmax respectively. -+ * -+ * A user may set the IPPROTO_IP option IP_PORTRANGE to change this -+ * default assignment range. -+ * -+ * The value IP_PORTRANGE_DEFAULT causes the default behavior. -+ * -+ * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, -+ * and exists only for FreeBSD compatibility purposes. -+ * -+ * The value IP_PORTRANGE_LOW changes the range to the "low" are -+ * that is (by convention) restricted to privileged processes. -+ * This convention is based on "vouchsafe" principles only. -+ * It is only secure if you trust the remote host to restrict these ports. -+ * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. -+ */ -+ -+#define IPPORT_RESERVED 1024 -+#define IPPORT_ANONMIN 49152 -+#define IPPORT_ANONMAX 65535 -+#define IPPORT_RESERVEDMIN 600 -+#define IPPORT_RESERVEDMAX (IPPORT_RESERVED-1) -+ -+/* -+ * Internet address (a structure for historical reasons) -+ */ -+struct in_addr { -+ in_addr_t s_addr; -+} __attribute__((__packed__)); -+ -+#define __IPADDR(x) ((uint32_t)(x)) -+ -+#define IN_CLASSA(i) (((uint32_t)(i) & __IPADDR(0x80000000)) == \ -+ __IPADDR(0x00000000)) -+#define IN_CLASSA_NET __IPADDR(0xff000000) -+#define IN_CLASSA_NSHIFT 24 -+#define IN_CLASSA_HOST __IPADDR(0x00ffffff) -+#define IN_CLASSA_MAX 128 -+ -+#define IN_CLASSB(i) (((uint32_t)(i) & __IPADDR(0xc0000000)) == \ -+ __IPADDR(0x80000000)) -+#define IN_CLASSB_NET __IPADDR(0xffff0000) -+#define IN_CLASSB_NSHIFT 16 -+#define IN_CLASSB_HOST __IPADDR(0x0000ffff) -+#define IN_CLASSB_MAX 65536 -+ -+#define IN_CLASSC(i) (((uint32_t)(i) & __IPADDR(0xe0000000)) == \ -+ __IPADDR(0xc0000000)) -+#define IN_CLASSC_NET __IPADDR(0xffffff00) -+#define IN_CLASSC_NSHIFT 8 -+#define IN_CLASSC_HOST __IPADDR(0x000000ff) -+ -+#define IN_CLASSD(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xe0000000)) -+/* These ones aren't really net and host fields, but routing needn't know. */ -+#define IN_CLASSD_NET __IPADDR(0xf0000000) -+#define IN_CLASSD_NSHIFT 28 -+#define IN_CLASSD_HOST __IPADDR(0x0fffffff) -+#define IN_MULTICAST(i) IN_CLASSD(i) -+ -+#define IN_EXPERIMENTAL(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xf0000000)) -+#define IN_BADCLASS(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xf0000000)) -+ -+#define IN_LOCAL_GROUP(i) (((uint32_t)(i) & __IPADDR(0xffffff00)) == \ -+ __IPADDR(0xe0000000)) -+ -+#define INADDR_ANY __IPADDR(0x00000000) -+#define INADDR_LOOPBACK __IPADDR(0x7f000001) -+#define INADDR_BROADCAST __IPADDR(0xffffffff) /* must be masked */ -+ -+#define INADDR_UNSPEC_GROUP __IPADDR(0xe0000000) /* 224.0.0.0 */ -+#define INADDR_ALLHOSTS_GROUP __IPADDR(0xe0000001) /* 224.0.0.1 */ -+#define INADDR_ALLRTRS_GROUP __IPADDR(0xe0000002) /* 224.0.0.2 */ -+#define INADDR_MAX_LOCAL_GROUP __IPADDR(0xe00000ff) /* 224.0.0.255 */ -+ -+#define IN_LOOPBACKNET 127 /* official! */ -+ -+/* -+ * Socket address, internet style. -+ */ -+struct sockaddr_in { -+ uint8_t sin_len; -+ sa_family_t sin_family; -+ in_port_t sin_port; -+ struct in_addr sin_addr; -+ int8_t sin_zero[8]; -+}; -+ -+#define INET_ADDRSTRLEN 16 -+ -+/* -+ * Structure used to describe IP options. -+ * Used to store options internally, to pass them to a process, -+ * or to restore options retrieved earlier. -+ * The ip_dst is used for the first-hop gateway when using a source route -+ * (this gets put into the header proper). -+ */ -+struct ip_opts { -+ struct in_addr ip_dst; /* first hop, 0 w/o src rt */ -+#if defined(__cplusplus) -+ int8_t Ip_opts[40]; /* actually variable in size */ -+#else -+ int8_t ip_opts[40]; /* actually variable in size */ -+#endif -+}; -+ -+/* -+ * Options for use with [gs]etsockopt at the IP level. -+ * First word of comment is data type; bool is stored in int. -+ */ -+#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ -+#define IP_HDRINCL 2 /* int; header is included with data */ -+#define IP_TOS 3 /* int; IP type of service and preced. */ -+#define IP_TTL 4 /* int; IP time to live */ -+#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ -+#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ -+#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ -+#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ -+#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */ -+#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ -+#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ -+#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ -+#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ -+#define IP_PORTRANGE 19 /* int; range to use for ephemeral port */ -+#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ -+#define IP_ERRORMTU 21 /* int; get MTU of last xmit = EMSGSIZE */ -+#if 1 /*IPSEC*/ -+#define IP_IPSEC_POLICY 22 /* struct; get/set security policy */ -+#endif -+ -+/* -+ * Defaults and limits for options -+ */ -+#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ -+#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ -+#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */ -+ -+/* -+ * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. -+ */ -+struct ip_mreq { -+ struct in_addr imr_multiaddr; /* IP multicast address of group */ -+ struct in_addr imr_interface; /* local IP address of interface */ -+}; -+ -+/* -+ * Argument for IP_PORTRANGE: -+ * - which range to search when port is unspecified at bind() or connect() -+ */ -+#define IP_PORTRANGE_DEFAULT 0 /* default range */ -+#define IP_PORTRANGE_HIGH 1 /* same as DEFAULT (FreeBSD compat) */ -+#define IP_PORTRANGE_LOW 2 /* use privileged range */ -+ -+#define ntohs(x) __builtin_allegrex_wsbh(x) -+#define ntohl(x) __builtin_allegrex_wsbw(x) -+#define htons(x) __builtin_allegrex_wsbh(x) -+#define htonl(x) __builtin_allegrex_wsbw(x) -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_NETINET_IN_H_ */ ---- newlib-1.13.0/newlib/libc/sys/psp/netinet/tcp.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/netinet/tcp.h 2006-05-02 11:27:30.000000000 -0400 -@@ -0,0 +1,12 @@ -+#ifndef __NETINET_TCP_H__ -+#define __NETINET_TCP_H__ -+ -+#include -+ -+#define SOL_TCP IPPROTO_TCP -+ -+/* Socket options */ -+#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -+#define TCP_MAXSEG 0x02 /* set maximum segment size */ -+ -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/pipe.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/pipe.c 2006-04-28 10:08:50.000000000 -0400 -@@ -0,0 +1,271 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * pipe.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ * -+ */ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include "fdman.h" -+ -+/* Pipe functions */ -+/* Returns how many bytes are in the pipe -- waiting to be read */ -+size_t __psp_pipe_peekmsgsize(int fd) -+{ -+ SceKernelMppInfo info; -+ info.size = sizeof(info); -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ return (info.bufSize - info.freeSize); -+ } -+ else { -+ return -1; -+ } -+} -+ -+int pipe(int fildes[2]) -+{ -+ static int iIndex = 0; -+ char name[32]; -+ iIndex++; -+ -+ sprintf(name, "__psp_pipe_%02d", iIndex); -+ -+ SceUID uid = sceKernelCreateMsgPipe(name, PSP_MEMORY_PARTITION_USER, 0, (void *)PIPE_BUF, NULL); -+ -+ if (uid >= 0) { -+ fildes[0] = __psp_fdman_get_new_descriptor(); -+ if (fildes[0] != -1) { -+ __psp_descriptormap[fildes[0]]->sce_descriptor = uid; -+ __psp_descriptormap[fildes[0]]->type = __PSP_DESCRIPTOR_TYPE_PIPE; -+ } -+ else { -+ sceKernelDeleteMsgPipe(uid); -+ errno = EFAULT; -+ return -1; -+ } -+ -+ fildes[1] = __psp_fdman_get_dup_descriptor(fildes[0]); -+ if (fildes[1] != -1) { -+ __psp_descriptormap[fildes[1]]->sce_descriptor = uid; -+ return 0; -+ } -+ else { -+ sceKernelDeleteMsgPipe(uid); -+ errno = EFAULT; -+ return -1; -+ } -+ -+ } -+ else { -+ errno = EFAULT; -+ return -1; -+ } -+} -+ -+int __psp_pipe_close(int fd) -+{ -+ int ret = 0; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ -+ if ( __psp_descriptormap[fd]->ref_count == 1 ) { -+ /** -+ * Delete a message pipe -+ * -+ * @param uid - The UID of the pipe -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelDeleteMsgPipe(__psp_descriptormap[fd]->sce_descriptor); -+ } -+ -+ __psp_fdman_release_descriptor(fd); -+ -+ if(ret < 0) { -+ return __psp_set_errno(ret); -+ } -+ -+ return 0; -+} -+ -+int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ int size; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ size = __psp_pipe_peekmsgsize(fd); -+ if (size > 0) { -+ if (size < len) { -+ len = size; -+ } -+ } -+ else { -+ errno = EBADF; -+ return -1; -+ } -+ -+ /** -+ * Receive a message from a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for receive -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelTryReceiveMsgPipe(sceuid, buf, len, 0, 0); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else if (ret == SCE_KERNEL_ERROR_MPP_EMPTY) {/* No data */ -+ errno = EAGAIN; -+ return -1; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_read(int fd, void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ int size; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ size = __psp_pipe_peekmsgsize(fd); -+ if (size > 0) { -+ if (size < len) { -+ len = size; -+ } -+ } -+ else { -+ errno = EBADF; -+ return -1; -+ } -+ -+ /** -+ * Receive a message from a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for receive -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelReceiveMsgPipe(sceuid, buf, len, 0, NULL, NULL); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_write(int fd, const void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ char *cbuf; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ /** -+ * Send a message to a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for send -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ cbuf = (char *)buf; -+ ret = sceKernelSendMsgPipe(sceuid, cbuf, len, 0, NULL, NULL); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ char *cbuf; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ cbuf = (char *)buf; -+ ret = sceKernelTrySendMsgPipe(sceuid, cbuf, len, 0, 0); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else if (ret == SCE_KERNEL_ERROR_MPP_FULL) { -+ errno = EAGAIN; -+ return -1; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ ---- newlib-1.13.0/newlib/libc/sys/psp/pspcwd.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/pspcwd.c 2006-04-26 10:50:46.000000000 -0400 -@@ -0,0 +1,166 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * pspcwd.c - Current working directory emulation helper functions -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * Copyright (c) 2005 Jim Paris -+ * -+ */ -+#include -+#include -+#include -+ -+#include -+#include -+ -+char __psp_cwd[MAXPATHLEN + 1] = { 0 }; -+ -+/* Set the current working directory (CWD) to the path where the module was launched. */ -+void __psp_init_cwd(char *argv_0) -+{ -+ if (argv_0 != NULL) { -+ char base_path[MAXPATHLEN + 1]; -+ char *end; -+ -+ strncpy(base_path, argv_0, sizeof(base_path) - 1); -+ base_path[sizeof(base_path) - 1] = '\0'; -+ end = strrchr(base_path, '/'); -+ if (end != NULL) { -+ *(end + 1) = '\0'; -+ chdir(base_path); -+ } -+ } -+} -+ -+/* Return the number of bytes taken up by the "drive:" prefix, -+ or -1 if it's not found */ -+int __psp_get_drive(const char *d) -+{ -+ int i; -+ for(i=0; d[i]; i++) { -+ if(! ((d[i] >= 'a' && d[i] <= 'z') || -+ (d[i] >= '0' && d[i] <= '9') )) -+ break; -+ } -+ if(d[i] == ':') return i+1; -+ return -1; -+} -+ -+/* Like strcpy, but returns 0 if the string doesn't fit */ -+int __psp_safe_strcpy(char *out, const char *in, int maxlen) -+{ -+ for( ; maxlen > 0 && *in ; maxlen-- ) -+ *(out++) = *(in++); -+ if(maxlen < 1) return 0; -+ *out = 0; -+ return 1; -+} -+ -+/* Like strcat, but returns 0 if the string doesn't fit */ -+int __psp_safe_strcat(char *out, const char *in, int maxlen) -+{ -+ for( ; *out ; out++,maxlen-- ) -+ continue; -+ return __psp_safe_strcpy(out, in, maxlen); -+} -+ -+/* Normalize a pathname (without leading "drive:") by removing -+ . and .. components, duplicated /, etc. */ -+int __psp_path_normalize(char *out, int len) -+{ -+ int i, j; -+ int first, next; -+ -+ /* First append "/" to make the rest easier */ -+ if(!__psp_safe_strcat(out,"/",len)) return -10; -+ -+ /* Convert "//" to "/" */ -+ for(i=0; out[i+1]; i++) { -+ if(out[i]=='/' && out[i+1]=='/') { -+ for(j=i+1; out[j]; j++) -+ out[j] = out[j+1]; -+ i--; -+ } -+ } -+ -+ /* Convert "/./" to "/" */ -+ for(i=0; out[i] && out[i+1] && out[i+2]; i++) { -+ if(out[i]=='/' && out[i+1]=='.' && out[i+2]=='/') { -+ for(j=i+1; out[j]; j++) -+ out[j] = out[j+2]; -+ i--; -+ } -+ } -+ -+ /* Convert "/asdf/../" to "/" until we can't anymore. Also -+ * convert leading "/../" to "/" */ -+ first = next = 0; -+ while(1) { -+ /* If a "../" follows, remove it and the parent */ -+ if(out[next+1] && out[next+1]=='.' && -+ out[next+2] && out[next+2]=='.' && -+ out[next+3] && out[next+3]=='/') { -+ for(j=0; out[first+j+1]; j++) -+ out[first+j+1] = out[next+j+4]; -+ first = next = 0; -+ continue; -+ } -+ -+ /* Find next slash */ -+ first = next; -+ for(next=first+1; out[next] && out[next] != '/'; next++) -+ continue; -+ if(!out[next]) break; -+ } -+ -+ /* Remove trailing "/" */ -+ for(i=1; out[i]; i++) -+ continue; -+ if(i >= 1 && out[i-1] == '/') -+ out[i-1] = 0; -+ -+ return 0; -+} -+ -+/* Convert relative path to absolute path. */ -+int __psp_path_absolute(const char *in, char *out, int len) -+{ -+ int dr; -+ -+ /* See what the relative URL starts with */ -+ dr = __psp_get_drive(in); -+ if(dr > 0 && in[dr] == '/') { -+ /* It starts with "drive:/", so it's already absolute */ -+ if(!__psp_safe_strcpy(out, in, len)) -+ return -1; -+ } else if(in[0] == '/') { -+ /* It's absolute, but missing the drive, so use cwd's drive */ -+ if(strlen(__psp_cwd) >= len) -+ return -2; -+ strcpy(out, __psp_cwd); -+ dr = __psp_get_drive(out); -+ out[dr] = 0; -+ if(!__psp_safe_strcat(out, in, len)) -+ return -3; -+ } else { -+ /* It's not absolute, so append it to the current cwd */ -+ if(strlen(__psp_cwd) >= len) -+ return -4; -+ strcpy(out, __psp_cwd); -+ if(!__psp_safe_strcat(out, "/", len)) -+ return -6; -+ if(!__psp_safe_strcat(out, in, len)) -+ return -7; -+ } -+ -+ /* Now normalize the pathname portion */ -+ dr = __psp_get_drive(out); -+ if(dr < 0) dr = 0; -+ return __psp_path_normalize(out + dr, len - dr); -+} -+ ---- newlib-1.13.0/newlib/libc/sys/psp/select.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/select.c 2006-04-28 09:10:56.000000000 -0400 -@@ -0,0 +1,172 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * select.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+ -+#include "fdman.h" -+ -+#define SELECT_POLLING_DELAY_IN_us 100 -+ -+static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds); -+ -+int select(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout) -+{ -+ int count; -+ clock_t start_time, time; -+ -+ start_time = clock(); -+ -+ count = 0; -+ -+ if (timeout) { -+ time = (timeout->tv_sec * CLOCKS_PER_SEC) + (timeout->tv_usec * (1*1000*1000/CLOCKS_PER_SEC)); -+ } -+ else { -+ time = 0; -+ } -+ -+ for (;;) { -+ count = __psp_poll_select(n, readfds, writefds, exceptfds); -+ /* If timeout == NULL, then don't timeout! */ -+ if ( (count > 0) || ((timeout != NULL) && ((clock() - start_time) >= time)) ) { -+ break; -+ } -+ else { -+ /* Nothing found, and not timed-out yet; let's yield for SELECT_POLLING_DELAY_IN_us, so we're not in a busy loop */ -+ sceKernelDelayThread(SELECT_POLLING_DELAY_IN_us); -+ } -+ } -+ -+ return count; -+} -+ -+#define SCE_FD_SET(n, p) \ -+ ((p)->fds_bits[((n) & 0xFF) /__NFDBITS] |= (1 << ((n) % __NFDBITS))) -+ -+static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds) -+{ -+ int fd, count; -+ fd_set ready_readfds, ready_writefds, ready_exceptfds; -+ fd_set scereadfds, scewritefds, sceexceptfds; -+ SceKernelMppInfo info; -+ struct timeval scetv; -+ -+ FD_ZERO(&ready_readfds); -+ FD_ZERO(&ready_writefds); -+ FD_ZERO(&ready_exceptfds); -+ -+ info.size = sizeof(info); -+ scetv.tv_sec = 0; -+ scetv.tv_usec = 0; -+ count = 0; -+ -+ for (fd = 0; fd < n; fd++) -+ { -+ if (__psp_descriptormap[fd] != NULL) { -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ if (info.bufSize != info.freeSize) { -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ } -+ else { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ } -+ if (writefds && FD_ISSET(fd, writefds)) { -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ if (info.freeSize > 0) { -+ FD_SET(fd, &ready_writefds); -+ count++; -+ } -+ } -+ else { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ if (readfds && FD_ISSET(fd, readfds)) { -+ /** Just set it for now */ -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ int sce_ret, sce_fd; -+ sce_fd = __psp_descriptormap[fd]->sce_descriptor; -+ FD_ZERO(&scereadfds); -+ SCE_FD_SET(sce_fd, &scereadfds); -+ errno = 0; -+ sce_ret = sceNetInetSelect (sce_fd+1, &scereadfds, NULL, NULL, &scetv); -+ if (sce_ret>0) { -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ else if (sce_ret == -1) { -+ errno = sceNetInetGetErrno(); -+ if (exceptfds && FD_ISSET(fd, exceptfds)) { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } else { -+ count = -1; -+ } -+ } -+ } -+ if (writefds && FD_ISSET(fd, writefds)) { -+ int sce_ret; -+ FD_ZERO(&scewritefds); -+ SCE_FD_SET(__psp_descriptormap[fd]->sce_descriptor, &scewritefds); -+ sce_ret = sceNetInetSelect (__psp_descriptormap[fd]->sce_descriptor+1, NULL, &scewritefds, NULL, &scetv); -+ if (sce_ret>0) { -+ FD_SET(fd, &ready_writefds); -+ count++; -+ } -+ else if (sce_ret == -1) { -+ if (exceptfds && FD_ISSET(fd, exceptfds)) { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ else { -+ count = -1; -+ } -+ } -+ } -+ break; -+ } -+ } -+ } -+ -+ if (count > 0) { -+ if (readfds) -+ *readfds = ready_readfds; -+ if (writefds) -+ *writefds = ready_writefds; -+ if (exceptfds) -+ *exceptfds = ready_exceptfds; -+ } -+ -+ return count; -+} -+ ---- newlib-1.13.0/newlib/libc/sys/psp/socket.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/socket.c 2006-04-28 10:11:57.000000000 -0400 -@@ -0,0 +1,390 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * socket.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include "fdman.h" -+ -+#ifdef F_socket -+int socket(int domain, int type, int protocol) -+{ -+ int sock, scesock; -+ int i; -+ -+ scesock = sceNetInetSocket(domain, type, protocol); -+ if(scesock < 0) { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ sock = __psp_fdman_get_new_descriptor(); -+ if( sock != -1 ) { -+ __psp_descriptormap[sock]->sce_descriptor = scesock; -+ __psp_descriptormap[sock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET; -+ } -+ else { -+ sceNetInetClose(scesock); -+ errno = ENOENT; -+ return -1; -+ } -+ -+ return sock; -+} -+ -+/* These are glue routines that are called from _close(), _read(), and -+ _write(). They are here so that any program that uses socket() will pull -+ them in and have expanded socket capability. */ -+ -+int __psp_socket_close(int sock) -+{ -+ int ret = 0; -+ -+ if (__psp_descriptormap[sock]->ref_count == 1) { -+ ret = sceNetInetClose(__psp_descriptormap[sock]->sce_descriptor); -+ } -+ -+ __psp_fdman_release_descriptor(sock); -+ -+ if(ret < 0) -+ { -+ /* If close is defined likely errno is */ -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags) -+{ -+ return recv(s, buf, len, flags); -+} -+ -+ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags) -+{ -+ return send(s, buf, len, flags); -+} -+#endif -+ -+#ifdef F_accept -+int accept(int s, struct sockaddr *addr, socklen_t *addrlen) -+{ -+ int newscesock, newsock; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ newscesock = sceNetInetAccept(__psp_descriptormap[s]->sce_descriptor, addr, addrlen); -+ if( (newscesock >= 0) ) { -+ newsock = __psp_fdman_get_new_descriptor(); -+ if ( newsock != -1 ) { -+ __psp_descriptormap[newsock]->sce_descriptor = newscesock; -+ __psp_descriptormap[newsock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET; -+ } -+ else { -+ sceNetInetClose(newscesock); -+ errno = ENOENT; -+ return -1; -+ } -+ } -+ else { -+ errno = ENOENT; -+ return -1; -+ } -+ -+ return newsock; -+} -+#endif -+ -+#ifdef F_bind -+int bind(int s, const struct sockaddr *my_addr, socklen_t addrlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetBind(__psp_descriptormap[s]->sce_descriptor, my_addr, addrlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_connect -+int connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetConnect(__psp_descriptormap[s]->sce_descriptor, serv_addr, addrlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_setsockopt -+int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_listen -+int listen(int s, int backlog) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetListen(__psp_descriptormap[s]->sce_descriptor, backlog); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_recv -+ssize_t recv(int s, void *buf, size_t len, int flags) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetRecv(__psp_descriptormap[s]->sce_descriptor, buf, len, flags); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_recvfrom -+ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetRecvfrom(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, from, fromlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_send -+ssize_t send(int s, const void *buf, size_t len, int flags) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSend(__psp_descriptormap[s]->sce_descriptor, buf, len, flags); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_sendto -+ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSendto(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, to, tolen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_setsockopt -+int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ else -+ { -+ if ( (level == SOL_SOCKET) && (optname == SO_NONBLOCK) ) { -+ if (*((int*)optval) == 1) { -+ __psp_descriptormap[s]->flags |= O_NONBLOCK; -+ } -+ else { -+ __psp_descriptormap[s]->flags &= ~O_NONBLOCK; -+ } -+ } -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_shutdown -+int shutdown(int s, int how) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetShutdown(__psp_descriptormap[s]->sce_descriptor, how); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_getpeername -+int getpeername(int s, struct sockaddr *name, socklen_t *namelen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetpeername(__psp_descriptormap[s]->sce_descriptor, name, namelen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_getsockname -+int getsockname(int s, struct sockaddr *name, socklen_t *namelen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetsockname(__psp_descriptormap[s]->sce_descriptor, name, namelen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_inet_ntoa -+char *inet_ntoa(struct in_addr in) -+{ -+ static char ip_addr[INET_ADDRSTRLEN+1]; -+ -+ if(sceNetInetInetNtop(AF_INET, &in, ip_addr, INET_ADDRSTRLEN) == NULL) -+ { -+ strcpy(ip_addr, "Invalid"); -+ } -+ -+ return ip_addr; -+} -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/sys/dirent.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/dirent.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,39 @@ -+#ifndef _SYS_DIRENT_H -+#define _SYS_DIRENT_H -+ -+/* PSP dirent.h, based on pspiofilemgr_dirent.h -+ by Jim Paris */ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+#define MAXNAMLEN 255 -+ -+/* Same as SceIoDirent, just with a different name. */ -+struct dirent { -+ /** File status. */ -+ SceIoStat d_stat; -+ /** File name. */ -+ char d_name[256]; -+ /** Device-specific data. */ -+ void * d_private; -+ int dummy; -+}; -+ -+typedef struct { -+ SceUID uid; -+ struct dirent de; -+} DIR; -+ -+DIR *opendir (const char *); -+struct dirent *readdir (DIR *); -+int closedir (DIR *); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif ---- newlib-1.13.0/newlib/libc/sys/psp/sys/errno.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/errno.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,158 @@ -+/* errno.h for PSP, based on newlib/libc/include/sys/errno.h. */ -+ -+#ifndef _SYS_ERRNO_H_ -+#ifdef __cplusplus -+extern "C" { -+#endif -+#define _SYS_ERRNO_H_ -+ -+#include -+ -+#ifndef _REENT_ONLY -+#define errno (*__errno()) -+extern int *__errno _PARAMS ((void)); -+#endif -+ -+/* Please don't use these variables directly. -+ Use strerror instead. */ -+extern __IMPORT _CONST char * _CONST _sys_errlist[]; -+extern __IMPORT int _sys_nerr; -+#ifdef __CYGWIN__ -+extern __IMPORT const char * const sys_errlist[]; -+extern __IMPORT int sys_nerr; -+#endif -+ -+#define __errno_r(ptr) ((ptr)->_errno) -+ -+#define EPERM 1 /* Not super-user */ -+#define ENOENT 2 /* No such file or directory */ -+#define ESRCH 3 /* No such process */ -+#define EINTR 4 /* Interrupted system call */ -+#define EIO 5 /* I/O error */ -+#define ENXIO 6 /* No such device or address */ -+#define E2BIG 7 /* Arg list too long */ -+#define ENOEXEC 8 /* Exec format error */ -+#define EBADF 9 /* Bad file number */ -+#define ECHILD 10 /* No children */ -+#define EAGAIN 11 /* No more processes */ -+#define ENOMEM 12 /* Not enough core */ -+#define EACCES 13 /* Permission denied */ -+#define EFAULT 14 /* Bad address */ -+#define ENOTBLK 15 /* Block device required */ -+#define EBUSY 16 /* Mount device busy */ -+#define EEXIST 17 /* File exists */ -+#define EXDEV 18 /* Cross-device link */ -+#define ENODEV 19 /* No such device */ -+#define ENOTDIR 20 /* Not a directory */ -+#define EISDIR 21 /* Is a directory */ -+#define EINVAL 22 /* Invalid argument */ -+#define ENFILE 23 /* Too many open files in system */ -+#define EMFILE 24 /* Too many open files */ -+#define ENOTTY 25 /* Not a typewriter */ -+#define ETXTBSY 26 /* Text file busy */ -+#define EFBIG 27 /* File too large */ -+#define ENOSPC 28 /* No space left on device */ -+#define ESPIPE 29 /* Illegal seek */ -+#define EROFS 30 /* Read only file system */ -+#define EMLINK 31 /* Too many links */ -+#define EPIPE 32 /* Broken pipe */ -+#define EDOM 33 /* Math arg out of domain of func */ -+#define ERANGE 34 /* Math result not representable */ -+#define ENOMSG 35 /* No message of desired type */ -+#define EIDRM 36 /* Identifier removed */ -+#define ECHRNG 37 /* Channel number out of range */ -+#define EL2NSYNC 38 /* Level 2 not synchronized */ -+#define EL3HLT 39 /* Level 3 halted */ -+#define EL3RST 40 /* Level 3 reset */ -+#define ELNRNG 41 /* Link number out of range */ -+#define EUNATCH 42 /* Protocol driver not attached */ -+#define ENOCSI 43 /* No CSI structure available */ -+#define EL2HLT 44 /* Level 2 halted */ -+#define EDEADLK 45 /* Deadlock condition */ -+#define ENOLCK 46 /* No record locks available */ -+#define EBADE 50 /* Invalid exchange */ -+#define EBADR 51 /* Invalid request descriptor */ -+#define EXFULL 52 /* Exchange full */ -+#define ENOANO 53 /* No anode */ -+#define EBADRQC 54 /* Invalid request code */ -+#define EBADSLT 55 /* Invalid slot */ -+#define EDEADLOCK 56 /* File locking deadlock error */ -+#define EBFONT 57 /* Bad font file fmt */ -+#define ENOSTR 60 /* Device not a stream */ -+#define ENODATA 61 /* No data (for no delay io) */ -+#define ETIME 62 /* Timer expired */ -+#define ENOSR 63 /* Out of streams resources */ -+#define ENONET 64 /* Machine is not on the network */ -+#define ENOPKG 65 /* Package not installed */ -+#define EREMOTE 66 /* The object is remote */ -+#define ENOLINK 67 /* The link has been severed */ -+#define EADV 68 /* Advertise error */ -+#define ESRMNT 69 /* Srmount error */ -+#define ECOMM 70 /* Communication error on send */ -+#define EPROTO 71 /* Protocol error */ -+#define EMULTIHOP 74 /* Multihop attempted */ -+#define ELBIN 75 /* Inode is remote (not really error) */ -+#define EDOTDOT 76 /* Cross mount point (not really error) */ -+#define EBADMSG 77 /* Trying to read unreadable message */ -+#define EFTYPE 79 /* Inappropriate file type or format */ -+#define ENOTUNIQ 80 /* Given log. name not unique */ -+#define EBADFD 81 /* f.d. invalid for this operation */ -+#define EREMCHG 82 /* Remote address changed */ -+#define ELIBACC 83 /* Can't access a needed shared lib */ -+#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -+#define ELIBSCN 85 /* .lib section in a.out corrupted */ -+#define ELIBMAX 86 /* Attempting to link in too many libs */ -+#define ELIBEXEC 87 /* Attempting to exec a shared library */ -+#define ENOSYS 88 /* Function not implemented */ -+#define ENMFILE 89 /* No more files */ -+#define ENOTEMPTY 90 /* Directory not empty */ -+#define ENAMETOOLONG 91 /* File or path name too long */ -+#define ELOOP 92 /* Too many symbolic links */ -+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -+#define EPFNOSUPPORT 96 /* Protocol family not supported */ -+#define ECONNRESET 104 /* Connection reset by peer */ -+#define ENOBUFS 105 /* No buffer space available */ -+#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -+#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -+#define ENOTSOCK 108 /* Socket operation on non-socket */ -+#define ENOPROTOOPT 109 /* Protocol not available */ -+#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -+#define ECONNREFUSED 111 /* Connection refused */ -+#define EADDRINUSE 112 /* Address already in use */ -+#define ECONNABORTED 113 /* Connection aborted */ -+#define ENETUNREACH 114 /* Network is unreachable */ -+#define ENETDOWN 115 /* Network interface is not configured */ -+#define ETIMEDOUT 116 /* Connection timed out */ -+#define EHOSTDOWN 117 /* Host is down */ -+#define EHOSTUNREACH 118 /* Host is unreachable */ -+#define EINPROGRESS 119 /* Connection already in progress */ -+#define EALREADY 120 /* Socket already connected */ -+#define EDESTADDRREQ 121 /* Destination address required */ -+#define EMSGSIZE 122 /* Message too long */ -+#define EPROTONOSUPPORT 123 /* Unknown protocol */ -+#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -+#define EADDRNOTAVAIL 125 /* Address not available */ -+#define ENETRESET 126 -+#define EISCONN 127 /* Socket is already connected */ -+#define ENOTCONN 128 /* Socket is not connected */ -+#define ETOOMANYREFS 129 -+#define EPROCLIM 130 -+#define EUSERS 131 -+#define EDQUOT 132 -+#define ESTALE 133 -+#define ENOTSUP 134 /* Not supported */ -+#define ENOMEDIUM 135 /* No medium (in tape drive) */ -+#define ENOSHARE 136 /* No such host or network path */ -+#define ECASECLASH 137 /* Filename exists with different case */ -+#define EILSEQ 138 -+#define EOVERFLOW 139 /* Value too large for defined data type */ -+ -+/* From cygwin32. */ -+#define EWOULDBLOCK EAGAIN /* Operation would block */ -+ -+#define __ELASTERROR 2000 /* Users can add values starting here */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* _SYS_ERRNO_H */ ---- newlib-1.13.0/newlib/libc/sys/psp/sys/fd_set.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/fd_set.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,69 @@ -+/* $NetBSD: fd_set.h,v 1.1 2005/05/22 12:44:24 kleink Exp $ */ -+ -+/*- -+ * Copyright (c) 1992, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * from: @(#)types.h 8.4 (Berkeley) 1/21/94 -+ */ -+ -+#ifndef _SYS_FD_SET_H_ -+#define _SYS_FD_SET_H_ -+ -+#include -+#include -+ -+/* -+ * Implementation dependent defines, hidden from user space. X/Open does not -+ * specify them. -+ */ -+#define __NBBY 8 /* number of bits in a byte */ -+typedef uint32_t __fd_mask; -+ -+/* bits per mask */ -+#define __NFDBITS ((unsigned int)sizeof(__fd_mask) * __NBBY) -+ -+#define __howmany(x, y) (((x) + ((y) - 1)) / (y)) -+ -+#define FD_SETSIZE 256 -+ -+typedef struct fd_set { -+ __fd_mask fds_bits[__howmany(FD_SETSIZE, __NFDBITS)]; -+} fd_set; -+ -+#define FD_SET(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] |= (1 << ((n) % __NFDBITS))) -+ -+#define FD_CLR(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] &= ~(1 << ((n) % __NFDBITS))) -+ -+#define FD_ISSET(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] & (1 << ((n) % __NFDBITS))) -+ -+#define FD_ZERO(p) (void)__builtin_memset((p), 0, sizeof(*(p))) -+ -+#endif /* _SYS_FD_SET_H_ */ ---- newlib-1.13.0/newlib/libc/sys/psp/sys/ioctl.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/ioctl.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1 @@ -+/* Empty file, here for compatibility */ ---- newlib-1.13.0/newlib/libc/sys/psp/sys/select.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/select.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,54 @@ -+/* $NetBSD: select.h,v 1.24 2005/05/22 12:44:24 kleink Exp $ */ -+ -+/*- -+ * Copyright (c) 1992, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)select.h 8.2 (Berkeley) 1/4/94 -+ */ -+ -+#ifndef _SYS_SELECT_H_ -+#define _SYS_SELECT_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+#include -+ -+int sceNetInetSelect(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout); -+ -+int select(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_SYS_SELECT_H_ */ ---- newlib-1.13.0/newlib/libc/sys/psp/sys/socket.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/sys/socket.h 2006-05-02 11:27:31.000000000 -0400 -@@ -0,0 +1,294 @@ -+/* $NetBSD: socket.h,v 1.77 2005/11/29 03:12:16 christos Exp $ */ -+ -+/* -+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the project nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+/* -+ * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)socket.h 8.6 (Berkeley) 5/3/95 -+ */ -+ -+#ifndef _SYS_SOCKET_H_ -+#define _SYS_SOCKET_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+#include -+#include -+ -+typedef uint8_t sa_family_t; -+typedef uint32_t socklen_t; -+ -+/* -+ * Socket types. -+ */ -+#define SOCK_STREAM 1 /* stream socket */ -+#define SOCK_DGRAM 2 /* datagram socket */ -+#define SOCK_RAW 3 /* raw-protocol interface */ -+#define SOCK_RDM 4 /* reliably-delivered message */ -+#define SOCK_SEQPACKET 5 /* sequenced packet stream */ -+ -+/* -+ * Option flags per-socket. -+ */ -+#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -+#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -+#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -+#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -+#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -+#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ -+#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -+#define SO_LINGER 0x0080 /* linger on close if data present */ -+#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ -+#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ -+#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ -+ -+/* -+ * Additional options, not kept in so_options. -+ */ -+#define SO_SNDBUF 0x1001 /* send buffer size */ -+#define SO_RCVBUF 0x1002 /* receive buffer size */ -+#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -+#define SO_SNDTIMEO 0x1005 /* send timeout */ -+#define SO_RCVTIMEO 0x1006 /* receive timeout */ -+#define SO_ERROR 0x1007 /* get error status and clear */ -+#define SO_TYPE 0x1008 /* get socket type */ -+#define SO_OVERFLOWED 0x1009 /* datagrams: return packets dropped */ -+#define SO_NONBLOCK 0x1009 /* non-blocking I/O */ -+ -+/* -+ * Structure used for manipulating linger option. -+ */ -+struct linger { -+ int l_onoff; /* option on/off */ -+ int l_linger; /* linger time in seconds */ -+}; -+ -+/* -+ * Level number for (get/set)sockopt() to apply to socket itself. -+ */ -+#define SOL_SOCKET 0xffff /* options for socket level */ -+ -+/* -+ * Address families. -+ */ -+#define AF_UNSPEC 0 /* unspecified */ -+#define AF_LOCAL 1 /* local to host (pipes, portals) */ -+#define AF_UNIX AF_LOCAL /* backward compatibility */ -+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -+#define AF_IMPLINK 3 /* arpanet imp addresses */ -+#define AF_PUP 4 /* pup protocols: e.g. BSP */ -+#define AF_CHAOS 5 /* mit CHAOS protocols */ -+#define AF_NS 6 /* XEROX NS protocols */ -+#define AF_ISO 7 /* ISO protocols */ -+#define AF_OSI AF_ISO -+#define AF_ECMA 8 /* european computer manufacturers */ -+#define AF_DATAKIT 9 /* datakit protocols */ -+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -+#define AF_SNA 11 /* IBM SNA */ -+#define AF_DECnet 12 /* DECnet */ -+#define AF_DLI 13 /* DEC Direct data link interface */ -+#define AF_LAT 14 /* LAT */ -+#define AF_HYLINK 15 /* NSC Hyperchannel */ -+#define AF_APPLETALK 16 /* Apple Talk */ -+#define AF_ROUTE 17 /* Internal Routing Protocol */ -+#define AF_LINK 18 /* Link layer interface */ -+#define AF_COIP 20 /* connection-oriented IP, aka ST II */ -+#define AF_CNT 21 /* Computer Network Technology */ -+#define AF_IPX 23 /* Novell Internet Protocol */ -+#define AF_INET6 24 /* IP version 6 */ -+#define AF_ISDN 26 /* Integrated Services Digital Network*/ -+#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ -+#define AF_NATM 27 /* native ATM access */ -+#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */ -+#define AF_MAX 31 -+ -+/* -+ * Structure used by kernel to store most -+ * addresses. -+ */ -+struct sockaddr { -+ uint8_t sa_len; /* total length */ -+ sa_family_t sa_family; /* address family */ -+ char sa_data[14]; /* actually longer; address value */ -+}; -+ -+/* -+ * Protocol families, same as address families for now. -+ */ -+#define PF_UNSPEC AF_UNSPEC -+#define PF_LOCAL AF_LOCAL -+#define PF_UNIX PF_LOCAL /* backward compatibility */ -+#define PF_INET AF_INET -+#define PF_IMPLINK AF_IMPLINK -+#define PF_PUP AF_PUP -+#define PF_CHAOS AF_CHAOS -+#define PF_NS AF_NS -+#define PF_ISO AF_ISO -+#define PF_OSI AF_ISO -+#define PF_ECMA AF_ECMA -+#define PF_DATAKIT AF_DATAKIT -+#define PF_CCITT AF_CCITT -+#define PF_SNA AF_SNA -+#define PF_DECnet AF_DECnet -+#define PF_DLI AF_DLI -+#define PF_LAT AF_LAT -+#define PF_HYLINK AF_HYLINK -+#define PF_APPLETALK AF_APPLETALK -+#define PF_ROUTE AF_ROUTE -+#define PF_LINK AF_LINK -+#if defined(_NETBSD_SOURCE) -+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ -+#endif -+#define PF_COIP AF_COIP -+#define PF_CNT AF_CNT -+#define PF_INET6 AF_INET6 -+#define PF_IPX AF_IPX /* same format as AF_NS */ -+#if defined(_NETBSD_SOURCE) -+#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ -+#define PF_PIP pseudo_AF_PIP -+#endif -+#define PF_ISDN AF_ISDN /* same as E164 */ -+#define PF_E164 AF_E164 -+#define PF_NATM AF_NATM -+#define PF_ARP AF_ARP -+#if defined(_NETBSD_SOURCE) -+#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */ -+#endif -+ -+#define PF_MAX AF_MAX -+ -+#define MSG_OOB 0x1 /* process out-of-band data */ -+#define MSG_PEEK 0x2 /* peek at incoming message */ -+#define MSG_DONTROUTE 0x4 /* send without using routing tables */ -+#define MSG_EOR 0x8 /* data completes record */ -+#define MSG_TRUNC 0x10 /* data discarded before delivery */ -+#define MSG_CTRUNC 0x20 /* control data lost before delivery */ -+#define MSG_WAITALL 0x40 /* wait for full request or error */ -+#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ -+#define MSG_BCAST 0x100 /* this message was rcvd using link-level brdcst */ -+#define MSG_MCAST 0x200 /* this message was rcvd using link-level mcast */ -+ -+/* -+ * Types of socket shutdown(2). -+ */ -+#define SHUT_RD 0 /* Disallow further receives. */ -+#define SHUT_WR 1 /* Disallow further sends. */ -+#define SHUT_RDWR 2 /* Disallow further sends/receives. */ -+ -+struct iovec { -+ void *iov_base; /* Base address. */ -+ size_t iov_len; /* Length. */ -+}; -+ -+struct msghdr { -+ void *msg_name; /* optional address */ -+ socklen_t msg_namelen; /* size of address */ -+ struct iovec *msg_iov; /* scatter/gather array */ -+ int msg_iovlen; /* # elements in msg_iov */ -+ void *msg_control; /* ancillary data, see below */ -+ socklen_t msg_controllen; /* ancillary data buffer len */ -+ int msg_flags; /* flags on received message */ -+}; -+ -+/* BSD-compatible socket API. */ -+int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int bind(int, const struct sockaddr *, socklen_t); -+int connect(int, const struct sockaddr *, socklen_t); -+int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); -+int listen(int, int); -+ssize_t recv(int, void *, size_t, int); -+ssize_t recvfrom(int, void * __restrict, size_t, int, -+ struct sockaddr * __restrict, socklen_t * __restrict); -+ssize_t recvmsg(int s, struct msghdr *msg, int flags); -+ssize_t send(int, const void *, size_t, int); -+ssize_t sendto(int, const void *, -+ size_t, int, const struct sockaddr *, socklen_t); -+ssize_t sendmsg(int s, const struct msghdr *msg, int flags); -+int setsockopt(int, int, int, const void *, socklen_t); -+int shutdown(int, int); -+int socket(int, int, int); -+ -+/* sceNetInet socket API. */ -+int sceNetInetAccept(int s, struct sockaddr *addr, socklen_t *addrlen); -+int sceNetInetBind(int s, const struct sockaddr *my_addr, socklen_t addrlen); -+int sceNetInetConnect(int s, const struct sockaddr *serv_addr, socklen_t addrlen); -+int sceNetInetGetsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); -+int sceNetInetListen(int s, int backlog); -+ssize_t sceNetInetRecv(int s, void *buf, size_t len, int flags); -+ssize_t sceNetInetRecvfrom(int s, void *buf, size_t flags, int, struct sockaddr *from, socklen_t *fromlen); -+ssize_t sceNetInetRecvmsg(int s, struct msghdr *msg, int flags); -+ssize_t sceNetInetSend(int s, const void *buf, size_t len, int flags); -+ssize_t sceNetInetSendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); -+ssize_t sceNetInetSendmsg(int s, const struct msghdr *msg, int flags); -+int sceNetInetSetsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); -+int sceNetInetShutdown(int s, int how); -+int sceNetInetSocket(int domain, int type, int protocol); -+int sceNetInetClose(int s); -+int sceNetInetGetErrno(void); -+int sceNetInetGetsockname(int s, struct sockaddr *name, socklen_t *namelen); -+int sceNetInetGetpeername(int s, struct sockaddr *name, socklen_t *namelen); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_SYS_SOCKET_H_ */ ---- newlib-1.13.0/newlib/libc/sys/psp/xprintf.c 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-psp/newlib/libc/sys/psp/xprintf.c 2006-03-13 00:00:00.000000000 -0500 -@@ -0,0 +1,984 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * xprintf.c - Various *printf functions. -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * -+ * $Id: newlib-1.14.0.patch,v 1.1 2006-05-07 23:13:24 wntrmute Exp $ -+ */ -+/* Code borrowed from mysql's xprintf.c, by Richard Hipp */ -+/* This xprintf.c file on which this one is based is in public domain. */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+ -+/* -+** The maximum number of digits of accuracy in a floating-point conversion. -+*/ -+#define MAXDIG 20 -+ -+/* Instead of including ctype.h, use the isdigit() prototype because psplibc doesn't -+ know about newlib, and newlib defines isdigit as a macro that uses _ctype_. */ -+int isdigit(int __c); -+ -+int vxprintf(void (*func)(char *, int, void *), void *arg, const char *format, va_list ap); -+ -+#ifdef F_vxprintf -+/* -+** Conversion types fall into various categories as defined by the -+** following enumeration. -+*/ -+ -+enum e_type { /* The type of the format field */ -+ RADIX, /* Integer types. %d, %x, %o, and so forth */ -+ FLOAT, /* Floating point. %f */ -+ EXP, /* Exponentional notation. %e and %E */ -+ GENERIC, /* Floating or exponential, depending on exponent. %g */ -+ SIZE, /* Return number of characters processed so far. %n */ -+ STRING, /* Strings. %s */ -+ PERCENT, /* Percent symbol. %% */ -+ CHAR, /* Characters. %c */ -+ ERROR, /* Used to indicate no such conversion type */ -+/* The rest are extensions, not normally found in printf() */ -+ CHARLIT, /* Literal characters. %' */ -+ SEEIT, /* Strings with visible control characters. %S */ -+ MEM_STRING, /* A string which should be deleted after use. %z */ -+ ORDINAL, /* 1st, 2nd, 3rd and so forth */ -+}; -+ -+/* -+** Each builtin conversion character (ex: the 'd' in "%d") is described -+** by an instance of the following structure -+*/ -+typedef struct s_info { /* Information about each format field */ -+ int fmttype; /* The format field code letter */ -+ int base; /* The base for radix conversion */ -+ char *charset; /* The character set for conversion */ -+ int flag_signed; /* Is the quantity signed? */ -+ char *prefix; /* Prefix on non-zero values in alt format */ -+ enum e_type type; /* Conversion paradigm */ -+} info; -+ -+/* -+** The following table is searched linearly, so it is good to put the -+** most frequently used conversion types first. -+*/ -+static info fmtinfo[] = { -+ { 'd', 10, "0123456789", 1, 0, RADIX, }, -+ { 's', 0, 0, 0, 0, STRING, }, -+ { 'S', 0, 0, 0, 0, SEEIT, }, -+ { 'z', 0, 0, 0, 0, MEM_STRING, }, -+ { 'c', 0, 0, 0, 0, CHAR, }, -+ { 'o', 8, "01234567", 0, "0", RADIX, }, -+ { 'u', 10, "0123456789", 0, 0, RADIX, }, -+ { 'x', 16, "0123456789abcdef", 0, "x0", RADIX, }, -+ { 'X', 16, "0123456789ABCDEF", 0, "X0", RADIX, }, -+ { 'r', 10, "0123456789", 0, 0, ORDINAL, }, -+ { 'f', 0, 0, 1, 0, FLOAT, }, -+ { 'e', 0, "e", 1, 0, EXP, }, -+ { 'E', 0, "E", 1, 0, EXP, }, -+ { 'g', 0, "e", 1, 0, GENERIC, }, -+ { 'G', 0, "E", 1, 0, GENERIC, }, -+ { 'i', 10, "0123456789", 1, 0, RADIX, }, -+ { 'n', 0, 0, 0, 0, SIZE, }, -+ { 'S', 0, 0, 0, 0, SEEIT, }, -+ { '%', 0, 0, 0, 0, PERCENT, }, -+ { 'b', 2, "01", 0, "b0", RADIX, }, /* Binary notation */ -+ { 'p', 16, "0123456789ABCDEF", 0, "x0", RADIX, }, /* Pointers */ -+ { '\'', 0, 0, 0, 0, CHARLIT, }, /* Literal char */ -+}; -+#define NINFO (sizeof(fmtinfo)/sizeof(info)) /* Size of the fmtinfo table */ -+ -+/* -+** If NOFLOATINGPOINT is defined, then none of the floating point -+** conversions will work. -+*/ -+#ifndef NOFLOATINGPOINT -+/* -+** "*val" is a double such that 0.1 <= *val < 10.0 -+** Return the ascii code for the leading digit of *val, then -+** multiply "*val" by 10.0 to renormalize. -+** -+** Example: -+** input: *val = 3.14159 -+** output: *val = 1.4159 function return = '3' -+** -+** The counter *cnt is incremented each time. After counter exceeds -+** 16 (the number of significant digits in a 64-bit float) '0' is -+** always returned. -+*/ -+static int getdigit(long double *val, int *cnt){ -+ int digit; -+ long double d; -+ if( (*cnt)++ >= MAXDIG ) return '0'; -+ digit = (int)*val; -+ d = digit; -+ digit += '0'; -+ *val = (*val - d)*10.0; -+ return digit; -+} -+#endif -+ -+/* -+** Setting the size of the BUFFER involves trade-offs. No %d or %f -+** conversion can have more than BUFSIZE characters. If the field -+** width is larger than BUFSIZE, it is silently shortened. On the -+** other hand, this routine consumes more stack space with larger -+** BUFSIZEs. If you have some threads for which you want to minimize -+** stack space, you should keep BUFSIZE small. -+*/ -+#define BUFSIZE 100 /* Size of the output buffer */ -+ -+/* -+** The root program. All variations call this core. -+** -+** INPUTS: -+** func This is a pointer to a function taking three arguments -+** 1. A pointer to the list of characters to be output -+** (Note, this list is NOT null terminated.) -+** 2. An integer number of characters to be output. -+** (Note: This number might be zero.) -+** 3. A pointer to anything. Same as the "arg" parameter. -+** -+** arg This is the pointer to anything which will be passed as the -+** third argument to "func". Use it for whatever you like. -+** -+** fmt This is the format string, as in the usual print. -+** -+** ap This is a pointer to a list of arguments. Same as in -+** vfprint. -+** -+** OUTPUTS: -+** The return value is the total number of characters sent to -+** the function "func". Returns -1 on a error. -+** -+** Note that the order in which automatic variables are declared below -+** seems to make a big difference in determining how fast this beast -+** will run. -+*/ -+ -+int vxprintf(func,arg,format,ap) -+ void (*func)(char*,int,void*); -+ void *arg; -+ const char *format; -+ va_list ap; -+{ -+ register const char *fmt; /* The format string. */ -+ register int c; /* Next character in the format string */ -+ register char *bufpt; /* Pointer to the conversion buffer */ -+ register int precision; /* Precision of the current field */ -+ register int length; /* Length of the field */ -+ register int idx; /* A general purpose loop counter */ -+ int count; /* Total number of characters output */ -+ int width; /* Width of the current field */ -+ int flag_leftjustify; /* True if "-" flag is present */ -+ int flag_plussign; /* True if "+" flag is present */ -+ int flag_blanksign; /* True if " " flag is present */ -+ int flag_alternateform; /* True if "#" flag is present */ -+ int flag_zeropad; /* True if field width constant starts with zero */ -+ int flag_long; /* True if "l" flag is present */ -+ int flag_center; /* True if "=" flag is present */ -+ unsigned long long longvalue; /* Value for integer types */ -+ -+ long double realvalue; /* Value for real types */ -+ info *infop; /* Pointer to the appropriate info structure */ -+ char buf[BUFSIZE]; /* Conversion buffer */ -+ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ -+ int errorflag = 0; /* True if an error is encountered */ -+ enum e_type xtype; /* Conversion paradigm */ -+ char *zMem = 0; /* String to be freed */ -+ static char spaces[] = -+ " "; -+#define SPACESIZE (sizeof(spaces)-1) -+#ifndef NOFLOATINGPOINT -+ int exp; /* exponent of real numbers */ -+ long double rounder; /* Used for rounding floating point values */ -+ int flag_dp; /* True if decimal point should be shown */ -+ int flag_rtz; /* True if trailing zeros should be removed */ -+ int flag_exp; /* True to force display of the exponent */ -+ int nsd; /* Number of significant digits returned */ -+#endif -+ -+ fmt = format; /* Put in a register for speed */ -+ count = length = 0; -+ bufpt = 0; -+ for(; (c=(*fmt))!=0; ++fmt){ -+ if( c!='%' ){ -+ register int amt; -+ bufpt = (char *)fmt; -+ amt = 1; -+ while( (c=(*++fmt))!='%' && c!=0 ) amt++; -+ (*func)(bufpt,amt,arg); -+ count += amt; -+ if( c==0 ) break; -+ } -+ if( (c=(*++fmt))==0 ){ -+ errorflag = 1; -+ (*func)("%",1,arg); -+ count++; -+ break; -+ } -+ /* Find out what flags are present */ -+ flag_leftjustify = flag_plussign = flag_blanksign = -+ flag_alternateform = flag_zeropad = flag_center = 0; -+ do{ -+ switch( c ){ -+ case '-': flag_leftjustify = 1; c = 0; break; -+ case '+': flag_plussign = 1; c = 0; break; -+ case ' ': flag_blanksign = 1; c = 0; break; -+ case '#': flag_alternateform = 1; c = 0; break; -+ case '0': flag_zeropad = 1; c = 0; break; -+ case '=': flag_center = 1; c = 0; break; -+ default: break; -+ } -+ }while( c==0 && (c=(*++fmt))!=0 ); -+ if( flag_center ) flag_leftjustify = 0; -+ /* Get the field width */ -+ width = 0; -+ if( c=='*' ){ -+ width = va_arg(ap,int); -+ if( width<0 ){ -+ flag_leftjustify = 1; -+ width = -width; -+ } -+ c = *++fmt; -+ }else{ -+ while( isdigit(c) ){ -+ width = width*10 + c - '0'; -+ c = *++fmt; -+ } -+ } -+ if( width > BUFSIZE-10 ){ -+ width = BUFSIZE-10; -+ } -+ /* Get the precision */ -+ if( c=='.' ){ -+ precision = 0; -+ c = *++fmt; -+ if( c=='*' ){ -+ precision = va_arg(ap,int); -+#ifndef COMPATIBILITY -+ /* This is sensible, but SUN OS 4.1 doesn't do it. */ -+ if( precision<0 ) precision = -precision; -+#endif -+ c = *++fmt; -+ }else{ -+ while( isdigit(c) ){ -+ precision = precision*10 + c - '0'; -+ c = *++fmt; -+ } -+ } -+ /* Limit the precision to prevent overflowing buf[] during conversion */ -+ if( precision>BUFSIZE-40 ) precision = BUFSIZE-40; -+ }else{ -+ precision = -1; -+ } -+ /* Get the conversion type modifier */ -+ if( c=='l' ){ -+ flag_long = 1; -+ c = *++fmt; -+ if( c == 'l' ){ -+ flag_long = 2; -+ c = *++fmt; -+ } -+ }else{ -+ flag_long = 0; -+ } -+ /* Fetch the info entry for the field */ -+ infop = 0; -+ for(idx=0; idxtype; -+ } -+ -+ /* -+ ** At this point, variables are initialized as follows: -+ ** -+ ** flag_alternateform TRUE if a '#' is present. -+ ** flag_plussign TRUE if a '+' is present. -+ ** flag_leftjustify TRUE if a '-' is present or if the -+ ** field width was negative. -+ ** flag_zeropad TRUE if the width began with 0. -+ ** flag_long TRUE if the letter 'l' (ell) prefixed -+ ** the conversion character. -+ ** flag_blanksign TRUE if a ' ' is present. -+ ** width The specified field width. This is -+ ** always non-negative. Zero is the default. -+ ** precision The specified precision. The default -+ ** is -1. -+ ** xtype The class of the conversion. -+ ** infop Pointer to the appropriate info struct. -+ */ -+ switch( xtype ){ -+ case ORDINAL: -+ case RADIX: -+ if(( flag_long>1 )&&( infop->flag_signed )){ -+ signed long long t = va_arg(ap,signed long long); -+ longvalue = t; -+ }else if(( flag_long>1 )&&( !infop->flag_signed )){ -+ unsigned long long t = va_arg(ap,unsigned long long); -+ longvalue = t; -+ }else if(( flag_long )&&( infop->flag_signed )){ -+ signed long t = va_arg(ap,signed long); -+ longvalue = t; -+ }else if(( flag_long )&&( !infop->flag_signed )){ -+ unsigned long t = va_arg(ap,unsigned long); -+ longvalue = t; -+ }else if(( !flag_long )&&( infop->flag_signed )){ -+ signed int t = va_arg(ap,signed int) & ((unsigned long) 0xffffffff); -+ longvalue = t; -+ }else{ -+ unsigned int t = va_arg(ap,unsigned int) & ((unsigned long) 0xffffffff); -+ longvalue = t; -+ } -+#ifdef COMPATIBILITY -+ /* For the format %#x, the value zero is printed "0" not "0x0". -+ ** I think this is stupid. */ -+ if( longvalue==0 ) flag_alternateform = 0; -+#else -+ /* More sensible: turn off the prefix for octal (to prevent "00"), -+ ** but leave the prefix for hex. */ -+ if( longvalue==0 && infop->base==8 ) flag_alternateform = 0; -+#endif -+ if( infop->flag_signed ){ -+ if( *(long long*)&longvalue<0 ){ -+ longvalue = -*(long long*)&longvalue; -+ prefix = '-'; -+ }else if( flag_plussign ) prefix = '+'; -+ else if( flag_blanksign ) prefix = ' '; -+ else prefix = 0; -+ }else prefix = 0; -+ if( flag_zeropad && precision3 || (b>10 && b<14) ){ -+ bufpt[0] = 't'; -+ bufpt[1] = 'h'; -+ }else if( a==1 ){ -+ bufpt[0] = 's'; -+ bufpt[1] = 't'; -+ }else if( a==2 ){ -+ bufpt[0] = 'n'; -+ bufpt[1] = 'd'; -+ }else if( a==3 ){ -+ bufpt[0] = 'r'; -+ bufpt[1] = 'd'; -+ } -+ } -+ { -+ register char *cset; /* Use registers for speed */ -+ register int base; -+ cset = infop->charset; -+ base = infop->base; -+ do{ /* Convert to ascii */ -+ *(--bufpt) = cset[longvalue%base]; -+ longvalue = longvalue/base; -+ }while( longvalue>0 ); -+ } -+ length = (int)(&buf[BUFSIZE]-bufpt); -+ if(infop->fmttype == 'p') -+ { -+ precision = 8; -+ flag_alternateform = 1; -+ } -+ -+ for(idx=precision-length; idx>0; idx--){ -+ *(--bufpt) = '0'; /* Zero pad */ -+ } -+ if( prefix ) *(--bufpt) = prefix; /* Add sign */ -+ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ -+ char *pre, x; -+ pre = infop->prefix; -+ if( *bufpt!=pre[0] ){ -+ for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x; -+ } -+ } -+ -+ length = (int)(&buf[BUFSIZE]-bufpt); -+ break; -+ case FLOAT: -+ case EXP: -+ case GENERIC: -+ realvalue = va_arg(ap,double); -+#ifndef NOFLOATINGPOINT -+ if( precision<0 ) precision = 6; /* Set default precision */ -+ if( precision>BUFSIZE-10 ) precision = BUFSIZE-10; -+ if( realvalue<0.0 ){ -+ realvalue = -realvalue; -+ prefix = '-'; -+ }else{ -+ if( flag_plussign ) prefix = '+'; -+ else if( flag_blanksign ) prefix = ' '; -+ else prefix = 0; -+ } -+ if( infop->type==GENERIC && precision>0 ) precision--; -+ rounder = 0.0; -+#ifdef COMPATIBILITY -+ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ -+ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); -+#else -+ /* It makes more sense to use 0.5 */ -+ if( precision>MAXDIG-1 ) idx = MAXDIG-1; -+ else idx = precision; -+ for(rounder=0.5; idx>0; idx--, rounder*=0.1); -+#endif -+ if( infop->type==FLOAT ) realvalue += rounder; -+ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ -+ exp = 0; -+ if( realvalue>0.0 ){ -+ int k = 0; -+ while( realvalue>=1e8 && k++<100 ){ realvalue *= 1e-8; exp+=8; } -+ while( realvalue>=10.0 && k++<100 ){ realvalue *= 0.1; exp++; } -+ while( realvalue<1e-8 && k++<100 ){ realvalue *= 1e8; exp-=8; } -+ while( realvalue<1.0 && k++<100 ){ realvalue *= 10.0; exp--; } -+ if( k>=100 ){ -+ bufpt = "NaN"; -+ length = 3; -+ break; -+ } -+ } -+ bufpt = buf; -+ /* -+ ** If the field type is GENERIC, then convert to either EXP -+ ** or FLOAT, as appropriate. -+ */ -+ flag_exp = xtype==EXP; -+ if( xtype!=FLOAT ){ -+ realvalue += rounder; -+ if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } -+ } -+ if( xtype==GENERIC ){ -+ flag_rtz = !flag_alternateform; -+ if( exp<-4 || exp>precision ){ -+ xtype = EXP; -+ }else{ -+ precision = precision - exp; -+ xtype = FLOAT; -+ } -+ }else{ -+ flag_rtz = 0; -+ } -+ /* -+ ** The "exp+precision" test causes output to be of type EXP if -+ ** the precision is too large to fit in buf[]. -+ */ -+ nsd = 0; -+ if( xtype==FLOAT && exp+precision0 || flag_alternateform); -+ if( prefix ) *(bufpt++) = prefix; /* Sign */ -+ if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */ -+ else for(; exp>=0; exp--) *(bufpt++) = getdigit(&realvalue,&nsd); -+ if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */ -+ for(exp++; exp<0 && precision>0; precision--, exp++){ -+ *(bufpt++) = '0'; -+ } -+ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd); -+ *(bufpt--) = 0; /* Null terminate */ -+ if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */ -+ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; -+ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; -+ } -+ bufpt++; /* point to next free slot */ -+ }else{ /* EXP or GENERIC */ -+ flag_dp = (precision>0 || flag_alternateform); -+ if( prefix ) *(bufpt++) = prefix; /* Sign */ -+ *(bufpt++) = getdigit(&realvalue,&nsd); /* First digit */ -+ if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */ -+ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd); -+ bufpt--; /* point to last digit */ -+ if( flag_rtz && flag_dp ){ /* Remove tail zeros */ -+ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; -+ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; -+ } -+ bufpt++; /* point to next free slot */ -+ if( exp || flag_exp ){ -+ *(bufpt++) = infop->charset[0]; -+ if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */ -+ else { *(bufpt++) = '+'; } -+ if( exp>=100 ){ -+ *(bufpt++) = (exp/100)+'0'; /* 100's digit */ -+ exp %= 100; -+ } -+ *(bufpt++) = exp/10+'0'; /* 10's digit */ -+ *(bufpt++) = exp%10+'0'; /* 1's digit */ -+ } -+ } -+ /* The converted number is in buf[] and zero terminated. Output it. -+ ** Note that the number is in the usual order, not reversed as with -+ ** integer conversions. */ -+ length = (int)(bufpt-buf); -+ bufpt = buf; -+ -+ /* Special case: Add leading zeros if the flag_zeropad flag is -+ ** set and we are not left justified */ -+ if( flag_zeropad && !flag_leftjustify && length < width){ -+ int i; -+ int nPad = width - length; -+ for(i=width; i>=nPad; i--){ -+ bufpt[i] = bufpt[i-nPad]; -+ } -+ i = prefix!=0; -+ while( nPad-- ) bufpt[i++] = '0'; -+ length = width; -+ } -+#endif -+ break; -+ case SIZE: -+ *(va_arg(ap,int*)) = count; -+ length = width = 0; -+ break; -+ case PERCENT: -+ buf[0] = '%'; -+ bufpt = buf; -+ length = 1; -+ break; -+ case CHARLIT: -+ case CHAR: -+ c = buf[0] = (xtype==CHAR ? va_arg(ap,int) : *++fmt); -+ if( precision>=0 ){ -+ for(idx=1; idx=0 && precision=0x7f ){ -+ buf[i++] = '^'; -+ buf[i] = (c&0x1f)+0x40; -+ }else{ -+ buf[i] = c; -+ } -+ } -+ bufpt = buf; -+ length = i; -+ if( precision>=0 && precision0 ){ -+ if( flag_center ){ -+ nspace = nspace/2; -+ width -= nspace; -+ flag_leftjustify = 1; -+ } -+ count += nspace; -+ while( nspace>=SPACESIZE ){ -+ (*func)(spaces,SPACESIZE,arg); -+ nspace -= SPACESIZE; -+ } -+ if( nspace>0 ) (*func)(spaces,nspace,arg); -+ } -+ } -+ if( length>0 ){ -+ (*func)(bufpt,length,arg); -+ count += length; -+ } -+ if( xtype==MEM_STRING && zMem ){ -+ free(zMem); -+ } -+ if( flag_leftjustify ){ -+ register int nspace; -+ nspace = width-length; -+ if( nspace>0 ){ -+ count += nspace; -+ while( nspace>=SPACESIZE ){ -+ (*func)(spaces,SPACESIZE,arg); -+ nspace -= SPACESIZE; -+ } -+ if( nspace>0 ) (*func)(spaces,nspace,arg); -+ } -+ } -+ }/* End for loop over the format string */ -+ return errorflag ? -1 : count; -+} /* End of function */ -+#endif -+ -+#ifdef F__xprintf -+/* -+** This non-standard function is still occasionally useful.... -+*/ -+int xprintf( -+ void (*func)(char*,int,void*), -+ void *arg, -+ const char *format, -+ ... -+){ -+ va_list ap; -+ va_start(ap,format); -+ return vxprintf(func,arg,format,ap); -+} -+#endif -+ -+/* -+** Now for string-print, also as found in any standard library. -+** Add to this the snprint function which stops added characters -+** to the string at a given length. -+** -+** Note that snprint returns the length of the string as it would -+** be if there were no limit on the output. -+*/ -+struct s_strargument { /* Describes the string being written to */ -+ char *next; /* Next free slot in the string */ -+ char *last; /* Last available slot in the string */ -+}; -+ -+void __sout(char *, int, void *); -+#ifdef F___sout -+void __sout(txt,amt,arg) -+ char *txt; -+ int amt; -+ void *arg; -+{ -+ register char *head; -+ register const char *t; -+ register int a; -+ register char *tail; -+ a = amt; -+ t = txt; -+ head = ((struct s_strargument*)arg)->next; -+ tail = ((struct s_strargument*)arg)->last; -+ if( tail ){ -+ while( a-- >0 && head0 ) *(head++) = *(t++); -+ } -+ *head = 0; -+ ((struct s_strargument*)arg)->next = head; -+} -+#endif -+ -+#ifdef F_vsnprintf -+int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){ -+ struct s_strargument arg; -+ arg.next = buf; -+ arg.last = &buf[n-1]; -+ *buf = 0; -+ return vxprintf(__sout,&arg,fmt,ap); -+} -+#endif -+ -+#ifdef F_snprintf -+int snprintf(char *str, size_t sz, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ arg.next = str; -+ arg.last = &str[sz-1]; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_vsprintf -+int vsprintf(char *buf, const char *fmt, va_list ap){ -+ struct s_strargument arg; -+ arg.next = buf; -+ arg.last = NULL; -+ *buf = 0; -+ return vxprintf(__sout,&arg,fmt,ap); -+} -+#endif -+ -+#ifdef F_sprintf -+int sprintf (char *str, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ arg.next = str; -+ arg.last = NULL; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+/* -+** The following section of code handles the mprintf routine, that -+** writes to memory obtained from malloc(). -+*/ -+ -+/* This structure is used to store state information about the -+** write in progress -+*/ -+struct sgMprintf { -+ char *zBase; /* A base allocation */ -+ char *zText; /* The string collected so far */ -+ int nChar; /* Length of the string so far */ -+ int nAlloc; /* Amount of space allocated in zText */ -+}; -+ -+void __mout(char *, int, void*); -+ -+#ifdef F___mout -+/* The xprintf callback function. */ -+void __mout(zNewText,nNewChar,arg) -+ char *zNewText; -+ int nNewChar; -+ void *arg; -+{ -+ struct sgMprintf *pM = (struct sgMprintf*)arg; -+ if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ -+ pM->nAlloc = pM->nChar + nNewChar*2 + 1; -+ if( pM->zText==pM->zBase ){ -+ pM->zText = malloc(pM->nAlloc); -+ if( pM->zText && pM->nChar ) memcpy(pM->zText,pM->zBase,pM->nChar); -+ }else{ -+ pM->zText = realloc(pM->zText, pM->nAlloc); -+ } -+ } -+ if( pM->zText ){ -+ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); -+ pM->nChar += nNewChar; -+ pM->zText[pM->nChar] = 0; -+ } -+} -+#endif -+ -+/* -+** mprintf() works like printf(), but allocations memory to hold the -+** resulting string and returns a pointer to the allocated memory. -+** -+** We changed the name to TclMPrint() to conform with the Tcl private -+** routine naming conventions. -+*/ -+ -+#ifdef F_mprintf -+char *mprintf(const char *zFormat, ...){ -+ va_list ap; -+ struct sgMprintf sMprintf; -+ char *zNew; -+ char zBuf[200]; -+ -+ va_start(ap,zFormat); -+ sMprintf.nChar = 0; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zText = zBuf; -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ va_end(ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ zNew = malloc( sMprintf.nChar+1 ); -+ if( zNew ) strcpy(zNew,zBuf); -+ }else{ -+ zNew = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ -+ return zNew; -+} -+#endif -+ -+/* This is the varargs version of mprintf. -+** -+** The name is changed to TclVMPrintf() to conform with Tcl naming -+** conventions. -+*/ -+#ifdef F_vmprintf -+char *vmprintf(const char *zFormat,va_list ap){ -+ struct sgMprintf sMprintf; -+ char zBuf[200]; -+ sMprintf.nChar = 0; -+ sMprintf.zText = zBuf; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ sMprintf.zText = malloc( strlen(zBuf)+1 ); -+ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf); -+ }else{ -+ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ return sMprintf.zText; -+} -+#endif -+ -+#ifdef F_asprintf -+int asprintf(char ** strp, const char *zFormat, ...){ -+ va_list ap; -+ struct sgMprintf sMprintf; -+ char *zNew; -+ char zBuf[200]; -+ -+ va_start(ap,zFormat); -+ sMprintf.nChar = 0; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zText = zBuf; -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ va_end(ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ zNew = malloc( sMprintf.nChar+1 ); -+ if( zNew ) strcpy(zNew,zBuf); -+ }else{ -+ zNew = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ -+ *strp = zNew; -+ -+ return sMprintf.nChar+1; -+} -+#endif -+ -+#ifdef F_vasprintf -+int vasprintf(char **strp, const char *format, va_list ap) { -+ struct sgMprintf sMprintf; -+ char zBuf[200]; -+ sMprintf.nChar = 0; -+ sMprintf.zText = zBuf; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,format,ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ sMprintf.zText = malloc( strlen(zBuf)+1 ); -+ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf); -+ }else{ -+ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ *strp = sMprintf.zText; -+ return sMprintf.nChar; -+} -+#endif -+ -+/* -+** The following section of code handles the standard fprintf routines -+** for pthreads. -+*/ -+ -+void __fout(char *, int, void *); -+ -+#ifdef F___fout -+void __fout(zNewText,nNewChar,arg) -+ char *zNewText; -+ int nNewChar; -+ void *arg; -+{ -+ fwrite(zNewText,1,nNewChar,(FILE*)arg); -+} -+#endif -+ -+#ifdef F_fprintf -+/* The public interface routines */ -+int fprintf(FILE *pOut, const char *zFormat, ...){ -+ va_list ap; -+ int retc; -+ -+ va_start(ap,zFormat); -+ retc = vxprintf(__fout,pOut,zFormat,ap); -+ va_end(ap); -+ return retc; -+} -+#endif -+ -+#ifdef F_vfprintf -+int vfprintf(FILE *pOut, const char *zFormat, va_list ap){ -+ return vxprintf(__fout,pOut,zFormat,ap); -+} -+#endif -+ -+ -+#ifdef F_printf -+int printf(const char *format, ...) -+{ -+ va_list args; -+ int ret; -+ -+ va_start(args, format); -+ ret = vprintf(format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_vprintf -+int vprintf(const char *format, va_list args) -+{ -+ return vxprintf(__fout, stdout, format, args); -+} -+#endif -+ -+#ifdef F__sprintf_r -+/* Idiotic kludge to get around newlib stupidity. tmpnam() calls this -+ directly, but since sprintf() above replaces newlib's sprintf() (and -+ _sprintf_r()) we have to define this in order to link tmpnam(). */ -+int _sprintf_r(struct _reent *unused, char *str, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ (void) unused; -+ arg.next = str; -+ arg.last = NULL; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif