1 Submitted By: Joe Ciccone <jciccone@gmail.com>
3 Initial Package Version: 2.5
4 Rediffed against 2.6 by Joe Ciccone
5 Rediffed against 2.8 by Joe Ciccone on 2009-01-03
6 Rediffed against 2.9 by Joe Ciccone on 2009-03-15
7 Rediffed against 2.10.1 by crux-arm@mikeux.dyndns.org 2009-12-16
9 Upstream Status: Unknown
10 Description: Adds native compile support to the build system then uses that
11 support to build zic-native, for installing timezone info,
12 rpcgen-native, for building librpcsvc.a, and localedef-native,
13 for creating the locale-archive.
15 diff -Naur glibc-2.10.1.orig/iconv/Makefile glibc-2.10.1/iconv/Makefile
16 --- glibc-2.10.1.orig/iconv/Makefile 2007-07-24 23:41:17.000000000 -0400
17 +++ glibc-2.10.1/iconv/Makefile 2009-03-15 19:22:15.732837951 -0400
21 others = iconv_prog iconvconfig
22 +ifneq ($(cross-compiling),no)
23 + others-native = iconvconfig-native
25 install-others-programs = $(inst_bindir)/iconv
26 install-sbin = iconvconfig
30 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
31 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
32 +$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
34 ifneq ($(cross-compiling),yes)
35 xtests: test-iconvconfig
36 diff -Naur glibc-2.10.1.orig/iconvdata/Makefile glibc-2.10.1/iconvdata/Makefile
37 --- glibc-2.10.1.orig/iconvdata/Makefile 2008-05-14 21:54:31.000000000 -0400
38 +++ glibc-2.10.1/iconvdata/Makefile 2009-03-15 19:22:15.753163155 -0400
41 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
43 +ifeq ($(cross-compiling),no)
44 +iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
45 + $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
46 + $(common-objpfx)iconv/iconvconfig
48 +iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
49 + $(common-objpfx)iconv/iconvconfig-native
52 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
53 $(inst_gconvdir)/%: $(objpfx)% $(+force)
55 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
57 -ifeq (no,$(cross-compiling))
58 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
59 # if this libc has more gconv modules than the previously installed one.
60 if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
61 - LC_ALL=C LANGUAGE=C \
62 - $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
63 - $(common-objpfx)iconv/iconvconfig \
64 - $(addprefix --prefix=,$(install_root)); \
65 + $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
68 - @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
71 endif # build-shared = yes
73 diff -Naur glibc-2.10.1.orig/include-native/bits/libc-tsd.h glibc-2.10.1/include-native/bits/libc-tsd.h
74 --- glibc-2.10.1.orig/include-native/bits/libc-tsd.h 1969-12-31 19:00:00.000000000 -0500
75 +++ glibc-2.10.1/include-native/bits/libc-tsd.h 2009-03-15 19:22:15.788787576 -0400
77 +#ifndef __libc_tsd_define
78 +#define __libc_tsd_define(A,B,C)
80 diff -Naur glibc-2.10.1.orig/include-native/config.h glibc-2.10.1/include-native/config.h
81 --- glibc-2.10.1.orig/include-native/config.h 1969-12-31 19:00:00.000000000 -0500
82 +++ glibc-2.10.1/include-native/config.h 2009-03-15 19:22:15.809829790 -0400
85 diff -Naur glibc-2.10.1.orig/include-native/gnu/stubs.h glibc-2.10.1/include-native/gnu/stubs.h
86 --- glibc-2.10.1.orig/include-native/gnu/stubs.h 1969-12-31 19:00:00.000000000 -0500
87 +++ glibc-2.10.1/include-native/gnu/stubs.h 2009-03-15 19:22:15.809829790 -0400
90 diff -Naur glibc-2.10.1.orig/include-native/intl/loadinfo.h glibc-2.10.1/include-native/intl/loadinfo.h
91 --- glibc-2.10.1.orig/include-native/intl/loadinfo.h 1969-12-31 19:00:00.000000000 -0500
92 +++ glibc-2.10.1/include-native/intl/loadinfo.h 2009-03-15 19:22:15.809829790 -0400
96 +struct loaded_l10nfile;
98 diff -Naur glibc-2.10.1.orig/include-native/libintl.h glibc-2.10.1/include-native/libintl.h
99 --- glibc-2.10.1.orig/include-native/libintl.h 1969-12-31 19:00:00.000000000 -0500
100 +++ glibc-2.10.1/include-native/libintl.h 2009-03-15 19:22:15.838789367 -0400
102 +#include_next <libintl.h>
112 +#ifndef _libc_intl_domainname
113 +#define _libc_intl_domainname "libc"
115 diff -Naur glibc-2.10.1.orig/include-native/symbol-hacks.h glibc-2.10.1/include-native/symbol-hacks.h
116 --- glibc-2.10.1.orig/include-native/symbol-hacks.h 1969-12-31 19:00:00.000000000 -0500
117 +++ glibc-2.10.1/include-native/symbol-hacks.h 2009-03-15 19:22:15.838789367 -0400
120 diff -Naur glibc-2.10.1.orig/include-native/tls.h glibc-2.10.1/include-native/tls.h
121 --- glibc-2.10.1.orig/include-native/tls.h 1969-12-31 19:00:00.000000000 -0500
122 +++ glibc-2.10.1/include-native/tls.h 2009-03-15 19:22:15.838789367 -0400
124 +#ifndef _include_tls_h
125 +#define _include_tls_h 1
127 +#if USE_TLS && HAVE___THREAD \
128 + && (!defined NOT_IN_libc || defined IS_IN_libpthread)
129 +# define USE___THREAD 1
131 +# define USE___THREAD 0
135 diff -Naur glibc-2.10.1.orig/locale/Makefile glibc-2.10.1/locale/Makefile
136 --- glibc-2.10.1.orig/locale/Makefile 2005-12-20 01:58:41.000000000 -0500
137 +++ glibc-2.10.1/locale/Makefile 2009-03-15 19:22:15.838789367 -0400
139 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
140 xlocale localename global-locale coll-lookup
141 others = localedef locale
142 +ifneq ($(cross-compiling),no)
143 +others-native = localedef-native
145 #others-static = localedef locale
146 install-bin = localedef locale
147 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
149 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
150 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
152 +ifneq ($(cross-compiling),no)
153 +$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
154 +$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
155 +$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
158 C-translit.h: C-translit.h.in gen-translit.pl
159 $(PERL) gen-translit.pl < $< > $@.tmp
161 diff -Naur glibc-2.10.1.orig/localedata/Makefile glibc-2.10.1/localedata/Makefile
162 --- glibc-2.10.1.orig/localedata/Makefile 2008-11-27 19:05:08.000000000 -0500
163 +++ glibc-2.10.1/localedata/Makefile 2009-03-15 19:22:15.939718625 -0400
165 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
167 # Sometimes the whole collection of locale files should be installed.
168 +ifeq ($(cross-compiling),no)
169 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
170 $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
172 +LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
173 +$(common-objpfx)locale/localedef-native
175 install-locales: $(INSTALL-SUPPORTED-LOCALES)
178 diff -Naur glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
179 --- glibc-2.10.1.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400
180 +++ glibc-2.10.1/Makeconfig 2009-03-15 19:22:15.939718625 -0400
182 $(common-objpfx)libc% $(+postinit),$^) \
183 $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
185 +# Command for linking programs against the host system.
187 ++link-native = $(BUILD_CC) -static -g -o $@ $^ \
188 + $(LDFLAGS) $(LDFLAGS-$(@F)) \
189 + $(combreloc-LDFLAGS) $(relro-LDFLAGS) \
192 # Command for statically linking bounded-pointer programs with the C library.
194 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
196 $(+sysdep-includes) $(includes) \
197 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
199 ++includes-native = -I$(..)include-native -I$(objpfx) -I.
201 # Since libio has several internal header files, we use a -I instead
202 # of many little headers in the include directory.
203 libio-include = -I$(..)libio
204 @@ -673,10 +682,15 @@
205 $(foreach lib,$(libof-$(basename $(@F))) \
206 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
207 $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
208 +CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
209 + $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
210 + $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
211 override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
212 $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
213 $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
215 +override CFLAGS-native = -std=gnu99 $(gnu89-inline-CFLAGS) $(default_cflags) $(+gccwarn-c) \
216 + $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
217 override CXXFLAGS = $(c++-sysincludes) \
218 $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
219 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
220 diff -Naur glibc-2.10.1.orig/Makerules glibc-2.10.1/Makerules
221 --- glibc-2.10.1.orig/Makerules 2008-02-06 19:39:18.000000000 -0500
222 +++ glibc-2.10.1/Makerules 2009-03-15 19:22:15.975455420 -0400
224 object-suffixes-left := $(all-object-suffixes)
225 include $(o-iterator)
227 +$(objpfx)%-native.o: %.c $(before-compile)
228 + $(native-compile-command.c)
230 # Omit the objpfx rules when building in the source tree, because
231 # objpfx is empty and so these rules just override the ones above.
234 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
235 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
236 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
238 +native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
240 # GCC can grok options after the file name, and it looks nicer that way.
241 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
243 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
244 $(ASFLAGS) $(ASFLAGS-$(suffix $@))
245 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
247 +native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
249 # We need this for the output to go in the right place. It will default to
250 # empty if make was configured to work with a cc that can't grok -c and -o
251 @@ -1156,7 +1163,7 @@
252 $(make-target-directory)
253 $(patsubst %/,cd % &&,$(objpfx)) \
254 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
255 - $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
256 + $(addprefix $(shell pwd)/, $^) -o $(@F)
259 # Command to compile $< in $(common-objdir) using the native libraries.
260 diff -Naur glibc-2.10.1.orig/malloc/Makefile glibc-2.10.1/malloc/Makefile
261 --- glibc-2.10.1.orig/malloc/Makefile 2007-12-16 17:57:50.000000000 -0500
262 +++ glibc-2.10.1/malloc/Makefile 2009-03-15 19:22:15.975455420 -0400
267 -# Unless we get a test for the availability of libgd which also works
268 -# for cross-compiling we disable the memusagestat generation in this
270 -ifneq ($(cross-compiling),yes)
271 # If the gd library is available we build the `memusagestat' program.
273 others: $(objpfx)memusage
275 # is to presume that the standard system headers will be ok for this file.
276 $(objpfx)memusagestat.o: sysincludes = # nothing
280 # Another goal which can be used to override the configure decision.
281 .PHONY: do-memusagestat
282 diff -Naur glibc-2.10.1.orig/Rules glibc-2.10.1/Rules
283 --- glibc-2.10.1.orig/Rules 2006-02-28 02:05:48.000000000 -0500
284 +++ glibc-2.10.1/Rules 2009-03-15 19:22:15.975455420 -0400
288 ifeq ($(build-programs),yes)
289 -others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
290 +others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
292 others: $(addprefix $(objpfx),$(extra-objs))
295 ifeq ($(build-programs),yes)
296 binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
297 binaries-static = $(others-static) $(tests-static) $(xtests-static)
298 +binaries-native = $(others-native)
300 binaries-all = $(tests) $(xtests) $(test-srcs)
305 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
310 +ifneq "$(strip $(binaries-native))" ""
311 +$(addprefix $(objpfx),$(binaries-native)): %: %.o
315 ifeq ($(build-bounded),yes)
316 binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
317 $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
318 diff -Naur glibc-2.10.1.orig/sunrpc/Makefile glibc-2.10.1/sunrpc/Makefile
319 --- glibc-2.10.1.orig/sunrpc/Makefile 2006-10-18 15:25:38.000000000 -0400
320 +++ glibc-2.10.1/sunrpc/Makefile 2009-03-15 19:22:15.975455420 -0400
322 clnt_unix svc_unix create_xid xdr_intXX_t
325 +ifneq ($(cross-compiling),no)
326 +others-native := rpcgen-native
328 install-bin := rpcgen
329 install-sbin := rpcinfo
330 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
332 $(resolvobjdir)/libresolv.a
335 -ifeq (no,$(cross-compiling))
336 -# We can only build this library if we can run the rpcgen we build.
337 headers += $(rpcsvc:%.x=rpcsvc/%.h)
338 extra-libs := librpcsvc
339 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
340 librpcsvc-routines = $(rpcsvc:%.x=x%)
341 librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
342 omit-deps = $(librpcsvc-routines)
345 CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
346 CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
347 @@ -136,13 +136,26 @@
348 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
351 +ifneq ($(cross-compiling),no)
355 +$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
358 # This makes sure -DNOT_IN_libc is passed for all these modules.
359 cpp-srcs-left := $(rpcgen-objs:.o=.c)
361 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
363 # Tell rpcgen where to find the C preprocessor.
364 +ifeq ($(cross-compiling),no)
365 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
366 +rpcgen = $(objpfx)rpcgen
368 +rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
369 +rpcgen = $(objpfx)rpcgen-native
372 # Install the rpc data base file.
373 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
376 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
378 -$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
379 +$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
380 $(make-target-directory)
381 -@rm -f ${@:stmp=T} $@
382 $(rpcgen-cmd) -h $< -o ${@:stmp=T}
384 # Generate the rpcsvc XDR functions with rpcgen.
385 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
387 -$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
388 +$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
389 -@rm -f ${@:stmp=T} $@
390 $(rpcgen-cmd) -c $< -o ${@:stmp=T}
391 $(move-if-change) $(@:stmp=T) $(@:stmp=c)
392 diff -Naur glibc-2.10.1.orig/timezone/Makefile glibc-2.10.1/timezone/Makefile
393 --- glibc-2.10.1.orig/timezone/Makefile 2007-07-28 16:33:11.000000000 -0400
394 +++ glibc-2.10.1/timezone/Makefile 2009-03-15 19:22:16.056496560 -0400
396 extra-objs := scheck.o ialloc.o
399 +ifneq ($(cross-compiling),no)
400 +others-native := zic-native
402 tests := test-tz tst-timezone
404 tzbases := africa antarctica asia australasia europe northamerica \
406 $(addprefix $(inst_zonedir)/, \
409 -ifeq ($(cross-compiling),no)
410 -# Don't try to install the zoneinfo files since we can't run zic.
411 install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
412 $(zonenames:%=posix/%) \
413 $(zonenames:%=right/%)) \
414 $(installed-localtime-file) $(installed-posixrules-file)
417 ifeq ($(have-ksh),yes)
418 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
420 # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
421 # place the output files although $(zonedir) is compiled in. But the
422 # user might have set $(install_root) on the command line of `make install'.
423 +ifeq ($(cross-compiling),no)
424 zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
426 +zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
428 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
429 -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
432 $(zic-cmd) -p $(posixrules)
436 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
437 +ifneq ($(cross-compiling),no)
438 +$(objpfx)zic-native: $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
441 tz-cflags = -DTZDIR='"$(zonedir)"' \
442 -DTZDEFAULT='"$(localtime-file)"' \