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