1 --- a/libc/sunrpc/rpc/types.h
2 +++ b/libc/sunrpc/rpc/types.h
3 @@ -68,6 +68,7 @@ typedef unsigned long rpcport_t;
7 +#if !defined(_CROSS_RPCGEN_) || !defined(__APPLE__)
8 #ifndef __u_char_defined
9 typedef __u_char u_char;
10 typedef __u_short u_short;
11 @@ -83,6 +84,7 @@ typedef __daddr_t daddr_t;
12 typedef __caddr_t caddr_t;
13 # define __daddr_t_defined
18 #include <sys/param.h>
19 --- a/libc/sunrpc/rpc_main.c
20 +++ b/libc/sunrpc/rpc_main.c
25 +#ifdef _CROSS_RPCGEN_
26 +#define gettext(X) (X)
31 #include <sys/types.h>
32 #include <sys/param.h>
33 @@ -998,9 +1002,10 @@ mkfile_output (struct commandline *cmd)
35 temp = rindex (cmd->infile, '.');
36 cp = stpcpy (mkfilename, "Makefile.");
38 - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
41 + strncpy (cp, cmd->infile, temp - cmd->infile);
42 + cp[temp - cmd->infile - 1] = '\0';
44 stpcpy (cp, cmd->infile);
47 --- a/libc/sunrpc/rpc_scan.c
48 +++ b/libc/sunrpc/rpc_scan.c
53 +#ifdef _CROSS_RPCGEN_
54 +#define gettext(X) (X)
59 #include "rpc_parse.h"
61 --- a/libc/timezone/Makefile
62 +++ b/libc/timezone/Makefile
63 @@ -181,7 +181,7 @@ zic-objs = zic.o ialloc.o scheck.o
64 $(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
66 $(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
67 - gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
68 + gcc $< -c $(OUTPUT_OPTION) $(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) $(CPPFLAGS-$*) \
69 -DCROSS_ZIC $(compile-mkdep-flags)
71 $(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))