yann@1: Fixes yann@1: elf/librtld.os: In function `process_envvars': : undefined reference to `__access' yann@1: ... yann@1: when building glibc-2.3.x on cygwin yann@1: yann@1: Idea from yann@1: http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch yann@1: Basically, make glibc use .oST as suffix for 'object static' yann@1: instead of .oS, since cygwin has trouble distinguishing .os from .oS yann@1: (Original patch had .on, but .oST is more mnemonic for 'object static') yann@1: yann@1: glibc-linuxthreads-2.3.5 also requires a patch, see yann@1: ../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch yann@1: yann@1: [ forward ported to glibc-2.3.5 by Petr Cvachoucek: yann@1: yann@1: Message-ID: <4282FCBA.3040000@unicontrols.cz> yann@1: Date: Thu, 12 May 2005 08:50:34 +0200 yann@1: From: Petr Cvachoucek yann@1: To: Dan Kegel yann@1: CC: crossgcc@sources.redhat.com yann@1: Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin yann@1: yann@1: Hi Dan, yann@1: following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain yann@1: on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. yann@1: yann@1: -- yann@1: Petr Cvachoucek yann@1: Unicontrols a.s. yann@1: http://www.unicontrols.cz yann@1: ] yann@1: yann@1: diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig yann@1: --- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 yann@1: +++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 yann@1: @@ -449,7 +449,7 @@ yann@1: # run the linked programs. yann@1: link-libc = -Wl,-rpath-link=$(rpath-link) \ yann@1: $(common-objpfx)libc.so$(libc.so-version) \ yann@1: - $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) yann@1: + $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) yann@1: # This is how to find at build-time things that will be installed there. yann@1: rpath-dirs = math elf dlfcn nss nis rt resolv crypt yann@1: endif yann@1: @@ -656,7 +656,7 @@ yann@1: # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) yann@1: # to pass different flags for each flavor. yann@1: libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) yann@1: -all-object-suffixes := .o .os .op .og .ob .oS yann@1: +all-object-suffixes := .o .os .op .og .ob .oST yann@1: object-suffixes := yann@1: CPPFLAGS-.o = $(pic-default) yann@1: CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) yann@1: @@ -712,14 +712,14 @@ yann@1: yann@1: ifeq (yes,$(build-shared)) yann@1: # Build special library that contains the static-only routines for libc. yann@1: -object-suffixes-for-libc += .oS yann@1: +object-suffixes-for-libc += .oST yann@1: yann@1: # Must build the routines as PIC, though, because they can end up in (users') yann@1: # shared objects. We don't want to use CFLAGS-os because users may, for yann@1: # example, make that processor-specific. yann@1: -CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) yann@1: -CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 yann@1: -libtype.oS = lib%_nonshared.a yann@1: +CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) yann@1: +CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 yann@1: +libtype.oST = lib%_nonshared.a yann@1: endif yann@1: yann@1: # The assembler can generate debug information too. yann@1: diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules yann@1: --- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 yann@1: +++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 yann@1: @@ -416,7 +416,7 @@ yann@1: # Bounded pointer thunks are only built for *.ob yann@1: elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) yann@1: yann@1: -elide-routines.oS += $(filter-out $(static-only-routines),\ yann@1: +elide-routines.oST += $(filter-out $(static-only-routines),\ yann@1: $(routines) $(aux) $(sysdep_routines)) \ yann@1: $(elide-bp-thunks) yann@1: elide-routines.os += $(static-only-routines) $(elide-bp-thunks) yann@1: @@ -961,7 +961,7 @@ yann@1: install: $(inst_libdir)/libc.so yann@1: $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ yann@1: $(common-objpfx)libc.so$(libc.so-version) \ yann@1: - $(inst_libdir)/$(patsubst %,$(libtype.oS),\ yann@1: + $(inst_libdir)/$(patsubst %,$(libtype.oST),\ yann@1: $(libprefix)$(libc-name)) \ yann@1: $(+force) yann@1: (echo '/* GNU ld script';\ yann@1: @@ -969,7 +969,7 @@ yann@1: echo ' the static library, so try that secondarily. */';\ yann@1: cat $<; \ yann@1: echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ yann@1: - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ yann@1: + '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ yann@1: ')' \ yann@1: ) > $@.new yann@1: mv -f $@.new $@ yann@1: diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk yann@1: --- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 yann@1: +++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 yann@1: @@ -13,7 +13,7 @@ yann@1: yann@1: ifneq (,$($(lib)-static-only-routines)) yann@1: ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) yann@1: -object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) yann@1: +object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) yann@1: endif yann@1: endif yann@1: yann@1: @@ -29,7 +29,7 @@ yann@1: yann@1: # Add each flavor of library to the lists of things to build and install. yann@1: install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) yann@1: -extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ yann@1: +extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ yann@1: $(patsubst %,%$o,$(filter-out \ yann@1: $($(lib)-shared-only-routines),\ yann@1: $(all-$(lib)-routines)))) yann@1: @@ -57,7 +57,7 @@ yann@1: yann@1: yann@1: # Use o-iterator.mk to generate a rule for each flavor of library. yann@1: -ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) yann@1: +ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) yann@1: define o-iterator-doit yann@1: $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ yann@1: $(patsubst %,$(objpfx)%$o,\ yann@1: @@ -65,7 +65,7 @@ yann@1: $(all-$(lib)-routines))); \ yann@1: $$(build-extra-lib) yann@1: endef yann@1: -object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) yann@1: +object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) yann@1: include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) yann@1: endif yann@1: yann@1: @@ -77,9 +77,9 @@ yann@1: $(build-extra-lib) yann@1: endif yann@1: yann@1: -ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) yann@1: -$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ yann@1: - $(patsubst %,$(objpfx)%.oS,\ yann@1: +ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) yann@1: +$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ yann@1: + $(patsubst %,$(objpfx)%.oST,\ yann@1: $(filter $($(lib)-static-only-routines),\ yann@1: $(all-$(lib)-routines))) yann@1: $(build-extra-lib) yann@1: diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile yann@1: --- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 yann@1: +++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 yann@1: @@ -360,7 +360,7 @@ yann@1: yann@1: $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ yann@1: $(objpfx)libpthread.so$(libpthread.so-version) \ yann@1: - $(inst_libdir)/$(patsubst %,$(libtype.oS),\ yann@1: + $(inst_libdir)/$(patsubst %,$(libtype.oST),\ yann@1: $(libprefix)pthread) \ yann@1: $(+force) yann@1: (echo '/* GNU ld script';\ yann@1: @@ -368,7 +368,7 @@ yann@1: echo ' the static library, so try that secondarily. */';\ yann@1: cat $<; \ yann@1: echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ yann@1: - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ yann@1: + '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ yann@1: ')' \ yann@1: ) > $@.new yann@1: mv -f $@.new $@ yann@1: diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile yann@1: --- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 yann@1: +++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 yann@1: @@ -10,4 +10,4 @@ yann@1: ASFLAGS-.op += -Wa,-Av9a yann@1: ASFLAGS-.og += -Wa,-Av9a yann@1: ASFLAGS-.ob += -Wa,-Av9a yann@1: -ASFLAGS-.oS += -Wa,-Av9a yann@1: +ASFLAGS-.oST += -Wa,-Av9a yann@1: yann@1: Signed-off-by: Robert P. J. Day