public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* make install fail on cross-compile
@ 2020-06-10  7:49 Paul
  2020-06-11 11:52 ` Adhemerval Zanella
  0 siblings, 1 reply; 3+ messages in thread
From: Paul @ 2020-06-10  7:49 UTC (permalink / raw)
  To: libc-help

Building on x86_64-pc-linux-gnu for a cross-compile and
target machine is also x86_64-pc-linux-gnu (but a later
kernel).

Configured with

  cd glibc-build
  ../glibc-2.31/configure --prefix=~/glibc-out ... 
--host=x86_64-pc-linux-gnu --enable-kernel=5.4.45

Make runs fine but hits a problem with make install:

  FATAL: kernel too old
  Makefile:115: recipe for target 'install-symbolic-link' failed
  make[1]: *** [install-symbolic-link] Aborted (core dumped)

My build kernel is only 4.15.0 but that shouldn't matter, seems
that configure decided I was not doing a cross-compile,
apparently because the build and host system types are the same.

config.log has:

  host='x86_64-pc-linux-gnu'
  build='x86_64-pc-linux-gnu'
  cross_compiling='no'

The relevant bit of the Makefile appears to be

  # Create links for shared libraries using the `ldconfig' program if 
possible.
  # Ignore the error if we cannot update /etc/ld.so.cache.
  ifeq (no,$(cross-compiling))
  ifeq (yes,$(build-shared))
  install: install-symbolic-link
  .PHONY: install-symbolic-link
  install-symbolic-link: subdir_install
          $(symbolic-link-prog) $(symbolic-link-list)
          rm -f $(symbolic-link-list)

The configure script:

  cross_compiling=no
  ...
  # FIXME: To remove some day.
  if test "x$host_alias" != x; then
    if test "x$build_alias" = x; then
      cross_compiling=maybe
    elif test "x$build_alias" != "x$host_alias"; then
      cross_compiling=yes
    fi
  fi

Well, if I configure and then edit config.make to change

  cross-compiling = no

to

  cross-compiling = yes

then make and make install runs fine and I get everything I
want in ~/glibc-out which I can then copy to my target
machine.

Is there a magic configure command line option to say that
I really want to cross-compile?

--
Paul Nicholson
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-14 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  7:49 make install fail on cross-compile Paul
2020-06-11 11:52 ` Adhemerval Zanella
2020-06-14 15:02   ` Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).