Linux fixes [PATCH]
Shaun Jackman
sjackman@gmail.com
Wed Oct 26 19:45:00 GMT 2005
I found the following patches necessary to compile newlib for
i386-linux, In addition, dl-load.c is not compiling because it cannot
find the symbol __RTLD_DLOPEN, which should be defined by dlfcn.h.
Cheers,
Shaun
2005-10-26 Shaun Jackman <sjackman@gmail.com>
* newlib/libc/posix/scandir.c (scandir): Update the function
prototype to match the header.
* newlib/libc/sys/linux/linuxthreads/bits/libc-lock.h: Remove an
extraneous #endif.
* newlib/libc/sys/linux/sys/lock.h: Do not include
machine/weakalias.h, since it's not used by this file.
diff -u -r1.4 scandir.c
--- posix/scandir.c 6 Jun 2003 19:57:51 -0000 1.4
+++ posix/scandir.c 26 Oct 2005 19:30:41 -0000
@@ -74,8 +74,8 @@
_DEFUN(scandir, (dirname, namelist, select, dcomp),
const char *dirname _AND
struct dirent ***namelist _AND
- int (*select) __P((struct dirent *)) _AND
- int (*dcomp) __P((const void *, const void *)))
+ int (*select) __P((const struct dirent *)) _AND
+ int (*dcomp) __P((const struct dirent **, const struct dirent **)))
{
register struct dirent *d, *p, **names;
register size_t nitems;
@@ -155,7 +155,7 @@
}
closedir(dirp);
if (nitems && dcomp != NULL)
- qsort(names, nitems, sizeof(struct dirent *), dcomp);
+ qsort(names, nitems, sizeof(struct dirent *), (void *)dcomp);
*namelist = names;
#ifdef HAVE_DD_LOCK
__lock_release_recursive(dirp->dd_lock);
diff -u -r1.2 libc-lock.h
--- sys/linux/linuxthreads/bits/libc-lock.h 8 Sep 2005 22:45:50 -0000 1.2
+++ sys/linux/linuxthreads/bits/libc-lock.h 26 Oct 2005 19:30:43 -0000
@@ -287,7 +287,6 @@
# pragma weak __pthread_atfork
# pragma weak _pthread_cleanup_push_defer
# pragma weak _pthread_cleanup_pop_restore
-# endif
#endif
/* We need portable names for some functions. E.g., when they are
diff -u -r1.3 lock.h
--- sys/linux/sys/lock.h 25 Mar 2004 22:20:36 -0000 1.3
+++ sys/linux/sys/lock.h 26 Oct 2005 19:30:43 -0000
@@ -1,7 +1,6 @@
#ifndef __SYS_LOCK_H__
#define __SYS_LOCK_H__
-#include <machine/weakalias.h>
#include <features.h>
#define _LIBC 1
More information about the Newlib
mailing list