Index: /trunk/src/emx/ChangeLog.LIBC
===================================================================
--- /trunk/src/emx/ChangeLog.LIBC	(revision 2111)
+++ /trunk/src/emx/ChangeLog.LIBC	(revision 2112)
@@ -8,4 +8,6 @@
     - libc:
         o Added _NSIG and making NSIG and _NSIG equal to SIGRTMAX + 1.
+        o Added memrawchr and strchrnul from glibc, enabling us to shop .S
+          files from glibc at the same time.
 
 2005-06-27: knut st. osmundsen <bird-gccos2-spam@anduin.net>
Index: /trunk/src/emx/CompileOne.sh
===================================================================
--- /trunk/src/emx/CompileOne.sh	(revision 2111)
+++ /trunk/src/emx/CompileOne.sh	(revision 2112)
@@ -14,8 +14,12 @@
     gcc -c -O3 -o $TMP/compileO3.o -fmessage-length=0 -x assembler-with-cpp \
      -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H \
-     -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
+     -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx \
+     -I$ROOTDIR/src/lib/lgpl/sysdeps/os2 -I$ROOTDIR/src/lib/lgpl/ -I$ROOTDIR/src/lib/lgpl/include -I$ROOTDIR/src/lib/lgpl/sysdeps/generic \
+     -I$SRCDIR $1 \
  && gcc -c -O3 -o $TMP/compileLg.o -fmessage-length=0 -x assembler-with-cpp \
      -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H -DDEBUG_LOGGING -D__LIBC_STRICT \
-     -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
+     -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx \
+     -I$ROOTDIR/src/lib/lgpl/sysdeps/os2 -I$ROOTDIR/src/lib/lgpl/ -I$ROOTDIR/src/lib/lgpl/include -I$ROOTDIR/src/lib/lgpl/sysdeps/generic \
+     -I$SRCDIR $1 \
  && echo succesfully built $1 \
  && nm -sS $TMP/compileO3.o
@@ -24,8 +28,12 @@
        gcc -c -O3 -o $TMP/compileO3.o -fmessage-length=0 -std=gnu99 -Wundef -Wall -Wmissing-prototypes -pedantic -Wno-long-long \
         -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H \
-        -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
+        -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx \
+        -I$ROOTDIR/src/lib/lgpl/sysdeps/os2 -I$ROOTDIR/src/lib/lgpl/ -I$ROOTDIR/src/lib/lgpl/include -I$ROOTDIR/src/lib/lgpl/sysdeps/generic \
+        -I$SRCDIR $1 \
     && gcc -c -O3 -o $TMP/compileLg.o -fmessage-length=0 -std=gnu99 -Wundef -Wall -Wmissing-prototypes -pedantic -Wno-long-long \
         -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H -DDEBUG_LOGGING -D__LIBC_STRICT \
-        -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
+        -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx \
+        -I$ROOTDIR/src/lib/lgpl/sysdeps/os2 -I$ROOTDIR/src/lib/lgpl/ -I$ROOTDIR/src/lib/lgpl/include -I$ROOTDIR/src/lib/lgpl/sysdeps/generic \
+        -I$SRCDIR $1 \
     && echo succesfully built $1
 fi
Index: /trunk/src/emx/Makefile.gmk
===================================================================
--- /trunk/src/emx/Makefile.gmk	(revision 2111)
+++ /trunk/src/emx/Makefile.gmk	(revision 2112)
@@ -97,5 +97,4 @@
 endif
 CFLAGS.INC  += -Isrc/include
-CFLAGS.INC  += -Isrc/lib/bsd/include
 CFLAGS      = -Wall -Wundef -Wmissing-prototypes -mstack-arg-probe $(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND)
 # The additional C compiler flags for different build modes
Index: /trunk/src/emx/include/string.h
===================================================================
--- /trunk/src/emx/include/string.h	(revision 2111)
+++ /trunk/src/emx/include/string.h	(revision 2112)
@@ -170,4 +170,7 @@
 #define  memrchr(pach, ch, cch)     _memrchr(pach, ch, cch)
 int      strverscmp(const char *, const char *);
+char    *strchrnul(const char *, int);
+void    *rawmemchr(const void *, int);
+
 
 size_t   __strnlen(const char *, size_t);
@@ -178,4 +181,6 @@
 #define  __memrchr(pach, ch, cch)   _memrchr(pach, ch, cch)
 int      __strverscmp(const char *, const char *);
+char    *__strchrnul(const char *, int);
+void    *__rawmemchr(const void *, int);
 
 #endif
Index: /trunk/src/emx/src/lib/lgpl/include/config.h
===================================================================
--- /trunk/src/emx/src/lib/lgpl/include/config.h	(revision 2111)
+++ /trunk/src/emx/src/lib/lgpl/include/config.h	(revision 2112)
@@ -100,4 +100,17 @@
 #endif
 
