| Summary: | Doing a Buildroot build from /usr doesn't work | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | rdghx <rdghx> |
| Component: | Other | Assignee: | Thomas De Schampheleire <patrickdepinguin> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | antoine.pierlot-garcin, benstoltz, buildroot, patrickdepinguin |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | 2014.08 | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
config file
Patch file alternative patch |
||
For some complicated reason, using Buildroot in a directory stored under /usr doesn't work. We will work on fixing that, but in the mean time, please build from /home/something, /opt or anything else, but not from a subdirectory of /usr. *** Bug 5222 has been marked as a duplicate of this bug. *** *** Bug 5228 has been marked as a duplicate of this bug. *** *** Bug 6470 has been marked as a duplicate of this bug. *** *** Bug 7082 has been marked as a duplicate of this bug. *** During the 2014.02 stabilization cycle, I started looking into this bug. See some info here: http://lists.busybox.net/pipermail/buildroot/2014-February/089291.html After that I didn't continue further, yet, but my plan is to take this up again and hopefully close the bug by 2014.08. This fixes the problem for me. Ben Stoltz <benstoltz@gmail.com> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index a66ecd4..74c90dd 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -249,8 +249,12 @@ ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR) for i in $$$$(find $(STAGING_DIR)/usr/lib* -name "*.la"); do \ - cp -f $$$$i $$$$i~; \ - $$(SED) "s:\(['= ]\)/usr:\\1$(STAGING_DIR)/usr:g" $$$$i; \ + cp -n $$$$i $$$$i~; \ + $$(SED) "s,$(BASE_DIR),@BASE_DIR@,g" \ + -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" \ + -e "s,@STAGING_DIR@,$(STAGING_DIR),g" \ + -e "s,@BASE_DIR@,$(BASE_DIR),g" \ + $$$$i; \ done endef endif diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 1b99c2a..af3675a 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -195,9 +195,12 @@ $(BUILD_DIR)/%/.stamp_staging_installed: $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep)) $(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \ $(call MESSAGE,"Fixing package configuration files") ;\ - $(SED) "s,^\(exec_\)\?prefix=.*,\1prefix=$(STAGING_DIR)/usr,g" \ - -e "s,-I/usr/,-I$(STAGING_DIR)/usr/,g" \ - -e "s,-L/usr/,-L$(STAGING_DIR)/usr/,g" \ + $(SED) 's,$(BASE_DIR),@BASE_DIR@,g' \ + -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \ + -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" \ + -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" \ + -e 's,@STAGING_DIR@,$(STAGING_DIR),g' \ + -e 's,@BASE_DIR@,$(BASE_DIR),g' \ $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\ fi $(Q)touch $@ diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk index f3f6526..536c967 100644 --- a/package/pkgconf/pkgconf.mk +++ b/package/pkgconf/pkgconf.mk @@ -19,8 +19,10 @@ endef define HOST_PKGCONF_INSTALL_WRAPPER $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/usr/bin/pkg-config - $(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \ - -e 's,@STAGING_DIR@,$(STAGING_DIR),' \ + $(SED) 's,$(BASE_DIR),@BASE_DIR@,g' \ + -e 's,@PKG_CONFIG_LIBDIR@,@STAGING_DIR@/usr/lib/pkgconfig:@STAGING_DIR@/usr/share/pkgconfig,' \ + -e 's,@STAGING_DIR@,$(STAGING_DIR),g' \ + -e 's,@BASE_DIR@,$(BASE_DIR),g' \ $(HOST_DIR)/usr/bin/pkg-config endef (In reply to comment #7) > This fixes the problem for me. Thanks, I will definitely test this out! Created attachment 5384 [details]
Patch file
Cut and paste errors at end of line on previous submission.
(In reply to comment #8) > (In reply to comment #7) > > This fixes the problem for me. > > Thanks, I will definitely test this out! It seems that the result is similar to the patch I was using until now (attached). It works fine too, but if you grep in output/staging you will find still occurrences of /usr/path/to/buildroot/.../sysroot/usr/path/to/buildroot, caused by pkgconfig, as mentioned in http://lists.busybox.net/pipermail/buildroot/2014-February/089866.html. While this seems to do no harm, I intend to track down this issue further. Created attachment 5450 [details]
alternative patch
Patches fixing this issue submitted at: http://patchwork.ozlabs.org/patch/362322/ http://patchwork.ozlabs.org/patch/362324/ http://patchwork.ozlabs.org/patch/362323/ Slightly modified patches now accepted, so marking bug as fixed. See commits: http://git.buildroot.org/buildroot/commit/?id=7701fc53d19be7cab8bddba72046a39e8421fd9e http://git.buildroot.org/buildroot/commit/?id=9580c178e55b90c456096bb553f0cd0e26eff6a1 http://git.buildroot.org/buildroot/commit/?id=17eaa5d3ab1982a89c82e603484edbed8f712e16 Hooray for closing this very old bug! (In reply to comment #13) > Hooray for closing this very old bug! Yes, thanks a _lot_ for working on this problem! |
Created attachment 4670 [details] config file CC Sync.lo CC Synchro.lo CC Text16.lo CC Text.lo CC TextExt16.lo CC TextExt.lo CC TextToStr.lo CC TrCoords.lo CC UndefCurs.lo CC UngrabBut.lo CC UngrabKbd.lo CC UngrabKey.lo CC UngrabPtr.lo CC UngrabSvr.lo CC UninsCmap.lo CC UnldFont.lo CC UnmapSubs.lo CC UnmapWin.lo CC VisUtil.lo CC WarpPtr.lo CC Window.lo CC WinEvent.lo CC Withdraw.lo CC WMGeom.lo CC WMProps.lo CC WrBitF.lo CC xcb_disp.lo CC xcb_io.lo CC XlibAsync.lo CC XlibInt.lo CC Xrm.lo XlibInt.c: In function '_XPrintDefaultError': XlibInt.c:1433:5: warning: format not a string literal, argument types not checked XlibInt.c:1453:2: warning: format not a string literal, argument types not checked XlibInt.c:1485:6: warning: format not a string literal, argument types not checked XlibInt.c:1513:2: warning: format not a string literal, argument types not checked XlibInt.c:1519:5: warning: format not a string literal, argument types not checked XlibInt.c:1523:5: warning: format not a string literal, argument types not checked CC x11_xcb.lo CCLD libX11.la libtool: link: warning: library `/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libxcb.la' was moved. /bin/grep: /usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libXau.la: No such file or directory /bin/sed: can't read /usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libXau.la: No such file or directory libtool: link: `/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/work/buildroot/buildroot-2012.11/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libXau.la' is not a valid libtool archive make[4]: *** [libX11.la] Error 1 make[4]: Leaving directory `/usr/work/buildroot/buildroot-2012.11/output/build/xlib_libX11-1.4.2/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/usr/work/buildroot/buildroot-2012.11/output/build/xlib_libX11-1.4.2/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/work/buildroot/buildroot-2012.11/output/build/xlib_libX11-1.4.2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/work/buildroot/buildroot-2012.11/output/build/xlib_libX11-1.4.2' make: *** [/usr/work/buildroot/buildroot-2012.11/output/build/xlib_libX11-1.4.2/.stamp_built] Error 2