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