public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* getting fatal error: asm/prctl.h: No such file or directory
@ 2019-10-11 18:50 Stephen Kirby
  2019-10-11 19:26 ` Carlos O'Donell
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Kirby @ 2019-10-11 18:50 UTC (permalink / raw)
  To: libc-help

Hi,

I'm trying to build a GCC cross-compiler, more specifically, I want to
compile on my x86_64-linux-gnu system and execute on Android ARM OS.

I'm following the recipe at
https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler

At step 2, from above, I built the Linux kernel headers, using linux-5.3, I
built with:
  %make ARCH=arm INSTALL_HDR_PATH=/home/me/android-29/arm-android-eabi
headers_install

Then step 3, built c,c++,fortran compilers using GCC-9.2.0 with:
 configure --prefix=/home/me/android-29 --target=arm-android-eabi
--enable-languages=c,c++,fortran --disable-multilib
 %make -j4 all-gcc
 %make install-gcc

All is fine to this point.

Step 4 - Build C library headers and startup files using glib-2.30
***This is the problem area***
I configure with:
 configure --prefix=/home/me/android-29/arm-android-eabi
--build=x86_64-linux-gnu --target=arm-android-eabi
--with-headers=/home/me/android-29/arm-android-eabi/include
--disable-multilib libc_cv_forced_unwind=yes

**NOTE HERE -- the author of this guide "Preshing" states that GLIBC
"requires" that "build", "host", and "target" must all be specified in the
configure step.  He further states that unlike other software packages, for
GLIBC, "both the --host and --target options are meant to describe the
system on which Glibc's libraries will ultimately run on."  (Is Preshing
correct on this?) However, when I specify --build=x86_64-linux-gnu
--host=arm-android-eabi and --target=arm-android-eabi in Glibc configure, I
get:

 "checking for systems preconfigure fragments... aarch64 alpha arm
configure: WARNING: arm/preconfigure: Did not find ARM architecture type;
using default.
csky hippo  i386 m68k microblaze mips nios2 powerpc ryscv s390  sh sparc
x86_64 configure: error: The GNU C Library is currently unavailable for
this platform."

I was able to circumvent this error by NOT specifying --host, but only
specifying --build=x86_64-linux-gnu and --target=arm-android-eabi.
However, not sure this is the proper solution here.
**Any ideas here as to whether what I have done here is reasonable?

I then run in my build-glibc directory,
 %make install-bootstrap-headers=yes install-headers
This ran ok.

However, the next command creates the error in the subject line:
%make -j4 csu/subdir_lib

This runs for a bit before saying:
../sysdeps/unix/sysv/linux/x86/include/asm/prctl.h:5:28: fatal error:
asm/prctl.h: No such file or directory #include_next <asm/prctl.h>

I welcome any and all suggestions as to where to go from here regarding
this error.

TIA,
Steve

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

* Re: getting fatal error: asm/prctl.h: No such file or directory
  2019-10-11 18:50 getting fatal error: asm/prctl.h: No such file or directory Stephen Kirby
@ 2019-10-11 19:26 ` Carlos O'Donell
  2019-10-11 23:32   ` Stephen Kirby
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos O'Donell @ 2019-10-11 19:26 UTC (permalink / raw)
  To: Stephen Kirby; +Cc: libc-help

On Fri, Oct 11, 2019 at 2:50 PM Stephen Kirby <thinjogger@gmail.com> wrote:

> I was able to circumvent this error by NOT specifying --host, but only
> specifying --build=x86_64-linux-gnu and --target=arm-android-eabi.
> However, not sure this is the proper solution here.
> **Any ideas here as to whether what I have done here is reasonable?

I don't think arm-android-eabi is a valid target triplet. I've always
use arm-linux-gnueabi, since you are targetting the linux kernel and
using the EABI (new ABI).

Likewise use arm-linux-gnueabihf for hard-float procedure call standard.

Cheers,
Carlos.

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

* Re: getting fatal error: asm/prctl.h: No such file or directory
  2019-10-11 19:26 ` Carlos O'Donell
@ 2019-10-11 23:32   ` Stephen Kirby
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Kirby @ 2019-10-11 23:32 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: libc-help

Thanks Carlos.  Changing the target to arm-linux-gnueabi got me past the
problems!

Now just need to start cross-compiling code...

Best,
Steve

On Fri, Oct 11, 2019 at 1:26 PM Carlos O'Donell <carlos@systemhalted.org>
wrote:

> On Fri, Oct 11, 2019 at 2:50 PM Stephen Kirby <thinjogger@gmail.com>
> wrote:
>
> > I was able to circumvent this error by NOT specifying --host, but only
> > specifying --build=x86_64-linux-gnu and --target=arm-android-eabi.
> > However, not sure this is the proper solution here.
> > **Any ideas here as to whether what I have done here is reasonable?
>
> I don't think arm-android-eabi is a valid target triplet. I've always
> use arm-linux-gnueabi, since you are targetting the linux kernel and
> using the EABI (new ABI).
>
> Likewise use arm-linux-gnueabihf for hard-float procedure call standard.
>
> Cheers,
> Carlos.
>

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

end of thread, other threads:[~2019-10-11 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 18:50 getting fatal error: asm/prctl.h: No such file or directory Stephen Kirby
2019-10-11 19:26 ` Carlos O'Donell
2019-10-11 23:32   ` Stephen Kirby

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).