0011-eglibc-Help-bootstrap-cross-toolchain.patch 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. From 7f2fd574646cb5ecbbc09372a2d8580ab72ec158 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Wed, 18 Mar 2015 00:49:28 +0000
  4. Subject: [PATCH] eglibc: Help bootstrap cross toolchain
  5. Taken from EGLIBC, r1484 + r1525
  6. 2007-02-20 Jim Blandy <jimb@codesourcery.com>
  7. * Makefile (install-headers): Preserve old behavior: depend on
  8. $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers
  9. is set; otherwise, place gnu/stubs.h on the 'install-others' list.
  10. 2007-02-16 Jim Blandy <jimb@codesourcery.com>
  11. * Makefile: Amend make install-headers to install everything
  12. necessary for building a cross-compiler. Install gnu/stubs.h as
  13. part of 'install-headers', not 'install-others'.
  14. If install-bootstrap-headers is 'yes', install a dummy copy of
  15. gnu/stubs.h, instead of computing the real thing.
  16. * include/stubs-bootstrap.h: New file.
  17. Upstream-Status: Pending
  18. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  19. ---
  20. Makefile | 22 +++++++++++++++++++++-
  21. include/stubs-bootstrap.h | 12 ++++++++++++
  22. 2 files changed, 33 insertions(+), 1 deletion(-)
  23. create mode 100644 include/stubs-bootstrap.h
  24. diff --git a/Makefile b/Makefile
  25. index 179dd478ff..55cfb740bf 100644
  26. --- a/Makefile
  27. +++ b/Makefile
  28. @@ -79,9 +79,18 @@ subdir-dirs = include
  29. vpath %.h $(subdir-dirs)
  30. # What to install.
  31. -install-others = $(inst_includedir)/gnu/stubs.h
  32. install-bin-script =
  33. +# If we're bootstrapping, install a dummy gnu/stubs.h along with the
  34. +# other headers, so 'make install-headers' produces a useable include
  35. +# tree. Otherwise, install gnu/stubs.h later, after the rest of the
  36. +# build is done.
  37. +ifeq ($(install-bootstrap-headers),yes)
  38. +install-headers: $(inst_includedir)/gnu/stubs.h
  39. +else
  40. +install-others = $(inst_includedir)/gnu/stubs.h
  41. +endif
  42. +
  43. ifeq (yes,$(build-shared))
  44. headers += gnu/lib-names.h
  45. endif
  46. @@ -421,6 +430,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh
  47. subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
  48. +# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o
  49. +# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty
  50. +# gnu/stubs.h is good enough.
  51. +ifeq ($(install-bootstrap-headers),yes)
  52. +$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force)
  53. + $(make-target-directory)
  54. + $(INSTALL_DATA) $< $@
  55. +
  56. +installed-stubs =
  57. +else
  58. ifndef abi-variants
  59. installed-stubs = $(inst_includedir)/gnu/stubs.h
  60. else
  61. @@ -447,6 +466,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
  62. install-others-nosubdir: $(installed-stubs)
  63. endif
  64. +endif
  65. # Since stubs.h is never needed when building the library, we simplify the
  66. diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h
  67. new file mode 100644
  68. index 0000000000..1d2b669aff
  69. --- /dev/null
  70. +++ b/include/stubs-bootstrap.h
  71. @@ -0,0 +1,12 @@
  72. +/* Placeholder stubs.h file for bootstrapping.
  73. +
  74. + When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC
  75. + headers be installed, but we can't fully build EGLIBC without that
  76. + GCC. So we run the command:
  77. +
  78. + make install-headers install-bootstrap-headers=yes
  79. +
  80. + to install the headers GCC needs, but avoid building certain
  81. + difficult headers. The <gnu/stubs.h> header depends, via the
  82. + EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but
  83. + an empty stubs.h like this will do fine for GCC. */