This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cross build problems


Attempting to build an x86_32 toolchain to run on x86_64 using
these (old) instructions:

  https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/

There is a build problem when installing the glibc headers in step
4.  The command

  $ make -j4 csu/subdir_lib

Terminates with an error:

  make  subdir=csu -C csu ..=../ subdir_lib
  ...
  /usr/bin/install: missing destination file operand after '<path>/tmp/gcc-cross/build/build-glibc/cmathT'
  Try '/usr/bin/install --help' for more information.

This is actually triggered by these rules in Makerules:

  $(common-objpfx)cstdlib: $(c++-cstdlib-header)
	$(INSTALL_DATA) $< $@T || true
	$(move-if-change) $@T $@ || true
  $(common-objpfx)cmath: $(c++-cmath-header)
	$(INSTALL_DATA) $< $@T
	$(move-if-change) $@T $@

because the variables c++-cstdlib-header and c++-cmath-header are
empty.  These are initialized from CXX_CMATH_HEADER and
CXX_CSTDLIB_HEADER from configure:

  # Obtain some C++ header file paths.  This is used to make a local
  # 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}"
    }
    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
    CXX_CMATH_HEADER="$(find_cxx_header cmath)"
    CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
  fi

From config.log:

  CXX_CMATH_HEADER=''
  CXX_CSTDLIB_HEADER=''

It's not really surprising that configure cannot find the cross
headers, because there is no cross toolchain installed yet?

How can this be fixed?  Possibly the cross build instructions are
out of date, but I couldn't find better instructions anywhere.

--

Involved versions:

  glibc-2.30
  binutils-2.33.1
  gcc-9.2.0 or gccc-8.3.0 (doesn't matter)
  linux-4.1.13 (kernel headers of the target system)
  (latest versions of gmp, isl, mpc, mpfr, cloog for gcc)

Target/Host/Build system values used:

  binutils: --target=i686-linux-gnu
  kernel: ARCH=x86
  gcc: --target=i686-linux-gnu
  glibc: --build=x86_64 --host=i686-linux-gnu --target=i686-linux-gnu

--

(See attached build script for details.  To reproduce, unpack the
various tarballs to ./cross/src and strip the version numbers from
the directory names.  Symlink the libraries needed by gcc in its
source directory, then run the script with

  $ cd cross
  $ build.sh \
      build_installdir build_binutils install_binutils \
      check_binutils install_linux build_gcc install_gcc \
      heck_gcc install_glibc_headers

The args of the script call are just function names in the script
body, starting at line 151.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt

Attachment: build.sh
Description: Bourne shell script


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]