Skip to contentSkip to conversation

cross.bbclass: Override STAGING_* paths to match cross installation

PATCH In review Khem Raj 2 participants 5 messages Aug 9, 2010 – Aug 10, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 cross.bbclass: Override STAGING_* paths to match cross installation

---
 classes/cross.bbclass |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
classes/cross.bbclass +8 -0
index cf14db1..64f7902 100644
@@ -50,6 +50,14 @@ exec_prefix = "${prefix}"
 base_sbindir = "${base_prefix}/bin"
 sbindir = "${exec_prefix}/bin"
 
+# staging should be special for cross
+STAGING_BINDIR = "${bindir}"
+STAGING_LIBDIR = "${libdir}"
+STAGING_INCDIR = "${includedir}"
+STAGING_ETCDIR = "${sysconfdir}"
+STAGING_DATADIR = "${datadir}"
+STAGING_SBINDIR = "${sbindir}"
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 }
Signature · 1 line
1.7.1
#1 lore raw

Hi Khem,

Quoted 14 lines · Khem Raj
---
 classes/cross.bbclass |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
classes/cross.bbclass +1 -0
index cf14db1..64f7902 100644
@@ -50,6 +50,14 @@ exec_prefix = "${prefix}"
 base_sbindir = "${base_prefix}/bin"
 sbindir = "${exec_prefix}/bin"
 
+# staging should be special for cross

classes/cross.bbclass exec_prefix = "${prefix}" · line 63

Quoted 10 lines
classes/cross.bbclass +7 -0
+STAGING_BINDIR = "${bindir}"
+STAGING_LIBDIR = "${libdir}"
+STAGING_INCDIR = "${includedir}"
+STAGING_ETCDIR = "${sysconfdir}"
+STAGING_DATADIR = "${datadir}"
+STAGING_SBINDIR = "${sbindir}"
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 }

Can you explain a bit more about why is this needed?

Cheers,

Richard

author
#2 lore raw
Quoted 16 lines · Richard Purdie

Hi Khem,

Quoted 13 lines · Khem Raj

---
 classes/cross.bbclass |    8 ++++++++

 1 files changed, 8 insertions(+), 0 deletions(-)
classes/cross.bbclass +0 -0
index cf14db1..64f7902 100644
@@ -50,6 +50,14 @@ exec_prefix = "${prefix}"

 base_sbindir = "${base_prefix}/bin"
 sbindir = "${exec_prefix}/bin"

Quoted 13 lines
Quoted 11 lines
classes/cross.bbclass +8 -0
+# staging should be special for cross
+STAGING_BINDIR = "${bindir}"
+STAGING_LIBDIR = "${libdir}"
+STAGING_INCDIR = "${includedir}"
+STAGING_ETCDIR = "${sysconfdir}"
+STAGING_DATADIR = "${datadir}"
+STAGING_SBINDIR = "${sbindir}"
+

 do_install () {
      oe_runmake 'DESTDIR=${D}' install
 }

Can you explain a bit more about why is this needed?

yes. for cross packages prefix is set in cross.bbclass to be ${base_prefix}${prefix_native}/${BASE_PACKAGE_ARCH}
which already points into native sysroot and bindir, datadir etc are defined based on prefix in bitbake.conf so
for cross packages datadir already points to where it is in the final install location of the cross packages.

but STAGING_* dirs are then defined like below

STAGING_DIR_HOST = "${STAGING_DIR}/${BASEPKG_HOST_SYS}" STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"

where
STAGING_DIR_HOST expands to <native sysroot> in the case of cross packages because for them BASEPKG_HOST_SYS
is the build system itself. I think this is a the reason why we have NATIVE_STAGING_* vars defined separately.
probably we should have the same set defined for cross too may be something like CROSS_STAGING_* is one solution.

and now all these STAGING_* defines create another native sysroot
directory insise the existing one.
so I get /scratch/oe/sysroot/x86_64-linux/scrarch/oe/sysroot/x86_64-linux/usr/armv5te/shared/ etc. paths while
building binutils-cross

because STAGING_* variables are used in autotools.bbclass

Thats why this patch

Thanks
-Khem

Quoted 11 lines

Cheers,

Richard

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#3 lore raw
Quoted 57 lines · Khem Raj
Quoted 16 lines · Richard Purdie

Hi Khem,

Quoted 13 lines · Khem Raj
---
 classes/cross.bbclass |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
classes/cross.bbclass +0 -0
index cf14db1..64f7902 100644
@@ -50,6 +50,14 @@ exec_prefix = "${prefix}"
 base_sbindir = "${base_prefix}/bin"
 sbindir = "${exec_prefix}/bin"
 
Quoted 13 lines

classes/cross.bbclass exec_prefix = "${prefix}" · line 63

