diff -bNur glibc debbase debian control glibc debian control --- glibc

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
diff -bNur glibc.debbase/debian/control glibc/debian/control
--- glibc.debbase/debian/control 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/control 2008-12-28 21:07:18.000000000 +0600
@@ -94,6 +94,14 @@
Contains the symlinks, headers, and object files needed to compile
and link programs which use the standard C library.
+Package: libc6-dev-headers
+Architecture: amd64 arm armeb armel i386 m32r m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Section: libdevel
+Priority: extra
+Description: GNU C Library: Bootstrap Header Files
+ Contains the headers required for bootstrapping the toolchain, in particular,
+ building the bootstrap cross-gcc.
+
Package: libc6-dbg
Architecture: amd64 arm armeb armel i386 m32r m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libdevel
diff -bNur glibc.debbase/debian/control.in/libc glibc/debian/control.in/libc
--- glibc.debbase/debian/control.in/libc 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/control.in/libc 2009-01-05 07:17:02.000000000 +0600
@@ -19,6 +19,34 @@
Contains the symlinks, headers, and object files needed to compile
and link programs which use the standard C library.
+Package: @libc@-dev-headers
+Architecture: @archs@
+Section: libdevel
+Priority: extra
+Description: GNU C Library: Bootstrap Header Files
+ Contains the headers required for bootstrapping the toolchain, in particular,
+ building the bootstrap cross-gcc.
+
+Package: @libc@-second
+Architecture: @archs@
+Section: libdevel
+Priority: extra
+Description: GNU C Library: Intermediate bootstrap shared libraries
+ Contains the standard libraries that are used by nearly all programs on the
+ system. This package includes temporary shared versions of the standard C
+ library and the standard math library, as well as many others, created during
+ bootstrap.
+
+Package: @libc@-second-dev
+Architecture: @archs@
+Section: libdevel
+Priority: optional
+Depends: @libc@-second (= ${binary:Version})
+Replaces: @libc@-dev-headers
+Description: GNU C Library: Intermediate development Libraries and Header Files
+ Contains the symlinks, headers, and object files needed to compile and link
+ programs which use the standard C library, intermediate bootstrap version.
+
Package: @libc@-dbg
Architecture: @archs@
Section: libdevel
diff -bNur glibc.debbase/debian/debhelper.in/libc-dev-headers.install glibc/debian/debhelper.in/libc-dev-headers.install
--- glibc.debbase/debian/debhelper.in/libc-dev-headers.install 1970-01-01 07:00:00.000000000 +0700
+++ glibc/debian/debhelper.in/libc-dev-headers.install 2008-12-29 00:59:20.000000000 +0600
@@ -0,0 +1 @@
+debian/tmp-libc-headers/usr/include/* usr/include
diff -bNur glibc.debbase/debian/debhelper.in/libc-second-dev.install glibc/debian/debhelper.in/libc-second-dev.install
--- glibc.debbase/debian/debhelper.in/libc-second-dev.install 1970-01-01 07:00:00.000000000 +0700
+++ glibc/debian/debhelper.in/libc-second-dev.install 2009-01-05 06:22:26.000000000 +0600
@@ -0,0 +1,22 @@
+debian/tmp-libc-second/usr/lib/libanl.a usr/lib
+debian/tmp-libc-second/usr/lib/libBrokenLocale.a usr/lib
+debian/tmp-libc-second/usr/lib/libbsd-compat.a usr/lib
+debian/tmp-libc-second/usr/lib/libc.a usr/lib
+debian/tmp-libc-second/usr/lib/libc_nonshared.a usr/lib
+debian/tmp-libc-second/usr/lib/libcrypt.a usr/lib
+debian/tmp-libc-second/usr/lib/libdl.a usr/lib
+debian/tmp-libc-second/usr/lib/libg.a usr/lib
+debian/tmp-libc-second/usr/lib/libieee.a usr/lib
+debian/tmp-libc-second/usr/lib/libm.a usr/lib
+debian/tmp-libc-second/usr/lib/libmcheck.a usr/lib
+debian/tmp-libc-second/usr/lib/libnsl.a usr/lib
+debian/tmp-libc-second/usr/lib/libpthread.a usr/lib
+debian/tmp-libc-second/usr/lib/libpthread_nonshared.a usr/lib
+debian/tmp-libc-second/usr/lib/libresolv.a usr/lib
+debian/tmp-libc-second/usr/lib/librpcsvc.a usr/lib
+debian/tmp-libc-second/usr/lib/librt.a usr/lib
+debian/tmp-libc-second/usr/lib/libutil.a usr/lib
+
+debian/tmp-libc-second/usr/lib/*.o usr/lib
+debian/tmp-libc-second/usr/lib/*.so usr/lib
+debian/tmp-libc-second/usr/include/* usr/include
diff -bNur glibc.debbase/debian/debhelper.in/libc-second.install glibc/debian/debhelper.in/libc-second.install
--- glibc.debbase/debian/debhelper.in/libc-second.install 1970-01-01 07:00:00.000000000 +0700
+++ glibc/debian/debhelper.in/libc-second.install 2009-01-05 06:47:22.000000000 +0600
@@ -0,0 +1 @@
+debian/tmp-libc-second/lib/*.so* lib
diff -bNur glibc.debbase/debian/patches/any/local-install-second-libc.diff glibc/debian/patches/any/local-install-second-libc.diff
--- glibc.debbase/debian/patches/any/local-install-second-libc.diff 1970-01-01 07:00:00.000000000 +0700
+++ glibc/debian/patches/any/local-install-second-libc.diff 2009-01-05 03:53:22.000000000 +0600
@@ -0,0 +1,18 @@
+Index: glibc-2.7/Makerules
+===================================================================
+--- glibc-2.7/Makerules 2009-01-04 21:49:29.000000000 +0000
++++ glibc-2.7/Makerules 2009-01-04 21:51:14.000000000 +0000
+@@ -867,6 +867,13 @@
+ installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
+ $(inst_libdir)/$(patsubst %,$(libtype$o),\
+ $(libprefix)$(libc-name)))
++
++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
++ $(inst_slibdir)/libc-$(version).so \
++ $(inst_libdir)/libc.so \
++ $(inst_libdir)/libc.a \
++ install-lib
++
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ $(make-target-directory)
diff -bNur glibc.debbase/debian/patches/series glibc/debian/patches/series
--- glibc.debbase/debian/patches/series 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/patches/series 2009-01-05 03:52:39.000000000 +0600
@@ -228,3 +228,4 @@
#any/submitted-fileops-and-signals.diff
any/local-missing-linux_types.h.diff
any/submitted-user_h.diff -p1
+any/local-install-second-libc.diff
diff -bNur glibc.debbase/debian/rules glibc/debian/rules
--- glibc.debbase/debian/rules 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/rules 2009-01-05 06:26:57.000000000 +0600
@@ -88,20 +88,25 @@
mandir=$(prefix)/share/man
sbindir=$(prefix)/sbin
-BUILD_CC = gcc-4.3
-BUILD_CXX = g++-4.3
+BUILD_CC = gcc
+BUILD_CXX = g++
RUN_TESTSUITE = yes
TIMEOUTFACTOR = 1
-# Set CC and CXX for cross-compiling
-ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
-CC = $(DEB_HOST_GNU_TYPE)-gcc
-CXX = $(DEB_HOST_GNU_TYPE)-g++
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+ CC = $(BUILD_CC)
+ CXX = $(BUILD_CXX)
else
-CC = $(BUILD_CC)
-CXX = $(BUILD_CXX)
+# Set CC and CXX for cross-compiling
+ ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
+ CC = $(DEB_HOST_GNU_TYPE)-gcc
+ CXX = $(DEB_HOST_GNU_TYPE)-g++
+ else
+ CC = $(BUILD_CC)
+ CXX = $(BUILD_CXX)
+ endif
endif
BUILD_CFLAGS = -O2 -g
@@ -154,6 +159,21 @@
DEB_ARCH_REGULAR_PACKAGES += nscd
endif
+#
+# glibc bootstrap stuff
+#
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+ GLIBC_PASSES := libc-headers
+ DEB_ARCH_REGULAR_PACKAGES := $(libc)-dev-headers
+ DEB_INDEP_REGULAR_PACKAGES =
+ DEB_UDEB_PACKAGES =
+else ifeq ($(DEB_CROSS_BOOTSTRAP),second)
+ GLIBC_PASSES := libc-second
+ DEB_ARCH_REGULAR_PACKAGES := $(libc)-second $(libc)-second-dev
+ DEB_INDEP_REGULAR_PACKAGES =
+ DEB_UDEB_PACKAGES =
+endif
+
# And now the rules...
include debian/rules.d/*.mk
diff -bNur glibc.debbase/debian/rules.d/build.mk glibc/debian/rules.d/build.mk
--- glibc.debbase/debian/rules.d/build.mk 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/rules.d/build.mk 2009-01-05 05:52:38.000000000 +0600
@@ -11,6 +11,11 @@
(exec 3>&1; exit `( ( ( $(2) ) 2>&1 3>&-; echo $$? >&4) | tee $(1) >&3) 4>&1`)
endef
+ifeq ($(GLIBC_PASSES),libc-second)
+ install_target := install-lib-all
+else
+ install_target := install
+endif
$(patsubst %,mkbuilddir_%,$(GLIBC_PASSES)) :: mkbuilddir_% : $(stamp)mkbuilddir_%
$(stamp)mkbuilddir_%: $(stamp)patch-stamp $(KERNEL_HEADER_DIR)
@@ -72,6 +77,10 @@
CXX="$(call xx,CXX)" \
AUTOCONF=false \
MAKEINFO=: \
+ libc_cv_arm_tls=yes \
+ ac_cv_objext=o \
+ libc_cv_forced_unwind=yes \
+ libc_cv_c_cleanup=yes \
$(CURDIR)/$(DEB_SRCDIR)/configure \
--host=$(call xx,configure_target) \
--build=$$configure_build --prefix=/usr --without-cvs \
@@ -84,8 +93,10 @@
$(patsubst %,build_%,$(GLIBC_PASSES)) :: build_% : $(stamp)build_%
$(stamp)build_%: $(stamp)configure_%
@echo Building $(curpass)
- $(call logme, -a $(log_build), $(MAKE) -C $(DEB_BUILDDIR) $(NJOBS))
- $(call logme, -a $(log_build), echo "---------------" ; echo -n "Build ended: " ; date --rfc-2822)
+ if [ $(curpass) = libc ] || [ $(curpass) = libc-second ]; then \
+ $(call logme, -a $(log_build), $(MAKE) -C $(DEB_BUILDDIR) $(NJOBS)); \
+ $(call logme, -a $(log_build), echo "---------------" ; echo -n "Build ended: " ; date --rfc-2822); \
+ fi
if [ $(curpass) = libc ]; then \
$(MAKE) -C $(DEB_BUILDDIR) $(NJOBS) \
objdir=$(DEB_BUILDDIR) install_root=$(CURDIR)/build-tree/locales-all \
@@ -128,8 +139,49 @@
$(stamp)install_%: $(stamp)check_%
@echo Installing $(curpass)
rm -rf $(CURDIR)/debian/tmp-$(curpass)
+ mkdir -p $(DEB_BUILDDIR)/elf
+ if [ $(curpass) = libc-headers ]; then \
+ CC="$(call xx,CC)" \
+ $(MAKE) -C $(DEB_BUILDDIR) $(NJOBS) \
+ CC="$(call xx,CC)" \
+ $(DEB_BUILDDIR)/sysdeps/gnu/errlist.c 2>&1; \
+ mkdir -p $(DEB_BUILDDIR)/stdio-common; \
+ touch $(DEB_BUILDDIR)/stdio-common/errlist-compat.c; \
+ mkdir $(DEB_BUILDDIR)/rpcsvc; \
+ touch $(DEB_BUILDDIR)/rpcsvc/bootparam.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/bootparam_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/key_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/klm_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/mount.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nfs_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nis_callback.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nis.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nislib.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nis_tags.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/nlm_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/rex.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/rquota.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/rstat.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/rusers.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/sm_inter.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/spray.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/ypclnt.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/yp.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/yppasswd.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/yp_prot.h; \
+ touch $(DEB_BUILDDIR)/rpcsvc/ypupd.h; \
+ else \
$(MAKE) -C $(DEB_BUILDDIR) \
- install_root=$(CURDIR)/debian/tmp-$(curpass) install
+ install_root=$(CURDIR)/debian/tmp-$(curpass) $(install_target); \
+ fi
+
+ # Install headers no matter what
+ $(MAKE) -C $(DEB_BUILDDIR) $(NJOBS) \
+ CC="$(call xx,CC)" \
+ install_root=$(CURDIR)/debian/tmp-$(curpass) prefix=/usr install-headers; \
+ cp $(DEB_SRCDIR)/include/gnu/stubs.h $(CURDIR)/debian/tmp-$(curpass)/usr/include/gnu; \
+ cp $(DEB_BUILDDIR)/bits/stdio_lim.h $(CURDIR)/debian/tmp-$(curpass)/usr/include/bits; \
+ cp $(DEB_BUILDDIR)/misc/syscall-list.h $(CURDIR)/debian/tmp-$(curpass)/usr/include/bits/syscall.h
# Generate the list of SUPPORTED locales
if [ $(curpass) = libc ]; then \
diff -bNur glibc.debbase/debian/rules.d/debhelper.mk glibc/debian/rules.d/debhelper.mk
--- glibc.debbase/debian/rules.d/debhelper.mk 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/rules.d/debhelper.mk 2009-01-05 01:51:00.000000000 +0600
@@ -148,7 +148,7 @@
touch $@
-OPT_PASSES = $(filter-out libc, $(GLIBC_PASSES))
+OPT_PASSES = $(filter-out libc libc-second, $(GLIBC_PASSES))
OPT_DIRS = $(foreach pass,$(OPT_PASSES),$($(pass)_slibdir) $($(pass)_libdir))
debhelper: $(stamp)debhelper
diff -bNur glibc.debbase/debian/sysdeps/armel.mk glibc/debian/sysdeps/armel.mk
--- glibc.debbase/debian/sysdeps/armel.mk 2009-01-05 01:37:58.000000000 +0600
+++ glibc/debian/sysdeps/armel.mk 2009-01-05 01:59:32.000000000 +0600
@@ -1,7 +1,13 @@
libc_add-ons = ports nptl $(add-ons)
+libc-second_add-ons = $(libc_add-ons)
+libc-headers_add-ons = $(libc_add-ons)
# First kernel version that supports EABI
libc_MIN_KERNEL_SUPPORTED = 2.6.14
# Some tests assume a fast machine
TIMEOUTFACTOR=3
+
+# bootstrap needs this macro
+libc-headers_extra_cflags = -D__ARM_EABI__
+