source: clfs-sysroot/patches/glibc-2.8-cross_hacks-1.patch@ 0566c2a

Last change on this file since 0566c2a was cf77be8, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Update patch to fix compilation problem.

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

    Submitted By: Joe Ciccone <jciccone@gmail.com>
    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
    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.8.orig/iconv/Makefile glibc-2.8/iconv/Makefile
    old new  
    5757                  iconvconfig.h
    5858
    5959others          = iconv_prog iconvconfig
     60ifneq ($(cross-compiling),no)
     61  others-native  = iconvconfig-native
     62endif
    6063install-others-programs = $(inst_bindir)/iconv
    6164install-sbin    = iconvconfig
    6265
     
    7982
    8083$(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
    8184$(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
     85$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
    8286
    8387ifneq ($(cross-compiling),yes)
    8488xtests: test-iconvconfig
  • iconvdata/Makefile

    diff -Naur glibc-2.8.orig/iconvdata/Makefile glibc-2.8/iconvdata/Makefile
    old new  
    317317
    318318headers: $(addprefix $(objpfx), $(generated-modules:=.h))
    319319
     320ifeq ($(cross-compiling),no)
     321iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
     322  $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
     323  $(common-objpfx)iconv/iconvconfig
     324else
     325iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
     326  $(common-objpfx)iconv/iconvconfig-native
     327endif
     328
    320329$(addprefix $(inst_gconvdir)/, $(modules.so)): \
    321330    $(inst_gconvdir)/%: $(objpfx)% $(+force)
    322331        $(do-install-program)
    323332$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
    324333        $(do-install)
    325 ifeq (no,$(cross-compiling))
    326334# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
    327335# if this libc has more gconv modules than the previously installed one.
    328336        if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
    329            LC_ALL=C LANGUAGE=C \
    330            $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
    331            $(common-objpfx)iconv/iconvconfig \
    332              $(addprefix --prefix=,$(install_root)); \
     337           $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
    333338        fi
    334 else
    335         @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
    336 endif
    337339
    338340endif # build-shared = yes
    339341
  • include-native/bits/libc-tsd.h

    diff -Naur glibc-2.8.orig/include-native/bits/libc-tsd.h glibc-2.8/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.8.orig/include-native/config.h glibc-2.8/include-native/config.h
    old new  
     1/* Empty */
  • include-native/gnu/stubs.h

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

    diff -Naur glibc-2.8.orig/include-native/intl/loadinfo.h glibc-2.8/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.8.orig/include-native/libintl.h glibc-2.8/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.8.orig/include-native/symbol-hacks.h glibc-2.8/include-native/symbol-hacks.h
    old new  
     1/* Empty */
  • include-native/tls.h

    diff -Naur glibc-2.8.orig/include-native/tls.h glibc-2.8/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.8.orig/locale/Makefile glibc-2.8/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.8.orig/localedata/Makefile glibc-2.8/localedata/Makefile
    old new  
    207207INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
    208208
    209209# Sometimes the whole collection of locale files should be installed.
     210ifeq ($(cross-compiling),no)
    210211LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
    211212$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
     213else
     214LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
     215$(common-objpfx)locale/localedef-native
     216endif
    212217install-locales: $(INSTALL-SUPPORTED-LOCALES)
    213218
    214219install-locales-dir:
  • Makeconfig

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

    diff -Naur glibc-2.8.orig/Makerules glibc-2.8/Makerules
    old new  
    278278object-suffixes-left := $(all-object-suffixes)
    279279include $(o-iterator)
    280280
     281$(objpfx)%-native.o: %.c $(before-compile)
     282        $(native-compile-command.c)
     283
    281284# Omit the objpfx rules when building in the source tree, because
    282285# objpfx is empty and so these rules just override the ones above.
    283286ifdef objpfx
     
    354357compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
    355358compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
    356359compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
     360# Native commands
     361native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
    357362
    358363# GCC can grok options after the file name, and it looks nicer that way.
    359364compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
     
    363368COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
    364369                  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
    365370COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
     371# Native commands
     372native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
    366373
    367374# We need this for the output to go in the right place.  It will default to
    368375# empty if make was configured to work with a cc that can't grok -c and -o
     
    11561163$(make-target-directory)
    11571164$(patsubst %/,cd % &&,$(objpfx)) \
    11581165$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
    1159             $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
     1166            $(addprefix $(shell pwd)/, $^) -o $(@F)
    11601167endef
    11611168
    11621169# Command to compile $< in $(common-objdir) using the native libraries.
  • malloc/Makefile

    diff -Naur glibc-2.8.orig/malloc/Makefile glibc-2.8/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.8

    diff -Naur glibc-2.8.orig/Rules glibc-2.8/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.8.orig/sunrpc/Makefile glibc-2.8/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.8.orig/timezone/Makefile glibc-2.8/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.