Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 226897 - media-gfx/xv: append-ldflags is used to pass libraries
Summary: media-gfx/xv: append-ldflags is used to pass libraries
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Joe Peterson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: append-ldflags-libs
  Show dependency tree
 
Reported: 2008-06-14 18:15 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2008-06-16 15:28 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-06-14 18:15:12 UTC
I've made append-ldflags throw a warning when libraries are passed through it
to link them in.

The reason is that LDFLAGS should _not_ be used for libraries, as it has to be
positioned before the list of objects to link together, while libraries should
go after.

This mistake in commandline is what causes as-needed to either fail or not
apply at all (if LDFLAGS are put at the end).

Please fix your package not to pass libraries through LDFLAGS.
Comment 1 Joe Peterson (RETIRED) gentoo-dev 2008-06-14 18:30:30 UTC
Do you mean this patched line in the Makefile?:

LIBS = $(TIFFLIB) $(JPEGLIB) $(PNGLIB) $(ZLIBLIB) $(JP2KLIB) -L/usr/X11R6/lib -lX11 -lm $(LDFLAGS)

Are you suggesting not putting $(LDFLAGS) in LIBS, but rather putting it on the subsequent lines after $(LIBS) instead?

If not, please let me know what you are thinking.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-06-14 18:34:40 UTC
The command link for link should be

$(LD) $(LDFLAGS) -o $@ $< $(LIBS)

so yeah putting $(LDFLAGS) inside and after $(LIBS) is an error.
As is using append-ldflags to pass further libraries to link.
Comment 3 Joe Peterson (RETIRED) gentoo-dev 2008-06-14 19:59:25 UTC
Currently, the Makefile uses $(CC) for linking and compiling.  I have gotten rid of the append-ldflags stuff now.  Any reason not to now do?:

	emake	CC="$(tc-getCC)" CCOPTS="${CFLAGS} ${LDFLAGS}" \
			PREFIX=/usr \
			DOCDIR=/usr/share/doc/${PF} \
			LIBDIR="${T}" || die

(i.e. combine non-modified ${LDFLAGS} and ${CFLAGS} together?)  Anything else will be a lot more altering of the Makefile.
Comment 4 Joe Peterson (RETIRED) gentoo-dev 2008-06-16 15:28:07 UTC
Fixed by putting libs in $(LIBS) and adding $(LDFLAGS) to link lines.  Makefile patch to add LDFLAGS sent upstream.