| Summary: | Build for lsof broken in buildroot-2010.08 | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Andy Gibbs <andyg1001> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | buildroot |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
Error log
Proposed patch |
||
Created attachment 2641 [details]
Proposed patch
I've tried to build lsof today, but it fails because the FTP server rejects anonymous logins: --2010-11-04 16:28:39-- ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof//lsof_4.81.tar.bz2 => `/home/thomas/local/buildroot-dl/lsof_4.81.tar.bz2' Resolving lsof.itap.purdue.edu... 128.210.7.20 Connecting to lsof.itap.purdue.edu|128.210.7.20|:21... connected. Logging in as anonymous ... Error in server greeting. Retrying. Does it work for you ? If not, we should switch to using the tarball made available by Debian, as we do for some other packages. Moreover, I'm not terribly happy with the approach. If Buildroot passes some CFLAGS, it's done with reason, so those CFLAGS should be taken into account, not overriden by the package build logic. So rather than having the CFLAGS passed on the command line ignored, I'd prefer to see them *added* to the internal package CFLAGS. Thomas,
I do get it downloading, but it I believe it picks it up from the sources.buildroot.org mirror instead of the ftp site, so maybe best to change to the debian distribution site.
Regarding the use of CFLAGS, inside the Makefile is defined:
CFLAGS= ${CDEFS} ${INCL} ${DEP} ${DEBUG}
which expands to
CFLAGS= ${CDEF} ${CFGF} ${DINC} ${CFGD} ${CFGDN} ${DEBUG}
Now when make is invoked, buildroot's CFLAGS are passed via DEBUG:
$(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" -C $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src
However, if TARGET_CONFIGURE_OPTS also holds CFLAGS, then the CFLAGS declared inside the Makefile is overridden and all the additional flags that are required (e.g. from CFGF) are lost.
This is why I have patched it to put the "override" keyword ahead of the Makefile's CFLAGS declaration. Buildroot's CFLAGS are still sent forward, via DEBUG, so that's not a problem.
Does this explain the situation better?
Cheers
Andy
(In reply to comment #3) > Now when make is invoked, buildroot's CFLAGS are passed via DEBUG: > [ snip ] Sorry, I should probably just point out that this is the original behaviour for building the package, not something that I've changed in my patch. Perhaps this problem is the reason why the original package worked this way? Committed, thanks |
Created attachment 2635 [details] Error log The build process for the lsof package has been broken in buildroot-2010.08. In buildroot-2010.05 it was not broken. The attached build log file shows the error as it occurs. Note how the compiler options passed to make via CFGF, don't actually get passed to gcc, as should be the case. The problem has been tracked down to a change made in buildroot: specifically that it now includes CFLAGS="..." in TARGET_CONFIGURE_OPTS, whereas before this was not the case. However, the Configure script for lsof also generates its own CFLAGS declaration inside the Makefile, which is now overridden by that given by buildroot. Fortunately, lsof has a partial solution to this problem which is the LSOF_CFLAGS_OVERRIDE=1 configuration option. CFLAGS from buildroot is still then passed through Configure and incorporated into the CFLAGS declaration inside the Makefile, but then the Makefile declaration of CFLAGS can then be marked 'override' so that when calling make, it continues to build correctly. Unfortunately, the solution provided by lsof is only partial. The configuration option only applies to liblsof, not the application itself. Attached also is a patch file that fixes both this, plus adds the configuration option into the package's lsof.mk file.