summaryrefslogtreecommitdiffstats
path: root/patches/glibc-2.8/generic/cross_timezone.diff
blob: d85d2411a3ae963d773bbfc1e622510b257c8014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
From: http://trac.cross-lfs.org/browser/branches/clfs-sysroot/patches/glibc-2.6.1-sysdep_cancel-1.patch

Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
Date: 2006-11-26
Initial Package Version: 2.5
Origin: Joe Ciccone
Upstream Status: Unknown
Description: Adds native compile support to the build system then uses that
             support to build zic-native, for installing timezone info,
             rpcgen-native, for building librpcsvc.a, and localedef-native,
             for creating the locale-archive.

---
 Makeconfig                     |   13 +++++++++++++
 Makerules                      |    9 ++++++++-
 Rules                          |    9 ++++++++-
 iconv/Makefile                 |    4 ++++
 iconvdata/Makefile             |   18 ++++++++++--------
 include-native/bits/libc-tsd.h |    3 +++
 include-native/config.h        |    1 +
 include-native/gnu/stubs.h     |    1 +
 include-native/intl/loadinfo.h |    4 ++++
 include-native/libintl.h       |   11 +++++++++++
 include-native/symbol-hacks.h  |    1 +
 include-native/sys/types.h     |    9 +++++++++
 include-native/tls.h           |   11 +++++++++++
 locale/Makefile                |    9 +++++++++
 localedata/Makefile            |    5 +++++
 malloc/Makefile                |    5 -----
 sunrpc/Makefile                |   23 ++++++++++++++++++-----
 timezone/Makefile              |   14 ++++++++++----
 18 files changed, 126 insertions(+), 24 deletions(-)

Index: glibc-2.7/iconv/Makefile
===================================================================
--- glibc-2.7.orig/iconv/Makefile
+++ glibc-2.7/iconv/Makefile
@@ -57,6 +57,9 @@ distribute	= gconv_builtin.h gconv_int.h
 		  iconvconfig.h
 
 others		= iconv_prog iconvconfig
+ifneq ($(cross-compiling),no)
+others-native	= iconvconfig-native
+endif
 install-others-programs	= $(inst_bindir)/iconv
 install-sbin	= iconvconfig
 
@@ -79,6 +82,7 @@ $(inst_bindir)/iconv: $(objpfx)iconv_pro
 
 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
+$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
 
 ifneq ($(cross-compiling),yes)
 xtests: test-iconvconfig
Index: glibc-2.7/iconvdata/Makefile
===================================================================
--- glibc-2.7.orig/iconvdata/Makefile
+++ glibc-2.7/iconvdata/Makefile
@@ -315,23 +315,25 @@ $(objpfx)iso8859-7jp.stmp: $(charmaps)/I
 
 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
 
+ifeq ($(cross-compiling),no)
+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
+  $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
+  $(common-objpfx)iconv/iconvconfig
+else
+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
+  $(common-objpfx)iconv/iconvconfig-native
+endif
+
 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
     $(inst_gconvdir)/%: $(objpfx)% $(+force)
 	$(do-install-program)
 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
 	$(do-install)
-ifeq (no,$(cross-compiling))
 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
 # if this libc has more gconv modules than the previously installed one.
 	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
-	   LC_ALL=C LANGUAGE=C \
-	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
-	   $(common-objpfx)iconv/iconvconfig \
-	     $(addprefix --prefix=,$(install_root)); \
+	   $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
 	fi
-else
-	@echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
-endif
 
 endif # build-shared = yes
 
