1 enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
2 * increase ulimit for open files: macOS default of 256 is too low for glibc build system
3 * use host version of ar, which is given by environment variable
4 * build system uses stamp.os and stamp.oS files, which only differ in case;
5 this fails on macOS, so replace .oS with .o_S
6 --- glibc-2.32/Makefile.in 2018-02-01 17:17:18.000000000 +0100
7 +++ glibc-2.32/Makefile.in 2020-12-27 18:21:30.000000000 +0100
9 .PHONY: all install bench
12 - $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
14 + $(MAKE) -r AR=$$AR PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
18 LC_ALL=C; export LC_ALL; \
19 $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
21 --- glibc-2.32/Makerules 2018-02-01 17:17:18.000000000 +0100
22 +++ glibc-2.32/Makerules 2020-12-27 18:21:30.000000000 +0100
26 # Create the stamp$o files to keep the parent makefile happy.
27 -subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
28 -$(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o):
29 +subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o))
30 +$(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o)):
31 $(make-target-directory)
35 # The parent will then actually add them all to the archive in the
36 # archive rule, below.
37 define o-iterator-doit
38 -$(objpfx)stamp$o: $(o-objects); $$(do-stamp)
39 +$(objpfx)stamp$(subst .oS,.o_S,$o): $(o-objects); $$(do-stamp)
42 $(make-target-directory)
44 # on the stamp files built above.
45 define o-iterator-doit
46 $(common-objpfx)$(patsubst %,$(libtype$o),c): \
47 - $(subdirs-stamp-o) $(common-objpfx)stamp$o; $$(do-makelib)
48 + $(subdirs-stamp-o) $(common-objpfx)stamp$(subst .oS,.o_S,$o); $$(do-makelib)
51 cd $(common-objdir) && \
52 $(AR) $(CREATE_ARFLAGS) $(@F) `cat $(patsubst $(common-objpfx)%,%,$^)`
54 subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%)
55 -subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
56 +subdirs-stamp-o = $(subst %,$(subst .oS,.o_S,$o),$(subdirs-stamps))
58 $(subdirs-stamps): subdir_lib;
61 # This makes all the object files.
62 .PHONY: objects objs libobjs extra-objs
63 objects objs: libobjs extra-objs
64 -libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
65 +libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o))
66 extra-objs: $(addprefix $(objpfx),$(extra-objs))
68 # Canned sequence for building an extra library archive.
72 $(foreach o,$(object-suffixes-for-libc),
73 --rm -f $(objpfx)stamp$o $(o-objects))
74 +-rm -f $(objpfx)stamp$(subst .oS,.o_S,$o) $(o-objects))
77 # Also remove the dependencies and generated source files.