Submitted By: Joe Ciccone Date: 2006-11-26 Initial Package Version: 2.5 Rediffed against 2.6 by Joe Ciccone Rediffed against 2.8 by Joe Ciccone on 2009-01-03 Rediffed against 2.9 by Joe Ciccone on 2009-03-15 Rediffed against 2.10.1 by crux-arm@mikeux.dyndns.org 2009-12-16 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. diff -Naur glibc-2.10.1.orig/iconv/Makefile glibc-2.10.1/iconv/Makefile --- glibc-2.10.1.orig/iconv/Makefile 2007-07-24 23:41:17.000000000 -0400 +++ glibc-2.10.1/iconv/Makefile 2009-03-15 19:22:15.732837951 -0400 @@ -57,6 +57,9 @@ 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 @@ $(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 diff -Naur glibc-2.10.1.orig/iconvdata/Makefile glibc-2.10.1/iconvdata/Makefile --- glibc-2.10.1.orig/iconvdata/Makefile 2008-05-14 21:54:31.000000000 -0400 +++ glibc-2.10.1/iconvdata/Makefile 2009-03-15 19:22:15.753163155 -0400 @@ -320,23 +320,25 @@ 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 diff -Naur glibc-2.10.1.orig/include-native/bits/libc-tsd.h glibc-2.10.1/include-native/bits/libc-tsd.h --- glibc-2.10.1.orig/include-native/bits/libc-tsd.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/bits/libc-tsd.h 2009-03-15 19:22:15.788787576 -0400 @@ -0,0 +1,3 @@ +#ifndef __libc_tsd_define +#define __libc_tsd_define(A,B,C) +#endif diff -Naur glibc-2.10.1.orig/include-native/config.h glibc-2.10.1/include-native/config.h --- glibc-2.10.1.orig/include-native/config.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/config.h 2009-03-15 19:22:15.809829790 -0400 @@ -0,0 +1 @@ +/* Empty */ diff -Naur glibc-2.10.1.orig/include-native/gnu/stubs.h glibc-2.10.1/include-native/gnu/stubs.h --- glibc-2.10.1.orig/include-native/gnu/stubs.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/gnu/stubs.h 2009-03-15 19:22:15.809829790 -0400 @@ -0,0 +1 @@ +/* Empty */ diff -Naur glibc-2.10.1.orig/include-native/intl/loadinfo.h glibc-2.10.1/include-native/intl/loadinfo.h --- glibc-2.10.1.orig/include-native/intl/loadinfo.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/intl/loadinfo.h 2009-03-15 19:22:15.809829790 -0400 @@ -0,0 +1,4 @@ +#ifndef LOADINFO_H +#define LOADINFO_H +struct loaded_l10nfile; +#endif diff -Naur glibc-2.10.1.orig/include-native/libintl.h glibc-2.10.1/include-native/libintl.h --- glibc-2.10.1.orig/include-native/libintl.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/libintl.h 2009-03-15 19:22:15.838789367 -0400 @@ -0,0 +1,13 @@ +#include_next + +#ifndef _ +#define _(X) (X) +#endif + +#ifndef N_ +#define N_(X) (X) +#endif + +#ifndef _libc_intl_domainname +#define _libc_intl_domainname "libc" +#endif diff -Naur glibc-2.10.1.orig/include-native/symbol-hacks.h glibc-2.10.1/include-native/symbol-hacks.h --- glibc-2.10.1.orig/include-native/symbol-hacks.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/symbol-hacks.h 2009-03-15 19:22:15.838789367 -0400 @@ -0,0 +1 @@ +/* Empty */ diff -Naur glibc-2.10.1.orig/include-native/tls.h glibc-2.10.1/include-native/tls.h --- glibc-2.10.1.orig/include-native/tls.h 1969-12-31 19:00:00.000000000 -0500 +++ glibc-2.10.1/include-native/tls.h 2009-03-15 19:22:15.838789367 -0400 @@ -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 diff -Naur glibc-2.10.1.orig/locale/Makefile glibc-2.10.1/locale/Makefile --- glibc-2.10.1.orig/locale/Makefile 2005-12-20 01:58:41.000000000 -0500 +++ glibc-2.10.1/locale/Makefile 2009-03-15 19:22:15.838789367 -0400 @@ -44,6 +44,9 @@ 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)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 $@ diff -Naur glibc-2.10.1.orig/localedata/Makefile glibc-2.10.1/localedata/Makefile --- glibc-2.10.1.orig/localedata/Makefile 2008-11-27 19:05:08.000000000 -0500 +++ glibc-2.10.1/localedata/Makefile 2009-03-15 19:22:15.939718625 -0400 @@ -208,8 +208,13 @@ 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: diff -Naur glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig --- glibc-2.10.1.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400 +++ glibc-2.10.1/Makeconfig 2009-03-15 19:22:15.939718625 -0400 @@ -446,6 +446,13 @@ $(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) -static -g -o $@ $^ \ + $(LDFLAGS) $(LDFLAGS-$(@F)) \ + $(combreloc-LDFLAGS) $(relro-LDFLAGS) \ + $(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 $@ \ @@ -659,6 +666,8 @@ $(+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 @@ -673,10 +682,15 @@ $(foreach lib,$(libof-$(basename $(@F))) \ $(libof-$(