+#undef HAVE_ASM_SET_DIRECTIVE
+#define ASM_GLOBAL_DIRECTIVE        .globl
+#undef ASM_TYPE_DIRECTIVE_PREFIX
+#undef HAVE_GNU_LD
+#undef HAVE_ELF
+#undef HAVE_ASM_WEAK_DIRECTIVE
+#undef HAVE_ASM_WEAKEXT_DIRECTIVE
+
+#define DO_VERSIONING 0
+#ifndef __BOUNDED_POINTERS__
+#define __BOUNDED_POINTERS__ 0
+#endif
+
 #include "libc-alias.h"
 #endif
Index: /trunk/src/emx/src/lib/lgpl/sysdeps/i386/rawmemchr.S
===================================================================
--- /trunk/src/emx/src/lib/lgpl/sysdeps/i386/rawmemchr.S	(revision 2111)
+++ /trunk/src/emx/src/lib/lgpl/sysdeps/i386/rawmemchr.S	(revision 2112)
@@ -39,5 +39,5 @@
 
 	.text
-ENTRY (BP_SYM (__rawmemchr))
+ENTRY (BP_SYM (_STD (rawmemchr)))
 	ENTER
 
@@ -225,6 +225,6 @@
 	LEAVE
 	RET_PTR
-END (BP_SYM (__rawmemchr))
-
-libc_hidden_def (BP_SYM (__rawmemchr))
-weak_alias (BP_SYM (__rawmemchr), BP_SYM (rawmemchr))
+END (BP_SYM (_STD (rawmemchr)))
+
+/*libc_hidden_def (BP_SYM (__rawmemchr)) */
+/*w e a k _ a l i a s (BP_SYM (__rawmemchr), BP_SYM (rawmemchr)) */
Index: /trunk/src/emx/src/lib/lgpl/sysdeps/i386/strchrnul.S
===================================================================
--- /trunk/src/emx/src/lib/lgpl/sysdeps/i386/strchrnul.S	(revision 2111)
+++ /trunk/src/emx/src/lib/lgpl/sysdeps/i386/strchrnul.S	(revision 2112)
@@ -26,4 +26,7 @@
 #include "bp-sym.h"
 #include "bp-asm.h"
+#ifndef _LIBC_SYMBOLS_H
+#error
+#endif
 
 #define PARMS	LINKAGE+4	/* space for 1 saved reg */
@@ -33,5 +36,5 @@
 
 	.text
-ENTRY (BP_SYM (__strchrnul))
+ENTRY (BP_SYM (_STD (strchrnul)))
 	ENTER
 
@@ -282,5 +285,5 @@
 	LEAVE
 	RET_PTR
-END (BP_SYM (__strchrnul))
-
-weak_alias (BP_SYM (__strchrnul), BP_SYM (strchrnul))
+END (BP_SYM (_STD (strchrnul)))
+
+/*w e a k _ a l i a s (BP_SYM (__strchrnul), BP_SYM (strchrnul)) */
Index: /trunk/src/emx/src/lib/lgpl/sysdeps/i386/sysdep.h
===================================================================
--- /trunk/src/emx/src/lib/lgpl/sysdeps/i386/sysdep.h	(revision 2111)
+++ /trunk/src/emx/src/lib/lgpl/sysdeps/i386/sysdep.h	(revision 2112)
@@ -109,4 +109,7 @@
 #define mcount		_mcount
 #endif
+#ifdef __EMX__
+#define mcount __mcount
+#endif
 
 #define	PSEUDO(name, syscall_name, args)				      \