Quoted 11 lines
classes/cross.bbclass +8 -0
+# staging should be special for cross
+STAGING_BINDIR = "${bindir}"
+STAGING_LIBDIR = "${libdir}"
+STAGING_INCDIR = "${includedir}"
+STAGING_ETCDIR = "${sysconfdir}"
+STAGING_DATADIR = "${datadir}"
+STAGING_SBINDIR = "${sbindir}"
+
 do_install () {
      oe_runmake 'DESTDIR=${D}' install
 }

Can you explain a bit more about why is this needed?

yes. for cross packages prefix is set in cross.bbclass to be ${base_prefix}${prefix_native}/${BASE_PACKAGE_ARCH}
which already points into native sysroot and bindir, datadir etc are defined based on prefix in bitbake.conf so
for cross packages datadir already points to where it is in the final install location of the cross packages.

but STAGING_* dirs are then defined like below

STAGING_DIR_HOST = "${STAGING_DIR}/${BASEPKG_HOST_SYS}" STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"

where
STAGING_DIR_HOST expands to <native sysroot> in the case of cross packages because for them BASEPKG_HOST_SYS
is the build system itself. I think this is a the reason why we have NATIVE_STAGING_* vars defined separately.
probably we should have the same set defined for cross too may be something like CROSS_STAGING_* is one solution.

and now all these STAGING_* defines create another native sysroot
directory insise the existing one.
so I get /scratch/oe/sysroot/x86_64-linux/scrarch/oe/sysroot/x86_64-linux/usr/armv5te/shared/ etc. paths while
building binutils-cross

Quoted 3 lines

because STAGING_* variables are used in autotools.bbclass

Thats why this patch

So the problem is empty directory creation?

I'm tempted to suggest a more radical approach of not having all these directories created by autotools.bbclass...

Cheers,

Richard

author
#4 lore raw
Quoted 58 lines · Richard Purdie
Quoted 57 lines · Khem Raj
Quoted 16 lines · Richard Purdie

Hi Khem,

Quoted 13 lines · Khem Raj

---
 classes/cross.bbclass |    8 ++++++++

 1 files changed, 8 insertions(+), 0 deletions(-)
classes/cross.bbclass +0 -0
index cf14db1..64f7902 100644
@@ -50,6 +50,14 @@ exec_prefix = "${prefix}"

 base_sbindir = "${base_prefix}/bin"
 sbindir = "${exec_prefix}/bin"

Quoted 13 lines
Quoted 11 lines
classes/cross.bbclass +8 -0
+# staging should be special for cross
+STAGING_BINDIR = "${bindir}"
+STAGING_LIBDIR = "${libdir}"
+STAGING_INCDIR = "${includedir}"
+STAGING_ETCDIR = "${sysconfdir}"
+STAGING_DATADIR = "${datadir}"
+STAGING_SBINDIR = "${sbindir}"
+

 do_install () {
      oe_runmake 'DESTDIR=${D}' install
 }

Can you explain a bit more about why is this needed?

yes. for cross packages prefix is set in cross.bbclass to be ${base_prefix}${prefix_native}/${BASE_PACKAGE_ARCH}
which already points into native sysroot and bindir, datadir etc are defined based on prefix in bitbake.conf so
for cross packages datadir already points to where it is in the final install location of the cross packages.

but STAGING_* dirs are then defined like below

STAGING_DIR_HOST = "${STAGING_DIR}/${BASEPKG_HOST_SYS}" STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"

where
STAGING_DIR_HOST expands to <native sysroot> in the case of cross packages because for them BASEPKG_HOST_SYS
is the build system itself. I think this is a the reason why we have NATIVE_STAGING_* vars defined separately.
probably we should have the same set defined for cross too may be something like CROSS_STAGING_* is one solution.

and now all these STAGING_* defines create another native sysroot
directory insise the existing one.
so I get /scratch/oe/sysroot/x86_64-linux/scrarch/oe/sysroot/x86_64-linux/usr/armv5te/shared/ etc. paths while
building binutils-cross

Quoted 5 lines
Quoted 3 lines

because STAGING_* variables are used in autotools.bbclass

Thats why this patch

So the problem is empty directory creation?

yes.

Quoted 3 lines

I'm tempted to suggest a more radical approach of not having all these directories created by autotools.bbclass...

thats a good idea I can look into it.

yeah this patch actually will need another patch in crosssdk.bbclass. Actually STAGING_DIR is a bit confusing when it comes to cross and sdk packages.

May be we should have STAGING_DIR_{CROSS|NATIVE|SDK|NATIVESDK|TARGET} all defined and used appropriately. right now the STAGING_DIR_HOST and these various STAGING_DIR_* defines get it very confusing.

Quoted 13 lines

Cheers,

Richard

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel