Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 335951 - net-analyzer/nsat does not respect LDFLAGS
Summary: net-analyzer/nsat does not respect LDFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Netmon Herd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ldflags
  Show dependency tree
 
Reported: 2010-09-04 16:46 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2012-10-06 19:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (nsat-1.5:20100904-112529.log,74.28 KB, text/plain)
2010-09-04 16:46 UTC, Diego Elio Pettenò (RETIRED)
Details
respects LDFLAGS, some cleanups to ebuild, added sedd die statements (nsat-1.5.ebuild.patch,1.74 KB, patch)
2010-09-04 18:03 UTC, Ross Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-04 16:46:12 UTC
See attached build log.

(Please do not complain about the need for looking at the build log until you can provide an easy way to open bugs with the correct data picked out of a tinderbox log. Thanks.)
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-04 16:46:30 UTC
Created attachment 245971 [details]
Build log
Comment 2 Ross Smith 2010-09-04 18:03:14 UTC
Created attachment 246020 [details, diff]
respects LDFLAGS, some cleanups to ebuild, added sedd die statements
Comment 3 Jeroen Roovers gentoo-dev 2010-09-06 21:59:42 UTC
(In reply to comment #2)
> Created an attachment (id=246020) [details]
> respects LDFLAGS, some cleanups to ebuild, added sedd die statements

-KEYWORDS="~ppc sparc x86"
+KEYWORDS="~ppc sparc x86 amd64"

You're leaving stable keywords and adding a stable keyword - they should all be ~arch in the revision bump.

 src_unpack() {
 	unpack ${A}
 	cd "${S}"
-	cp -va configure.in{,.orig}
+}

Removing the (useless, granted) cp, that leaves src_unpack() redundant as well, so that should be removed entirely.

-	make|| die "compile problem"
+	emake|| die "compile problem"

This is good, but creates another problem, namely:

 * QA Notice: make jobserver unavailable:
 * 
 *      make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.

Oh, and all the patching should go into src_prepare(), not src_configure().

And after all that, it still doesn't respect LDFLAGS:

 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/bin/nsat
 * /usr/bin/smb-ns

And it calls cc instead of the canonical toolchain quadruplet:
make -j2
make[1]: Entering directory `/var/tmp/portage/net-analyzer/nsat-1.5/work/nsat/src'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[2]: Entering directory `/var/tmp/portage/net-analyzer/nsat-1.5/work/nsat/src/smb'
compiling ADM smb scanner... !!! JeR-QA: /keeps/gentoo/cc-qa-check/cc was called
In file included from ./client.c:73:
./ADMsmb.c: In function ‘ADMsmb’:
./ADMsmb.c:126: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in sign
edness                                                            
/usr/include/bits/socket2.h:65: note: expected ‘socklen_t * __restrict__’ but argument is of type ‘int *’
!!! JeR-QA: /keeps/gentoo/cc-qa-check/cc was called
!!! JeR-QA: /keeps/gentoo/cc-qa-check/cc was called
[...]

And later on, it disrespects CFLAGS again:
i686-pc-linux-gnu-g++ -Wall -O6 -funroll-loops -ansi -fPIC -DLINUX -DWITH_XPROBE -c progress.cpp
i686-pc-linux-gnu-g++ -Wall -O6 -funroll-loops -ansi -fPIC -DLINUX -DWITH_XPROBE -c AuditSet.cpp
Comment 4 Jeroen Roovers gentoo-dev 2010-09-06 22:02:09 UTC
Oh, all the disrespect problems seem to arise from the fact that all the actual changes were in src_configure(), run after src_prepare().
Comment 5 Jeroen Roovers gentoo-dev 2010-09-06 22:32:53 UTC
I have to say the entire build system (configure.in, Makefile.in in most subdirectories) is really horrible.

Lines like this:

    @$(CC) $(CFLAGS) -c $(srcdir)$*.c -o $(srcdir)$*.o

really make my stomach churn. And the way our CFLAGS get mangled a couple of times over is really horrible. Why does src/smb/Makefile end up adding

FLAGS1 = -O3

to CFLAGS? It doesn't end up getting used because we override it, but just, why?

And this:
CFLAGS1 = $(FLAGS1) -DSMBLOGFILE=\"$(SMBLOGFILE)\" -DNMBLOGFILE=\"$(NMBLOGFILE)\"
CFLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" -DWEB_ROOT=\"$(WEB_ROOT)\"
CFLAGS3 = -DLOCKDIR=\"$(LOCKDIR)\" -DSMBRUN=\"$(SMBRUN)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\"
CFLAGS4 = -DWORKGROUP=\"$(WORKGROUP)\" -DGUEST_ACCOUNT=\"$(GUESTACCOUNT)\" -DDRIVERFILE=\"$(DRIVERFILE)\"
CFLAGS5 = $(CFLAGS1) $(CFLAGS2) $(CFLAGS3) $(CFLAGS4) $(FLAGSM) $(AFS_FLAGS) $(KRB5_FLAGS) $(KRB4_FLAGS) $(RPM_OPT_FLAGS)
CFLAGS  = $(CFLAGS5) $(PAM_FLAGS) $(DCE_FLAGS) $(DES_FLAGS) $(PASSWD_FLAGS) $(VTP_FLAGS)

wtf? I am nearly ready to give up. :)
Comment 6 Sergey Popov gentoo-dev Security 2012-09-26 07:30:02 UTC
net-analyzer/nsat-1.5-r1 now has some portion of fixes, introduced here, except fixes for LDFLAGS
Comment 7 Sergey Popov gentoo-dev Security 2012-10-06 19:00:56 UTC
+  06 Oct 2012; Sergey Popov <pinkbyte@gentoo.org> nsat-1.5-r1.ebuild:
+  Respect LDFLAGS wrt bug #335951

I close this bug as FIXED, but there is some more things that need to do with this nsat's ugly build system :-/