Index: /trunk/src/emx/src/lib/lgpl/sysdeps/os2/sysdep.h
===================================================================
--- /trunk/src/emx/src/lib/lgpl/sysdeps/os2/sysdep.h	(revision 2112)
+++ /trunk/src/emx/src/lib/lgpl/sysdeps/os2/sysdep.h	(revision 2112)
@@ -0,0 +1,45 @@
+/* Copyright (C) 1991, 92, 93, 96, 98, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* should've been an -include but anyway, this'll do for now. */
+#include <libc-symbols.h>
+
+/* config.h candidates? */
+#undef NO_UNDERSCORES
+#define HAVE_CPP_ASM_DEBUGINFO
+#define HAVE_ASM_SET_DIRECTIVE
+#define HAVE_ASM_WEAKEXT_DIRECTIVE
+#ifndef __BOUNDED_POINTERS__
+#define __BOUNDED_POINTERS__ 0
+#endif
+
+/* unix/i386/sysdep.h */
+#ifdef	__ASSEMBLER__
+
+#define	r0		%eax	/* Normal return-value register.  */
+#define	r1		%edx	/* Secondary return-value register.  */
+#define scratch 	%ecx	/* Call-clobbered register for random use.  */
+#define MOVE(x,y)	movl x, y
+
+#endif	/* __ASSEMBLER__ */
+
+/* unix/sysdep.h */
+#undef HAVE_SYSCALLS
+
+/* include i386 sysdep.h, which in turn includes the generic one. */
+#include <sysdeps/i386/sysdep.h>
Index: /trunk/src/emx/src/lib/lgpl/sysdeps/sysdeps.smak
===================================================================
--- /trunk/src/emx/src/lib/lgpl/sysdeps/sysdeps.smak	(revision 2111)
+++ /trunk/src/emx/src/lib/lgpl/sysdeps/sysdeps.smak	(revision 2112)
@@ -1,1 +1,2 @@
-libc.TSRC += $(wildcard src/lib/lgpl/sysdeps/os2/*.c)
+libc.TSRC += $(wildcard src/lib/lgpl/sysdeps/os2/*.c) \
+	$(wildcard src/lib/lgpl/sysdeps/i386/*.S)
Index: /trunk/src/emx/src/lib/libc.def
===================================================================
--- /trunk/src/emx/src/lib/libc.def	(revision 2111)
+++ /trunk/src/emx/src/lib/libc.def	(revision 2112)
@@ -1741,2 +1741,5 @@
     "___isinfl" @1743
     "__std_isinf" @1744
+    ; 06r1
+    "__std_rawmemchr" @1745
+    "__std_strchrnul" @1746
Index: /trunk/src/emx/src/lib/libc.smak
===================================================================
--- /trunk/src/emx/src/lib/libc.smak	(revision 2111)
+++ /trunk/src/emx/src/lib/libc.smak	(revision 2112)
@@ -30,6 +30,20 @@
 .TSRC	:= $(libc.TSRC.$(CPU)) $(libc.TSRC)
 .TDEP	:= $(libc.TDEP.$(CPU)) $(libc.TDEP)
-.TCF	:= -I$. -Isrc/lib/bsd/locale -Isrc/lib/lgpl/include \
-	-DIN_INNOTEK_LIBC -D__DBINTERFACE_PRIVATE -D__NETBSD_SYSCALLS -DPOSIX_MISTAKE -DHAVE_CONFIG_H -D_BSD_NAMESPACE_POLLUTION
+.TCF	:= \
+ -DIN_INNOTEK_LIBC \
+ -D__DBINTERFACE_PRIVATE \
+ -D__NETBSD_SYSCALLS \
+ -DPOSIX_MISTAKE \
+ -DHAVE_CONFIG_H \
+ -D_BSD_NAMESPACE_POLLUTION \
+ -I$.	\
+ -Isrc/lib/bsd/include \
+ -Isrc/lib/bsd/locale \
+ -Isrc/lib/lgpl \
+ -Isrc/lib/lgpl/sysdeps/os2 \
+ -Isrc/lib/lgpl/sysdeps/i386 \
+ -Isrc/lib/lgpl/sysdeps/generic \
+ -Isrc/lib/lgpl/include
+.TSF	+= $(.TCF)
 .INSDIR	= lib/
 .TKEEP	:= 1
@@ -403,5 +417,7 @@
 # files for _STD() macros invocations. Fortunately, gawk rulez forever thus
 # this happens in just a fraction of second.
-$.stmp-libc-std: $(wildcard src/lib/*/*.c src/lib/*/386/*.s src/lib/bsd/*/*.c src/lib/bsd/*/glue/*.c src/lib/lgpl/*/*.c src/lib/msun/*/*.c src/lib/msun/*/*.S)
+$.stmp-libc-std: $(wildcard src/lib/*/*.c src/lib/*/386/*.s src/lib/msun/*/*.c src/lib/msun/*/*.S \
+                            src/lib/bsd/*/*.c src/lib/bsd/*/glue/*.c src/lib/lgpl/*/*.c \
+							src/lib/lgpl/sysdeps/i386/*.S src/lib/lgpl/sysdeps/i386/*.c src/lib/lgpl/sysdeps/i386/i486/*.S)
 	gawk -f src/lib/mkstd.awk $^ >__tmp__
 	$(call UPDATE,__tmp__,$.libc-std.h)
Index: /trunk/src/emx/src/lib/libc06b4.def
===================================================================
--- /trunk/src/emx/src/lib/libc06b4.def	(revision 2111)
+++ /trunk/src/emx/src/lib/libc06b4.def	(revision 2112)
@@ -1,5 +1,5 @@
 ; $Id$
 ;
-; Legacy LIBC Exports Ordinals.
+; LIBC06b4 forwarder DLL.
 ;
 ; Exports and ordinals listed here are treated as legacy stuff
Index: /trunk/src/emx/src/lib/mkstd.awk
===================================================================
--- /trunk/src/emx/src/lib/mkstd.awk	(revision 2111)
+++ /trunk/src/emx/src/lib/mkstd.awk	(revision 2112)
@@ -46,8 +46,8 @@
 }
 
-/_STD\( *[_0-9A-Za-z]+ *\)/{
-  while (match($0, "_STD\\( *[_0-9A-Za-z ]+ *\\)"))
+/_STD *\( *[_0-9A-Za-z]+ *\)/{
+  while (match($0, "_STD *\\( *[_0-9A-Za-z ]+ *\\)"))
   {
-    std_fun[gensub("_STD\\( *([_0-9A-Za-z]+) *\\).*", "\\1", "", substr($0,RSTART,RLENGTH))]=1;
+    std_fun[gensub("_STD *\\( *([_0-9A-Za-z]+) *\\).*", "\\1", "", substr($0,RSTART,RLENGTH))]=1;
     $0 = substr($0, 1, RSTART-1) substr($0, RSTART+RLENGTH);
   }
