Staging changes
At OEDEM, there was basic agreement amongst the core devs that OE's current staging needs to evolve.
The aim of this evolution is to head towards a staging that looks like the target system. This allows using the sysroot options of gcc/binutils to help us remove hacks like the symlinks in cross and the sed "magic" in pkgconfig.bbclass. In the future is could also lead to a staging task which just copies files from ${WORKDIR}/image to staging, speeding up builds a lot (make install is slow) as well as giving much more possibilities to packaged staging.
I've had this working up to image generation with Poky. It does work and does lead to clean easier to understand build structures. I've pulled out a subset of my patches to Poky and checked them into OE. So far there are no behaviour changes, just several new variables become available to help us try and clean up the current staging references in the metadata.
An example of these cleanups are those I've made to gnome-common as a random example:
gnome-common_2.20.0.bb (working copy) renamed from gnome-common_2.20.0.bb (revision 2988) +1 -1
@@ -19,7 +19,7 @@ rm -rf ${STAGE_TEMP} mkdir -p ${STAGE_TEMP} make DESTDIR="${STAGE_TEMP}" install - cp -pPR ${STAGE_TEMP}${bindir}/* ${STAGING_DIR}/${BUILD_SYS}/bin + cp -pPR ${STAGE_TEMP}${bindir}/* ${STAGING_BINDIR_NATIVE} install -d ${STAGING_DATADIR}/gnome-common install -d ${STAGING_DATADIR}/aclocal cp -pPR ${STAGE_TEMP}${datadir}/gnome-common/* ${STAGING_DATADIR}/gnome-common
Why? This will break if we switch to /usr/bin...
The next step is to go through the metadata doing one of two things:
* correcting things where we have variables we can use
* listing problem areas (e.g. gcc configure options)
Bad references which can be grepped for are:
${STAGING_DIR}/${BUILD_SYS}
${STAGING_DIR}/${HOST_SYS}
${STAGING_LIBDIR}/.. (anything with a .. in is likely to cause problems) ${STAGING_DIR}
Python and Perl look like they're going to need special attention.
As an idea of where this leads, see my the attached patch to Poky which gets it as far as generating images. It does not correct all the entries that need fixing though.
As my attached patch hints, ultimately, we'll have access to variables like ${STAGING_DIR_TARGET}${layout_libdir}. I've not introduced them into OE yet but I could be tempted to, mirroring the staging layout so the switchover will be one simple set of changes to bitbake.conf.
Cheers,
Richard
bitbake.conf (working copy) renamed from bitbake.conf (revision 3015) +63 -32
130 lines not on this page · raw message
base.bbclass (working copy) renamed from base.bbclass (revision 3018) +2 -2
@@ -684,8 +684,8 @@ : } -do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/bin ${STAGING_DIR_TARGET}/lib \ - ${STAGING_DIR_TARGET}/include \ +do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${layout_bindir} ${STAGING_DIR_TARGET}/${layout_libdir} \ + ${STAGING_DIR_TARGET}/${layout_includedir} \ ${STAGING_BINDIR_NATIVE} ${STAGING_LIBDIR_NATIVE} \ ${STAGING_INCDIR_NATIVE} \ ${STAGING_DATADIR} \
native.bbclass (working copy) renamed from native.bbclass (revision 3018) +20 -26
60 lines not on this page · raw message
shasum/shasum-native.bb (working copy) renamed from shasum/shasum-native.bb (revision 2988) +1 -0
@@ -7,5 +7,6 @@ do_fetch[depends] = "" do_populate_staging() { + install -d ${STAGING_BINDIR} install ${S}/oe_sha256sum ${STAGING_BINDIR} }
dbus/dbus-glib_0.74.bb (working copy) renamed from dbus/dbus-glib_0.74.bb (revision 2988) +2 -2
@@ -15,8 +15,8 @@ FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool" do_configure_prepend() { - install -m 0644 ${STAGING_DIR}/${BUILD_SYS}/share/dbus/dbus-bus-introspect.xml ${S}/tools/ - install -m 0644 ${STAGING_DIR}/${BUILD_SYS}/share/dbus/dbus-glib-bindings.h ${S}/tools/ + install -m 0644 ${STAGING_DIR_NATIVE}${layout_datadir}/dbus/dbus-bus-introspect.xml ${S}/tools/ + install -m 0644 ${STAGING_DIR_NATIVE}${layout_datadir}/dbus/dbus-glib-bindings.h ${S}/tools/ } do_stage () {
binutils/binutils-cross.inc (working copy) renamed from binutils/binutils-cross.inc (revision 2988) +1 -1
@@ -3,7 +3,7 @@ DEPENDS += "flex-native bison-native" PROVIDES = "virtual/${TARGET_PREFIX}binutils" PACKAGES = "" -EXTRA_OECONF = "--with-sysroot=${CROSS_DIR}/${TARGET_SYS} \ +EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \ --program-prefix=${TARGET_PREFIX}" do_stage () {
fontconfig/fontconfig_2.4.2.bb (working copy) renamed from fontconfig/fontconfig_2.4.2.bb (revision 2988) +1 -1
@@ -44,7 +44,7 @@ for i in ${S}/fontconfig/*.h; do install -m 0644 $i ${STAGING_INCDIR}/fontconfig/; done } -BUILD_CFLAGS += " -I${STAGING_DIR}/${BUILD_SYS}/include/freetype2" +BUILD_CFLAGS += " -I${STAGING_DIR_NATIVE}${layout_includedir}/freetype2" do_configure_append () { sed -i 's|LDFLAGS =.*|LDFLAGS =|' fc-case/Makefile
glibc/glibc_2.5.bb (working copy) renamed from glibc/glibc_2.5.bb (revision 2988) +7 -7
@@ -152,10 +152,10 @@ } do_stage() { - rm -f ${STAGING_LIBDIR}/libc.so.6 - oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \ - 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \ - '${STAGING_LIBDIR}/libc.so.6' \ + rm -f ${STAGING_DIR_HOST}/${layout_base_libdir}/libc.so.6 + oe_runmake 'install_root=${STAGING_DIR_HOST}' \ + 'includedir=${layout_includedir}' 'libdir=${layout_libdir}' 'slibdir=${layout_base_libdir}' \ + '${STAGING_DIR_HOST}${layout_base_libdir}/libc.so.6' \ install-headers install-lib install -d ${STAGING_INCDIR}/gnu \
@@ -169,10 +169,10 @@ install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/ done for i in libc.a libc_pic.a libc_nonshared.a; do - install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i" + install -m 0644 ${B}/$i ${STAGING_DIR_HOST}/${layout_base_libdir} || die "failed to install $i" done - echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so - echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so + echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_base_libdir}/libpthread.so + echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_base_libdir}/libc.so } require glibc-package.bbclass
qemu/qemu-native_20070613.bb (working copy) renamed from qemu/qemu-native_20070613.bb (revision 2988) +0 -1
@@ -1,6 +1,5 @@ require qemu_${PV}.bb inherit native DEPENDS = "zlib-native" -prefix = "${STAGING_DIR}/${BUILD_SYS}" require qemu-gcc3-check.inc
db/db_4.2.52.bb (working copy) renamed from db/db_4.2.52.bb (revision 2988) +1 -1
@@ -71,7 +71,7 @@ CONFIG_SITE = "" do_configure() { rm -f ${S}/config.sub - cp ${STAGING_DIR}/${BUILD_SYS}/share/gnu-config/config.sub ${S}/config.sub + cp ${STAGING_DIR_NATIVE}/${layout_datadir}/gnu-config/config.sub ${S}/config.sub oe_runconf }
gcc/gcc-cross_4.1.2.bb (working copy) renamed from gcc/gcc-cross_4.1.2.bb (revision 2988) +1 -1
@@ -15,6 +15,6 @@ # cross packaging require gcc-package-cross.inc -SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 " +#SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 " EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR}/${BUILD_SYS}"
gcc/gcc3-build-cross.inc (working copy) renamed from gcc/gcc3-build-cross.inc (revision 2988) +4 -2
@@ -1,7 +1,9 @@ USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' -EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR}/${TARGET_SYS} \ - --with-gxx-include-dir=${STAGING_DIR}/${TARGET_SYS}/include/c++" +EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR_TARGET} \ + --with-gxx-include-dir=${STAGING_DIR}/${TARGET_SYS}/include/c++ \ + --with-sysroot=${STAGING_DIR_TARGET} \ + --with-build-sysroot=${STAGING_DIR_TARGET}" do_configure_prepend () { rm -f ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/libgcc_eh.a
Quoted 8 lines · Richard Purdie
The next step is to go through the metadata doing one of two things:
* correcting things where we have variables we can use
* listing problem areas (e.g. gcc configure options)Bad references which can be grepped for are:
${STAGING_DIR}/${BUILD_SYS}
As an update, I've now dealt with all of the above references in OE.dev.
Quoted 1 line
${STAGING_DIR}/${HOST_SYS}
~116 of these which probably really should mostly be:
${STAGING_DIR_HOST}${layout_exec_prefix}
(or ${STAGING_DIR_HOST}${layout_prefix} if its a prefix etc. but exec_prefix is most likely if its specifying where to find a library)
Quoted 1 line
${STAGING_LIBDIR}/.. (anything with a .. in is likely to cause problems)
~179 references of ${STAGING_*}/.. to check, most of which should probably be "${STAGING_DIR_HOST}${layout_exec_prefix}"
${STAGING_DIR}/${TARGET_SYS} (~90 references) can become "$(STAGING_DIR_TARGET}${layout_exec_prefix}"
or
${STAGING_DIR}/${TARGET_SYS}/lib
becomes
${STAGING_DIR_TARGET}/${layout_libdir}
(as used in LDFLAGS)
Quoted 1 line
${STAGING_DIR}
No point in looking at this until the above is done but it should have very few direct users when we're finished.
In case anyone doesn't understand the point of this, it means when we change ${layout_libdir} from "/lib" to "/usr/lib", in theory nothing breaks :).
Cheers,
Richard
Quoted 40 lines · Richard Purdie
At OEDEM, there was basic agreement amongst the core devs that OE's current staging needs to evolve.
The aim of this evolution is to head towards a staging that looks like the target system. This allows using the sysroot options of gcc/binutils to help us remove hacks like the symlinks in cross and the sed "magic" in pkgconfig.bbclass. In the future is could also lead to a staging task which just copies files from ${WORKDIR}/image to staging, speeding up builds a lot (make install is slow) as well as giving much more possibilities to packaged staging.
I've had this working up to image generation with Poky. It does work and does lead to clean easier to understand build structures. I've pulled out a subset of my patches to Poky and checked them into OE. So far there are no behaviour changes, just several new variables become available to help us try and clean up the current staging references in the metadata.
An example of these cleanups are those I've made to gnome-common as a random example:
gnome-common_2.20.0.bb (working copy) renamed from gnome-common_2.20.0.bb (revision 2988) +1
-1@@ -19,7 +19,7 @@ rm -rf ${STAGE_TEMP} mkdir -p ${STAGE_TEMP} make DESTDIR="${STAGE_TEMP}" install - cp -pPR ${STAGE_TEMP}${bindir}/* ${STAGING_DIR}/${BUILD_SYS}/bin + cp -pPR ${STAGE_TEMP}${bindir}/* ${STAGING_BINDIR_NATIVE} install -d ${STAGING_DATADIR}/gnome-common install -d ${STAGING_DATADIR}/aclocal cp -pPR ${STAGE_TEMP}${datadir}/gnome-common/* ${STAGING_DATADIR}/gnome-commonWhy? This will break if we switch to
/usr/bin...The next step is to go through the metadata doing one of two things:
* correcting things where we have variables we can use
* listing problem areas (e.g. gcc configure options)
Quoted 8 lines
Bad references which can be grepped for are:
${STAGING_DIR}/${BUILD_SYS}
${STAGING_DIR}/${HOST_SYS}
${STAGING_LIBDIR}/.. (anything with a .. in is likely to cause problems) ${STAGING_DIR}Python and Perl look like they're going to need special attention.
Right. Basically you have broken everything distutils with some of these patches :D
Regards,
:M:
Signature · 1 line
Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de