Offer an option to build the gdbserver statically. This helps in case of debugging shared library loading.
2 elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
4 when building glibc-2.3.4 on cygwin
7 http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
8 Basically, make glibc use .oST as suffix for 'object static'
9 instead of .oS, since cygwin has trouble distinguishing .os from .oS
10 (Original patch had .on, but .oST is more mnemonic for 'object static')
12 glibc-linuxthreads-2.3.4 also requires a patch, see
13 ../glibc-linuxthreads-2.3.4/glibc-linuxthreads-2.3.4-cygwin.patch
15 [ Ported to glibc-2.3.4 by steve@digidescorp.com ]
17 --- glibc-2.3.4/Makeconfig.orig 2004-12-15 12:51:47.000000000 -0600
18 +++ glibc-2.3.4/Makeconfig 2005-06-29 00:31:27.000000000 -0500
20 # run the linked programs.
21 link-libc = -Wl,-rpath-link=$(rpath-link) \
22 $(common-objpfx)libc.so$(libc.so-version) \
23 - $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
24 + $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
25 # This is how to find at build-time things that will be installed there.
26 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
29 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
30 # to pass different flags for each flavor.
31 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
32 -all-object-suffixes := .o .os .op .og .ob .oS
33 +all-object-suffixes := .o .os .op .og .ob .oST
35 CPPFLAGS-.o = $(pic-default)
36 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
39 ifeq (yes,$(build-shared))
40 # Build special library that contains the static-only routines for libc.
41 -object-suffixes-for-libc += .oS
42 +object-suffixes-for-libc += .oST
44 # Must build the routines as PIC, though, because they can end up in (users')
45 # shared objects. We don't want to use CFLAGS-os because users may, for
46 # example, make that processor-specific.
47 -CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
48 -CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
49 -libtype.oS = lib%_nonshared.a
50 +CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
51 +CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
52 +libtype.oST = lib%_nonshared.a
55 # The assembler can generate debug information too.
56 --- glibc-2.3.4/Makerules.orig 2005-06-28 20:57:52.562500000 -0500
57 +++ glibc-2.3.4/Makerules 2005-06-29 00:27:21.328125000 -0500
59 # Bounded pointer thunks are only built for *.ob
60 elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
62 -elide-routines.oS += $(filter-out $(static-only-routines),\
63 +elide-routines.oST += $(filter-out $(static-only-routines),\
64 $(routines) $(aux) $(sysdep_routines)) \
66 elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
68 install: $(inst_libdir)/libc.so
69 $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
70 $(common-objpfx)libc.so$(libc.so-version) \
71 - $(inst_libdir)/$(patsubst %,$(libtype.oS),\
72 + $(inst_libdir)/$(patsubst %,$(libtype.oST),\
73 $(libprefix)$(libc-name)) \
75 (echo '/* GNU ld script';\
77 echo ' the static library, so try that secondarily. */';\
79 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
80 - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
81 + '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
85 diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
86 --- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
87 +++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
90 ifneq (,$($(lib)-static-only-routines))
91 ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
92 -object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
93 +object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
99 # Add each flavor of library to the lists of things to build and install.
100 install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
101 -extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
102 +extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
103 $(patsubst %,%$o,$(filter-out \
104 $($(lib)-shared-only-routines),\
105 $(all-$(lib)-routines))))
109 # Use o-iterator.mk to generate a rule for each flavor of library.
110 -ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
111 +ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
112 define o-iterator-doit
113 $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
114 $(patsubst %,$(objpfx)%$o,\
116 $(all-$(lib)-routines))); \
119 -object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
120 +object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
121 include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
128 -ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
129 -$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
130 - $(patsubst %,$(objpfx)%.oS,\
131 +ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
132 +$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
133 + $(patsubst %,$(objpfx)%.oST,\
134 $(filter $($(lib)-static-only-routines),\
135 $(all-$(lib)-routines)))
137 diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
138 --- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
139 +++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
142 $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
143 $(objpfx)libpthread.so$(libpthread.so-version) \
144 - $(inst_libdir)/$(patsubst %,$(libtype.oS),\
145 + $(inst_libdir)/$(patsubst %,$(libtype.oST),\
146 $(libprefix)pthread) \
148 (echo '/* GNU ld script';\
150 echo ' the static library, so try that secondarily. */';\
152 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
153 - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
154 + '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
158 diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
159 --- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
160 +++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
162 ASFLAGS-.op += -Wa,-Av9a
163 ASFLAGS-.og += -Wa,-Av9a
164 ASFLAGS-.ob += -Wa,-Av9a
165 -ASFLAGS-.oS += -Wa,-Av9a
166 +ASFLAGS-.oST += -Wa,-Av9a