Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X build fails due to missing elf.h #8

Closed
FiloSottile opened this issue May 20, 2016 · 3 comments
Closed

OS X build fails due to missing elf.h #8

FiloSottile opened this issue May 20, 2016 · 3 comments

Comments

@FiloSottile
Copy link
Contributor

FiloSottile commented May 20, 2016

make[2]: Entering directory '/Users/filippo/build/musl-cross-make/linux-4.4.10'
make[3]: Entering directory '/Users/filippo/build/musl-cross-make/build-x86_64-linux-musl/obj_kernel_headers'
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  HOSTCC  scripts/basic/fixdep
  WRAP    arch/x86/include/generated/asm/clkdev.h
  WRAP    arch/x86/include/generated/asm/cputime.h
  WRAP    arch/x86/include/generated/asm/dma-contiguous.h
  WRAP    arch/x86/include/generated/asm/early_ioremap.h
  WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
  WRAP    arch/x86/include/generated/asm/mm-arch-hooks.h
  SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
  HOSTCC  arch/x86/tools/relocs_32.o
In file included from /Users/filippo/build/musl-cross-make/linux-4.4.10/arch/x86/tools/relocs_32.c:1:
/Users/filippo/build/musl-cross-make/linux-4.4.10/arch/x86/tools/relocs.h:12:10: fatal error: 'elf.h' file not found
#include <elf.h>
         ^
1 error generated.
scripts/Makefile.host:108: recipe for target 'arch/x86/tools/relocs_32.o' failed
make[4]: *** [arch/x86/tools/relocs_32.o] Error 1
arch/x86/Makefile:193: recipe for target 'archscripts' failed
make[3]: *** [archscripts] Error 2
make[3]: Leaving directory '/Users/filippo/build/musl-cross-make/build-x86_64-linux-musl/obj_kernel_headers'
Makefile:146: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
make[2]: Leaving directory '/Users/filippo/build/musl-cross-make/linux-4.4.10'
Makefile:196: recipe for target 'obj_kernel_headers/.lc_built' failed
make[1]: *** [obj_kernel_headers/.lc_built] Error 2
make[1]: Leaving directory '/Users/filippo/build/musl-cross-make/build-x86_64-linux-musl'
Makefile:152: recipe for target 'all' failed
make: *** [all] Error 2
TARGET = x86_64-linux-musl
OUTPUT = /usr/local/Cellar/musl-cross-make/HEAD
@richfelker
Copy link
Owner

I can't see why the tool that's failing is even being built for a headers_install target. This is probably a kernel bug (gratuitous dependencies in the makefile). Can you try one of the other supported kernel-header versions (see hashes dir for a list)? Or if you can find the cause of the wrong dependency we could perhaps add a patch to suppress it. Note that the breakage only happens on platforms without <elf.h>.

@FiloSottile
Copy link
Contributor Author

Found it. I'll make a patch. diorcety/crosstool-ng#11

BTW, ec0f9f1 mentions 3.x kernels, but in hashes I only see 2.6.

Also, building against 2.6 works.

@richfelker
Copy link
Owner

Do you know if this issue is still present in upstream kernel? I've added support for 4.19 headers and will be dropping the old 4.4 headers that this patch was applied to, because 4.4 headers are not compatible with time64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants