Cross Compiling GLIBC fro x86_64 from aarch64 Missing asm/prctl.h

989 Views Asked by At

I'm Attempting to do Linux From Scratch on aarch64 compiling for amd64, Everything is going smooth until I got this error running make -j1 for GLIBC Chapter 5.5 I've tried everything and I couldn't find any similar errors online.

In file included from ../sysdeps/x86_64/nptl/tls.h:23,
                 from ../include/link.h:51,
                 from <stdin>:1:
../sysdeps/unix/sysv/linux/x86/include/asm/prctl.h:5:15: fatal error: asm/prctl.h: No such file or directory
    5 | #include_next <asm/prctl.h>
      |               ^~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
  File "/mnt/lfs/sources/glibc-2.35/csu/../scripts/gen-as-const.py", line 120, in <module>
    main()
  File "/mnt/lfs/sources/glibc-2.35/csu/../scripts/gen-as-const.py", line 116, in main
    consts = glibcextract.compute_c_consts(sym_data, args.cc)
  File "/mnt/lfs/sources/glibc-2.35/scripts/glibcextract.py", line 62, in compute_c_consts
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'x86_64-lfs-linux-gnu-gcc -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wstrict-proto>
make[2]: *** [../Makerules:271: /mnt/lfs/sources/glibc-2.35/build/rtld-sizes.h] Error 1
make[1]: *** [Makefile:483: csu/subdir_lib] Error 2
make: *** [Makefile:9: all] Error 2
1

There are 1 best solutions below

0
nemborkar On

In your build folder, try using a minimal configure followed by a make command with the -j flag (this will use all available threads and you don't need to specify a number),

../configure --prefix=/opt/glibc-2.35
make -j
sudo make install

Although I would recommend extreme precaution as there is a high chance of messing up your kernel, when changing GLIBC files