klibc_2.0.2: fix hardcoded symlinks to linux-libc-headers
PATCH 1/1 klibc_2.0.2: fix hardcoded symlinks to linux-libc-headers
Klibc needs a copy of the linux headers for itself to build. On target the libs and a second copy of headers are installed as well:
we link relatively to the staging sysroot of the target to make these headers available when necessary.
--- .../recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch | 2 +- meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch +1 -1
@@ -14,7 +14,7 @@ Index: klibc-2.0~rc2/scripts/Kbuild.install $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install -+ $(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \ ++ $(Q)for x in ../../../usr/include/asm ../../../usr/include/asm-generic ../../../usr/include/linux ../../../usr/include/mtd; do \ + ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ + done $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch +1 -1
@@ -21,7 +21,7 @@ Index: klibc-1.5.24/scripts/Kbuild.install $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - $(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \ + $(Q)for x in ../../../usr/include/asm ../../../usr/include/asm-generic ../../../usr/include/linux ../../../usr/include/mtd; do \ ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ done @@ -103,7 +100,6 @@
Signature · 1 line
1.8.1.5
Sorry, patch is broken for distros like meta-micro, collapsing /usr into /
Thinking again about the symlinks, we have to respect the install location of the linux-libc-headers, installed as:
Quoted 1 line
oe_runmakeheaders_installINSTALL_HDR_PATH=${D}${exec_prefix} <
So we have to adapt to the case where exec_prefix is not like "/usr"
Revised version coming later today.
Cheers
Andrea
Quoted 40 lines · Andrea Adami
Klibc needs a copy of the linux headers for itself to build. On target the libs and a second copy of headers are installed as well:
we link relatively to the staging sysroot of the target to make these headers available when necessary.Signed-off-by Andrea Adami <[email protected]>--- .../recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch | 2 +- meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch +1
-1@@ -14,7 +14,7 @@ Index: klibc-2.0~rc2/scripts/Kbuild.install $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install -+ $(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \ ++ $(Q)for x in ../../../usr/include/asm ../../../usr/include/asm-generic ../../../usr/include/linux ../../../usr/include/mtd; do \ + ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ + done $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch +1
-2@@ -21,7 +21,7 @@ Index: klibc-1.5.24/scripts/Kbuild.install $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - $(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \ + $(Q)for x in ../../../usr/include/asm ../../../usr/include/asm-generic ../../../usr/include/linux ../../../usr/include/mtd; do \ ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ done @@ -103,7 +100,6 @@ --1.8.1.5