From 268c2bc6781affc73e2d1335632f4cf95f092f45 Mon Sep 17 00:00:00 2001 From: "Koenig, Joerg" Date: Fri, 25 Aug 2023 12:31:12 +0200 Subject: More fixes Change-Id: Idba344fb506b92e066c5aa228427d76b79681ec3 --- Makefile | 19 +++++++++++-------- Patches/001-glibc-find_cxx_header.patch | 13 +++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 Patches/001-glibc-find_cxx_header.patch diff --git a/Makefile b/Makefile index e2ddbcd..da0b6e3 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ INSTALLPATH = $(TOP)/1_INST/crossarm-$(SUITE) SYSROOT = $(INSTALLPATH)/sysroot PATCHESPATH = $(TOP)/Patches -all: dirstruct download +all: dirstruct download build build: \ binutils \ @@ -28,7 +28,7 @@ dirstruct: mkdir -p $(BUILDPATH) mkdir -p $(INSTALLPATH) mkdir -p $(SOURCEPATH) - sudo apt-get install texinfo + #sudo apt-get install texinfo download: \ $(SOURCEPATH)/glibc-$(VERSION_GLIBC).tar.bz2 \ @@ -76,8 +76,8 @@ $(SOURCEPATH)/isl-$(VERSION_ISL).tar.bz2: prepare: cd $(BUILDPATH)/gcc.src && \ patch -p1 < $(PATCHESPATH)/0002-Relocate-libintl.patch && \ - patch -p1 < $(PATCHESPATH)/0010-Fix-using-large-PCH.patch && \ - patch -p1 < $(PATCHESPATH)/0025-gcc11_1_0_quick_exit.patch + patch -p1 < $(PATCHESPATH)/0010-Fix-using-large-PCH.patch && \ + patch -p1 < $(PATCHESPATH)/0025-gcc11_1_0_quick_exit.patch tar -jxf $(SOURCEPATH)/gdb-$(VERSION_GDB).tar.bz2 -C $(BUILDPATH)/ tar -jxf $(SOURCEPATH)/binutils-$(VERSION_BINUTILS).tar.bz2 -C $(BUILDPATH)/ @@ -143,16 +143,19 @@ cross-glibc: cd $(BUILDPATH) && rm -Rf libc-$(VERSION_GLIBC) && \ tar -jxf $(SOURCEPATH)/glibc-$(VERSION_GLIBC).tar.bz2 cd $(BUILDPATH)/glibc-$(VERSION_GLIBC) && \ - patch -p1 < $(PATCHESPATH)/001-glibc_multiple_defs_of__nss__database.patch + patch -p1 < $(PATCHESPATH)/001-glibc_multiple_defs_of__nss__database.patch && \ + patch -p0 < $(PATCHESPATH)/001-glibc-find_cxx_header.patch rm -Rf $(BUILDPATH)/glibc && mkdir -p $(BUILDPATH)/glibc export PATH=$(INSTALLPATH)/bin:$(PATH) && \ cd $(BUILDPATH)/glibc && \ CFLAGS="-O2 -DBOOTSTRAP_GCC" \ $(BUILDPATH)/glibc-$(VERSION_GLIBC)/configure \ - --prefix=$(INSTALLPATH) \ - --with-gnu-ld --with-gnu-as \ - libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes \ + libc_cv_forced_unwind=yes \ + libc_cv_c_cleanup=yes \ libc_cv_gnu89_inline=yes \ + --prefix=$(INSTALLPATH) \ + --with-gnu-ld \ + --with-gnu-as \ --build=x86_64-linux-gnu \ --host=$(TARGET_TRIPLET) \ --target=$(TARGET_TRIPLET) \ diff --git a/Patches/001-glibc-find_cxx_header.patch b/Patches/001-glibc-find_cxx_header.patch new file mode 100644 index 0000000..c249f39 --- /dev/null +++ b/Patches/001-glibc-find_cxx_header.patch @@ -0,0 +1,13 @@ +--- configure.orig 2023-08-25 09:55:52.854100261 +0200 ++++ configure 2023-08-25 09:56:50.124055106 +0200 +@@ -5308,8 +5308,8 @@ + # copy of those headers in Makerules. + if test -n "$CXX"; then + find_cxx_header () { +- echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \ +- | sed -n "\,$1:,{s/:\$//;p}" ++ echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \ ++ | $AWK '$1 == "."{print $2}' + } + CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)" + CXX_CMATH_HEADER="$(find_cxx_header cmath)" -- cgit v0.12