source: clfs-sysroot/patches/glibc-2.6-cross_hacks-1.patch @ 42d73f3

Last change on this file since 42d73f3 was 00520f6, checked in by Joe Ciccone <jciccone@…>, 15 years ago

Update patches.

  • Property mode set to 100644
File size: 16.4 KB
  • iconv/Makefile

    Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
    Date: 2006-11-26
    Initial Package Version: 2.5
    	Rediffed against 2.6 by Joe Ciccone
    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.6.orig/iconv/Makefile glibc-2.6/iconv/Makefile
    old new  
    5656                  iconvconfig.h
    5757
    5858others          = iconv_prog iconvconfig
     59ifneq ($(cross-compiling),no)
     60others-native   = iconvconfig-native
     61endif
    5962install-others  = $(inst_bindir)/iconv
    6063install-sbin    = iconvconfig
    6164
     
    7881
    7982$(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
    8083$(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
     84$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
    8185
    8286ifneq ($(cross-compiling),yes)
    8387xtests: test-iconvconfig
  • iconvdata/Makefile

    diff -Naur glibc-2.6.orig/iconvdata/Makefile glibc-2.6/iconvdata/Makefile
    old new  
    312312
    313313headers: $(addprefix $(objpfx), $(generated-modules:=.h))
    314314
     315ifeq ($(cross-compiling),no)
     316iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
     317  $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
     318  $(common-objpfx)iconv/iconvconfig
     319else
     320iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
     321  $(common-objpfx)iconv/iconvconfig-native
     322endif
     323
    315324$(addprefix $(inst_gconvdir)/, $(modules.so)): \
    316325    $(inst_gconvdir)/%: $(objpfx)% $(+force)
    317326        $(do-install-program)
    318327$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
    319328        $(do-install)
    320 ifeq (no,$(cross-compiling))
    321329# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
    322330# if this libc has more gconv modules than the previously installed one.
    323331        if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
    324            LC_ALL=C LANGUAGE=C \
    325            $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
    326            $(common-objpfx)iconv/iconvconfig \
    327              $(addprefix --prefix=,$(install_root)); \
     332           $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
    328333        fi
    329 else
    330         @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
    331 endif
    332334
    333335endif # build-shared = yes
    334336
  • include-native/bits/libc-tsd.h

    diff -Naur glibc-2.6.orig/include-native/bits/libc-tsd.h glibc-2.6/include-native/bits/libc-tsd.h
    old new  
     1#ifndef __libc_tsd_define
     2#define __libc_tsd_define(A,B)
     3#endif
  • include-native/config.h

    diff -Naur glibc-2.6.orig/include-native/config.h glibc-2.6/include-native/config.h
    old new  
     1/* Empty */
  • include-native/gnu/stubs.h

    diff -Naur glibc-2.6.orig/include-native/gnu/stubs.h glibc-2.6/include-native/gnu/stubs.h
    old new  
     1/* Empty */
  • include-native/intl/loadinfo.h

    diff -Naur glibc-2.6.orig/include-native/intl/loadinfo.h glibc-2.6/include-native/intl/loadinfo.h
    old new  
     1#ifndef LOADINFO_H
     2#define LOADINFO_H
     3struct loaded_l10nfile;
     4#endif
  • include-native/libintl.h

    diff -Naur glibc-2.6.orig/include-native/libintl.h glibc-2.6/include-native/libintl.h
    old new  
     1#include_next <libintl.h>
     2
     3#ifndef _
     4#define _(X) (X)
     5#endif
     6
     7#ifndef N_
     8#define N_(X) (X)
     9#endif
     10
     11#ifndef _libc_intl_domainname
     12#define _libc_intl_domainname "libc"
     13#endif
  • include-native/symbol-hacks.h

    diff -Naur glibc-2.6.orig/include-native/symbol-hacks.h glibc-2.6/include-native/symbol-hacks.h
    old new  
     1/* Empty */
  • include-native/tls.h

    diff -Naur glibc-2.6.orig/include-native/tls.h glibc-2.6/include-native/tls.h
    old new  
     1#ifndef _include_tls_h
     2#define _include_tls_h 1
     3
     4#if USE_TLS && HAVE___THREAD \
     5    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
     6# define USE___THREAD 1
     7#else
     8# define USE___THREAD 0
     9#endif
     10
     11#endif
  • locale/Makefile

    diff -Naur glibc-2.6.orig/locale/Makefile glibc-2.6/locale/Makefile
    old new  
    4444aux             = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
    4545                  xlocale localename global-locale coll-lookup
    4646others          = localedef locale
     47ifneq ($(cross-compiling),no)
     48others-native   = localedef-native
     49endif
    4750#others-static  = localedef locale
    4851install-bin     = localedef locale
    4952extra-objs      = $(localedef-modules:=.o) $(localedef-aux:=.o) \
     
    8184$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
    8285$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
    8386
     87ifneq ($(cross-compiling),no)
     88$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
     89$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
     90$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
     91endif
     92
    8493C-translit.h: C-translit.h.in gen-translit.pl
    8594        $(PERL) gen-translit.pl < $< > $@.tmp
    8695        mv -f $@.tmp $@
  • localedata/Makefile

    diff -Naur glibc-2.6.orig/localedata/Makefile glibc-2.6/localedata/Makefile
    old new  
    206206INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
    207207
    208208# Sometimes the whole collection of locale files should be installed.
     209ifeq ($(cross-compiling),no)
    209210LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
    210211$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
     212else
     213LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
     214$(common-objpfx)locale/localedef-native
     215endif
    211216install-locales: $(INSTALL-SUPPORTED-LOCALES)
    212217
    213218install-locales-dir:
  • Makeconfig

    diff -Naur glibc-2.6.orig/Makeconfig glibc-2.6/Makeconfig
    old new  
    445445                           $(common-objpfx)libc% $(+postinit),$^) \
    446446              $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
    447447endif
     448# Command for linking programs against the host system.
     449ifndef +link-native
     450+link-native = $(BUILD_CC) -static -g -o $@ $^ \
     451              $(LDFLAGS) $(LDFLAGS-$(@F)) \
     452              $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
     453              $(link-extra-libs)
     454endif
    448455# Command for statically linking bounded-pointer programs with the C library.
    449456ifndef +link-bounded
    450457+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
     
    658665            $(+sysdep-includes) $(includes) \
    659666            $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
    660667
     668+includes-native = -I$(..)include-native -I$(objpfx) -I.
     669
    661670# Since libio has several internal header files, we use a -I instead
    662671# of many little headers in the include directory.
    663672libio-include = -I$(..)libio
     
    672681           $(foreach lib,$(libof-$(basename $(@F))) \
    673682                         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
    674683           $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
     684CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
     685                  $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
     686                  $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
    675687override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
    676688                  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
    677689                  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
    678690                  $(CFLAGS-$(@F))
     691override CFLAGS-native = -std=gnu99 $(default_cflags) $(+gccwarn-c) \
     692                         $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
    679693override CXXFLAGS = $(c++-sysincludes) \
    680694                    $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
    681695                    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
  • Makerules

    diff -Naur glibc-2.6.orig/Makerules glibc-2.6/Makerules
    old new  
    292292object-suffixes-left := $(all-object-suffixes)
    293293include $(o-iterator)
    294294
     295$(objpfx)%-native.o: %.c $(before-compile)
     296        $(native-compile-command.c)
     297
    295298# Omit the objpfx rules when building in the source tree, because
    296299# objpfx is empty and so these rules just override the ones above.
    297300ifdef objpfx
     
    368371compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
    369372compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
    370373compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
     374# Native commands
     375native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
    371376
    372377# GCC can grok options after the file name, and it looks nicer that way.
    373378compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
     
    377382COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
    378383                  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
    379384COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
     385# Native commands
     386native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
    380387
    381388# We need this for the output to go in the right place.  It will default to
    382389# empty if make was configured to work with a cc that can't grok -c and -o
     
    11681175$(make-target-directory)
    11691176$(patsubst %/,cd % &&,$(objpfx)) \
    11701177$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
    1171             $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
     1178            $(addprefix $(shell pwd)/, $^) -o $(@F)
    11721179endef
    11731180
    11741181# Command to compile $< in $(common-objdir) using the native libraries.
  • malloc/Makefile

    diff -Naur glibc-2.6.orig/malloc/Makefile glibc-2.6/malloc/Makefile
    old new  
    7373endif
    7474endif
    7575
    76 # Unless we get a test for the availability of libgd which also works
    77 # for cross-compiling we disable the memusagestat generation in this
    78 # situation.
    79 ifneq ($(cross-compiling),yes)
    8076# If the gd library is available we build the `memusagestat' program.
    8177ifneq ($(LIBGD),no)
    8278others: $(objpfx)memusage
     
    9187# is to presume that the standard system headers will be ok for this file.
    9288$(objpfx)memusagestat.o: sysincludes = # nothing
    9389endif
    94 endif
    9590
    9691# Another goal which can be used to override the configure decision.
    9792.PHONY: do-memusagestat
  • glibc-2.6

    diff -Naur glibc-2.6.orig/Rules glibc-2.6/Rules
    old new  
    8787
    8888.PHONY: others tests
    8989ifeq ($(build-programs),yes)
    90 others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
     90others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
    9191else
    9292others: $(addprefix $(objpfx),$(extra-objs))
    9393endif
     
    106106ifeq ($(build-programs),yes)
    107107binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
    108108binaries-static = $(others-static) $(tests-static) $(xtests-static)
     109binaries-native = $(others-native)
    109110else
    110111binaries-all = $(tests) $(xtests) $(test-srcs)
    111112binaries-static =
     113binaries-native =
    112114endif
    113115
    114116binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
     
    127129        $(+link-static)
    128130endif
    129131
     132ifneq "$(strip $(binaries-native))" ""
     133$(addprefix $(objpfx),$(binaries-native)): %: %.o
     134        $(+link-native)
     135endif
     136
    130137ifeq ($(build-bounded),yes)
    131138binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
    132139$(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
  • sunrpc/Makefile

    diff -Naur glibc-2.6.orig/sunrpc/Makefile glibc-2.6/sunrpc/Makefile
    old new  
    7070            clnt_unix svc_unix create_xid xdr_intXX_t
    7171
    7272others := rpcinfo
     73ifneq ($(cross-compiling),no)
     74others-native := rpcgen-native
     75endif
    7376install-bin := rpcgen
    7477install-sbin := rpcinfo
    7578rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
     
    98101             $(resolvobjdir)/libresolv.a
    99102endif
    100103
    101 ifeq (no,$(cross-compiling))
    102 # We can only build this library if we can run the rpcgen we build.
    103104headers += $(rpcsvc:%.x=rpcsvc/%.h)
    104105extra-libs := librpcsvc
    105106extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
    106107librpcsvc-routines = $(rpcsvc:%.x=x%)
    107108librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
    108109omit-deps = $(librpcsvc-routines)
    109 endif
    110110
    111111CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
    112112CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
     
    136136  $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
    137137        $(+link)
    138138
     139ifneq ($(cross-compiling),no)
     140rpcgen.c:
     141        touch rpcgen.c
     142
     143$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
     144endif
     145
    139146# This makes sure -DNOT_IN_libc is passed for all these modules.
    140147cpp-srcs-left := $(rpcgen-objs:.o=.c)
    141148lib := nonlib
    142149include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
    143150
    144151# Tell rpcgen where to find the C preprocessor.
     152ifeq ($(cross-compiling),no)
    145153rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
     154rpcgen = $(objpfx)rpcgen
     155else
     156rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
     157rpcgen = $(objpfx)rpcgen-native
     158endif
    146159
    147160# Install the rpc data base file.
    148161$(inst_sysconfdir)/rpc: etc.rpc $(+force)
     
    153166# relinked.
    154167$(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
    155168        @:
    156 $(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
     169$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
    157170        $(make-target-directory)
    158171        -@rm -f ${@:stmp=T} $@
    159172        $(rpcgen-cmd) -h $< -o ${@:stmp=T}
     
    163176# Generate the rpcsvc XDR functions with rpcgen.
    164177$(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
    165178        @:
    166 $(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
     179$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
    167180        -@rm -f ${@:stmp=T} $@
    168181        $(rpcgen-cmd) -c $< -o ${@:stmp=T}
    169182        $(move-if-change) $(@:stmp=T) $(@:stmp=c)
  • timezone/Makefile

    diff -Naur glibc-2.6.orig/timezone/Makefile glibc-2.6/timezone/Makefile
    old new  
    2828extra-objs := scheck.o ialloc.o
    2929
    3030others  := zdump zic
     31ifneq ($(cross-compiling),no)
     32others-native := zic-native
     33endif
    3134tests   := test-tz tst-timezone
    3235
    3336tzbases := africa antarctica asia australasia europe northamerica \
     
    6972                                         $(addprefix $(inst_zonedir)/, \
    7073                                                     $(posixrules-file)))
    7174
    72 ifeq ($(cross-compiling),no)
    73 # Don't try to install the zoneinfo files since we can't run zic.
    7475install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
    7576                                              $(zonenames:%=posix/%) \
    7677                                              $(zonenames:%=right/%)) \
    7778                 $(installed-localtime-file) $(installed-posixrules-file)
    78 endif
    7979
    8080ifeq ($(have-ksh),yes)
    8181install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
     
    128128# We have to use `-d $(inst_zonedir)' to explictly tell zic where to
    129129# place the output files although $(zonedir) is compiled in.  But the
    130130# user might have set $(install_root) on the command line of `make install'.
     131ifeq ($(cross-compiling),no)
    131132zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
     133else
     134zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
     135endif
    132136tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
    133137            -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
    134138
     
    158162        $(zic-cmd) -p $(posixrules)
    159163endif
    160164
    161 
    162165$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
     166ifneq ($(cross-compiling),no)
     167$(objpfx)zic-native:  $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
     168endif
    163169
    164170tz-cflags = -DTZDIR='"$(zonedir)"' \
    165171            -DTZDEFAULT='"$(localtime-file)"' \
Note: See TracBrowser for help on using the repository browser.