Skip to content

Commit

Permalink
Linux header install: Fix elf.h circular dependency
Browse files Browse the repository at this point in the history
For versions 3.10.19, 3.10.38, 3.10.62, 3.10.98, 3.12, 4.3.3 and 4.4.3

Fix from Arnaud Dovi:

diorcety/crosstool-ng#11

"
I think I have found the root cause of this elf.h issue

Its a circular dependency problem

  __headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
      $(Q)$(MAKE) $(build)=scripts build_unifdef

  PHONY += headers_install
  headers_install: __headers
      $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
        $(error Headers not exportable for the $(SRCARCH) architecture))
      $(Q)$(MAKE) $(hdr-inst)=include/uapi
      $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)

In short headers_install depends on archscripts but archscripts compiles a code
with a header elf.h installed by headers_install

Next once you fix this you will realize the headers are copied under linux\elf.h
of the sysroot when the code looks for elf.h
"

Signed-off-by: Ray Donnelly <[email protected]>
  • Loading branch information
mingwandroid committed Feb 18, 2021
1 parent d017813 commit 2fc6c68
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- linux-3.12.8/Makefile.orig 2014-01-16 00:31:56.000000000 +0100
+++ linux-3.12.8/Makefile 2014-01-20 00:03:25.961403100 +0100
@@ -906,7 +906,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- linux-3.12.8/Makefile.orig 2014-01-16 00:31:56.000000000 +0100
+++ linux-3.12.8/Makefile 2014-01-20 00:03:25.961403100 +0100
@@ -906,7 +906,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -urN linux-3.10.62.orig/Makefile linux-3.10.62/Makefile
--- linux-3.10.62.orig/Makefile 2015-03-04 21:58:38.370006100 +0000
+++ linux-3.10.62/Makefile 2015-03-04 22:07:00.111621000 +0000
@@ -905,7 +905,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -urN linux-3.10.62.orig/Makefile linux-3.10.62/Makefile
--- linux-3.10.62.orig/Makefile 2015-03-04 21:58:38.370006100 +0000
+++ linux-3.10.62/Makefile 2015-03-04 22:07:00.111621000 +0000
@@ -905,7 +905,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- linux-3.12.8/Makefile.orig 2014-01-16 00:31:56.000000000 +0100
+++ linux-3.12.8/Makefile 2014-01-20 00:03:25.961403100 +0100
@@ -906,7 +906,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- linux-3.12.8/Makefile.orig 2014-01-16 00:31:56.000000000 +0100
+++ linux-3.12.8/Makefile 2014-01-20 00:03:25.961403100 +0100
@@ -906,7 +906,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- linux-3.12.8/Makefile.orig 2014-01-16 00:31:56.000000000 +0100
+++ linux-3.12.8/Makefile 2014-01-20 00:03:25.961403100 +0100
@@ -906,7 +906,7 @@
archscripts:

PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders FORCE
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all

0 comments on commit 2fc6c68

Please sign in to comment.