Index: glibc-2.7/include-native/bits/libc-tsd.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/bits/libc-tsd.h
@@ -0,0 +1,3 @@
+#ifndef __libc_tsd_define
+#define __libc_tsd_define(A,B)
+#endif
Index: glibc-2.7/include-native/config.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/config.h
@@ -0,0 +1 @@
+/* Empty */
Index: glibc-2.7/include-native/gnu/stubs.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/gnu/stubs.h
@@ -0,0 +1 @@
+/* Empty */
Index: glibc-2.7/include-native/intl/loadinfo.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/intl/loadinfo.h
@@ -0,0 +1,4 @@
+#ifndef LOADINFO_H
+#define LOADINFO_H
+struct loaded_l10nfile;
+#endif
Index: glibc-2.7/include-native/libintl.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/libintl.h
@@ -0,0 +1,11 @@
+#ifndef _
+#define _(X) (X)
+#endif
+
+#ifndef N_
+#define N_(X) (X)
+#endif
+
+#ifndef _libc_intl_domainname
+#define _libc_intl_domainname "libc"
+#endif
Index: glibc-2.7/include-native/symbol-hacks.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/symbol-hacks.h
@@ -0,0 +1 @@
+/* Empty */
Index: glibc-2.7/include-native/tls.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/tls.h
@@ -0,0 +1,11 @@
+#ifndef _include_tls_h
+#define _include_tls_h 1
+
+#if USE_TLS && HAVE___THREAD \
+    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# define USE___THREAD 1
+#else
+# define USE___THREAD 0
+#endif
+
+#endif
Index: glibc-2.7/locale/Makefile
===================================================================
--- glibc-2.7.orig/locale/Makefile
+++ glibc-2.7/locale/Makefile
@@ -44,6 +44,9 @@ categories	= ctype messages monetary num
 aux		= $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
 		  xlocale localename global-locale coll-lookup
 others		= localedef locale
+ifneq ($(cross-compiling),no)
+others-native	= localedef-native
+endif
 #others-static	= localedef locale
 install-bin	= localedef locale
 extra-objs	= $(localedef-modules:=.o) $(localedef-aux:=.o) \
@@ -81,6 +84,12 @@ $(objpfx)localedef: $(localedef-aux:%=$(
 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
 
+ifneq ($(cross-compiling),no)
+$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
+$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
+$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
+endif
+
 C-translit.h: C-translit.h.in gen-translit.pl
 	$(PERL) gen-translit.pl < $< > $@.tmp
 	mv -f $@.tmp $@
Index: glibc-2.7/localedata/Makefile
===================================================================
--- glibc-2.7.orig/localedata/Makefile
+++ glibc-2.7/localedata/Makefile
@@ -206,8 +206,13 @@ include SUPPORTED
 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
+ifeq ($(cross-compiling),no)
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
+else
+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+$(common-objpfx)locale/localedef-native
+endif
 install-locales: $(INSTALL-SUPPORTED-LOCALES)
 
 install-locales-dir:
Index: glibc-2.7/Makeconfig
===================================================================
--- glibc-2.7.orig/Makeconfig
+++ glibc-2.7/Makeconfig
@@ -445,6 +445,12 @@ ifndef +link-static
 			   $(common-objpfx)libc% $(+postinit),$^) \
 	      $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
 endif
+# Command for linking programs against the host system.
+ifndef +link-native
++link-native = $(BUILD_CC) -g -o $@ $^ \
+              $(LDFLAGS) $(LDFLAGS-$(@F)) \
+              $(link-extra-libs)
+endif
 # Command for statically linking bounded-pointer programs with the C library.
 ifndef +link-bounded
 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
@@ -658,6 +664,8 @@ endif	# $(+cflags) == ""
 	    $(+sysdep-includes) $(includes) \
 	    $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
 
++includes-native = -I$(..)include-native -I$(objpfx) -I.
+
 # Since libio has several internal header files, we use a -I instead
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
@@ -672,10 +680,15 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+incl
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
+CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
+		  $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
+		  $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
 		  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
 		  $(CFLAGS-$(@F))
+override CFLAGS-native = -std=gnu99 $(default_cflags) $(+gccwarn-c) \
+			 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 override CXXFLAGS = $(c++-sysincludes) \
 		    $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
 		    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
Index: glibc-2.7/Makerules
===================================================================
--- glibc-2.7.orig/Makerules
+++ glibc-2.7/Makerules
@@ -292,6 +292,9 @@ endef
 object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
 
+$(objpfx)%-native.o: %.c $(before-compile)
+	$(native-compile-command.c)
+
 # Omit the objpfx rules when building in the source tree, because
 # objpfx is empty and so these rules just override the ones above.
 ifdef objpfx
@@ -368,6 +371,8 @@ compile-command.S = $(compile.S) $(OUTPU
 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
+# Native commands
+native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 
 # GCC can grok options after the file name, and it looks nicer that way.
 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
@@ -377,6 +382,8 @@ compile.S = $(CC) $< -c $(CPPFLAGS) $(S-
 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
 		  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
+# Native commands
+native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
 
 # We need this for the output to go in the right place.  It will default to
 # empty if make was configured to work with a cc that can't grok -c and -o
@@ -1178,7 +1185,7 @@ define native-compile
 $(make-target-directory)
 $(patsubst %/,cd % &&,$(objpfx)) \
 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
-	    $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
+	    $(addprefix $(shell pwd)/, $^) -o $(@F)
 endef
 
 # Command to compile $< in $(common-objdir) using the native libraries.
Index: glibc-2.7/malloc/Makefile
===================================================================
--- glibc-2.7.orig/malloc/Makefile
+++ glibc-2.7/malloc/Makefile
@@ -73,10 +73,6 @@ address-width=18
 endif
 endif
 
-# Unless we get a test for the availability of libgd which also works
-# for cross-compiling we disable the memusagestat generation in this
-# situation.
-ifneq ($(cross-compiling),yes)
 # If the gd library is available we build the `memusagestat' program.
 ifneq ($(LIBGD),no)
 others: $(objpfx)memusage
@@ -91,7 +87,6 @@ extra-objs += memusagestat.o
 # is to presume that the standard system headers will be ok for this file.
 $(objpfx)memusagestat.o: sysincludes = # nothing
 endif
-endif
 
 # Another goal which can be used to override the configure decision.
 .PHONY: do-memusagestat
Index: glibc-2.7/Rules
===================================================================
--- glibc-2.7.orig/Rules
+++ glibc-2.7/Rules
@@ -87,7 +87,7 @@ common-generated += dummy.o dummy.c
 
 .PHONY: others tests
 ifeq ($(build-programs),yes)
-others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
+others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
 else
 others: $(addprefix $(objpfx),$(extra-objs))
 endif
@@ -106,9 +106,11 @@ endif
 ifeq ($(build-programs),yes)
 binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
 binaries-static = $(others-static) $(tests-static) $(xtests-static)
+binaries-native = $(others-native)
 else
 binaries-all = $(tests) $(xtests) $(test-srcs)
 binaries-static =
+binaries-native =
 endif
 
 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
@@ -127,6 +129,11 @@ $(addprefix $(objpfx),$(binaries-static)
 	$(+link-static)
 endif
 
+ifneq "$(strip $(binaries-native))" ""
+$(addprefix $(objpfx),$(binaries-native)): %: %.o
+	$(+link-native)
+endif
+
 ifeq ($(build-bounded),yes)
 binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
 $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
Index: glibc-2.7/sunrpc/Makefile
===================================================================
--- glibc-2.7.orig/sunrpc/Makefile
+++ glibc-2.7/sunrpc/Makefile
@@ -70,6 +70,9 @@ routines := auth_none auth_unix authuxpr
 	    clnt_unix svc_unix create_xid xdr_intXX_t
 
 others := rpcinfo
+ifneq ($(cross-compiling),no)
+others-native := rpcgen-native
+endif
 install-bin := rpcgen
 install-sbin := rpcinfo
 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
@@ -98,15 +101,12 @@ otherlibs += $(nssobjdir)/libnss_files.a
 	     $(resolvobjdir)/libresolv.a
 endif
 
-ifeq (no,$(cross-compiling))
-# We can only build this library if we can run the rpcgen we build.
 headers += $(rpcsvc:%.x=rpcsvc/%.h)
 extra-libs := librpcsvc
 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
 librpcsvc-routines = $(rpcsvc:%.x=x%)
 librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
 omit-deps = $(librpcsvc-routines)
-endif
 
 CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
 CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
@@ -136,13 +136,26 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link)
 
+ifneq ($(cross-compiling),no)
+rpcgen.c:
+	touch rpcgen.c
+
+$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
+endif
+
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(rpcgen-objs:.o=.c)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 # Tell rpcgen where to find the C preprocessor.
+ifeq ($(cross-compiling),no)
 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
+rpcgen = $(objpfx)rpcgen
+else
+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
+rpcgen = $(objpfx)rpcgen-native
+endif
 
 # Install the rpc data base file.
 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
@@ -153,7 +166,7 @@ $(inst_sysconfdir)/rpc: etc.rpc $(+force
 # relinked.
 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
 	@:
-$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
+$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
 	$(make-target-directory)
 	-@rm -f ${@:stmp=T} $@
 	$(rpcgen-cmd) -h $< -o ${@:stmp=T}
@@ -163,7 +176,7 @@ $(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(obj
 # Generate the rpcsvc XDR functions with rpcgen.
 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
 	@:
-$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
+$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
 	-@rm -f ${@:stmp=T} $@
 	$(rpcgen-cmd) -c $< -o ${@:stmp=T}
 	$(move-if-change) $(@:stmp=T) $(@:stmp=c)
Index: glibc-2.7/timezone/Makefile
===================================================================
--- glibc-2.7.orig/timezone/Makefile
+++ glibc-2.7/timezone/Makefile
@@ -28,6 +28,9 @@ distribute := tzfile.h private.h scheck.
 extra-objs := scheck.o ialloc.o
 
 others	:= zdump zic
+ifneq ($(cross-compiling),no)
+others-native := zic-native
+endif
 tests	:= test-tz tst-timezone
 
 tzbases := africa antarctica asia australasia europe northamerica \
@@ -69,13 +72,10 @@ installed-posixrules-file := $(firstword
 					 $(addprefix $(inst_zonedir)/, \
 						     $(posixrules-file)))
 
-ifeq ($(cross-compiling),no)
-# Don't try to install the zoneinfo files since we can't run zic.
 install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
 					      $(zonenames:%=posix/%) \
 					      $(zonenames:%=right/%)) \
 		 $(installed-localtime-file) $(installed-posixrules-file)
-endif
 
 ifeq ($(have-ksh),yes)
 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
@@ -128,7 +128,11 @@ echo-zonenames:
 # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
 # place the output files although $(zonedir) is compiled in.  But the
 # user might have set $(install_root) on the command line of `make install'.
+ifeq ($(cross-compiling),no)
 zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
+else
+zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
+endif
 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
 	    -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
 
@@ -158,8 +162,10 @@ $(installed-posixrules-file): $(inst_zon
 	$(zic-cmd) -p $(posixrules)
 endif
 
-
 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
+ifneq ($(cross-compiling),no)
+$(objpfx)zic-native:  $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
+endif
 
 tz-cflags = -DTZDIR='"$(zonedir)"' \
 	    -DTZDEFAULT='"$(localtime-file)"' \
Index: glibc-2.7/include-native/sys/types.h
===================================================================
--- /dev/null
+++ glibc-2.7/include-native/sys/types.h
@@ -0,0 +1,9 @@
+#include_next <sys/types.h>
+
+#ifndef __u_char_defined
+# define __u_char_defined
+#endif
+#ifndef __daddr_t_defined
+# define __daddr_t_defined
+#endif
+