Issue 306 in webp: Underlinking in libwebpmux (undefined reference to 'pow')

28 views
Skip to first unread message

floppyma… via monorail

unread,
Aug 14, 2016, 3:23:39 PM8/14/16
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 306 by floppyma...@gmail.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306

src/mux/anim_encode.c uses the pow(3) function from the C math library (libm). However, libwebpmux.la does not get linked against libm, leading to errors like the ones below.

../src/mux/.libs/libwebpmux.so: error: undefined reference to 'pow'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:523: webpmux] Error 1
make[1]: *** Waiting for unfinished jobs....
../src/mux/.libs/libwebpmux.so: error: undefined reference to 'pow'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:515: gif2webp] Error 1


I have attached a full build log.

Attachments:
media-libs:libwebp-0.5.1:20160814-190700.log 223 KB

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

pascal.m… via monorail

unread,
Aug 15, 2016, 12:41:31 PM8/15/16
to webp-d...@webmproject.org
Updates:
Status: Started

Comment #1 on issue 306 by pascal.m...@gmail.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c1

Thanks for the report!
Indeed, some binary seem to be missing a -lm library linking directive.
Let's see if this patch [1] fixes things...

[1] https://chromium-review.googlesource.com/370280

floppyma… via monorail

unread,
Aug 15, 2016, 12:45:36 PM8/15/16
to webp-d...@webmproject.org

Comment #2 on issue 306 by floppyma...@gmail.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c2

I think the proper fix would be to add -lm to libwebpmux_la_LDADD in master/src/mux/Makefile.am.

libwebpmux.so may be built/installed as a shared lib, and this would make sure the proper entry is added to DT_NEEDED.

floppyma… via monorail

unread,
Aug 15, 2016, 12:49:01 PM8/15/16
to webp-d...@webmproject.org

Comment #3 on issue 306 by floppyma...@gmail.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c3

Sorry, that should probably be libwebpmux_la_LIBADD, not LDADD.

jz… via monorail

unread,
Aug 16, 2016, 1:41:35 AM8/16/16
to webp-d...@webmproject.org
Updates:
Owner: jz...@google.com

Comment #4 on issue 306 by jz...@google.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c4

This is definitely a bug, but I wasn't able to reproduce it when building from source on a fresh gentoo install (using stage3-20160811 as the base), with the flags from the log. I seem to always end up with a -lm dependency reference in libwebpmux.la. Is there anything special about your setup?

floppyma… via monorail

unread,
Aug 16, 2016, 12:32:03 PM8/16/16
to webp-d...@webmproject.org

Comment #5 on issue 306 by floppyma...@gmail.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c5


> Is there anything special about your setup?

I currently have ld.gold set as the default linker; that may effect how the -Wl,--as-needed option gets processed.

bugdro… via monorail

unread,
Aug 17, 2016, 2:19:50 PM8/17/16
to webp-d...@webmproject.org

Comment #6 on issue 306 by bugd...@chromium.org: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c6

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/aaf2530cc38a69a46f0e612a281ddcbda566663a

commit aaf2530cc38a69a46f0e612a281ddcbda566663a
Author: James Zern
Date: Tue Aug 16 05:32:46 2016

{extras,mux}/Makefile.am: add missing -lm

+ libwebpmux.pc

quality_estimate.c, anim_encode.c rely on functions from math.h

BUG=webp:306

Change-Id: I3a8eb48febfd52bfbeb04f4dc615ccbed72926f7

[modify] https://crrev.com/aaf2530cc38a69a46f0e612a281ddcbda566663a/extras/Makefile.am
[modify] https://crrev.com/aaf2530cc38a69a46f0e612a281ddcbda566663a/src/mux/Makefile.am
[modify] https://crrev.com/aaf2530cc38a69a46f0e612a281ddcbda566663a/src/mux/libwebpmux.pc.in

jz… via monorail

unread,
Aug 17, 2016, 2:45:43 PM8/17/16
to webp-d...@webmproject.org
Updates:
Status: Fixed

Comment #7 on issue 306 by jz...@google.com: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c7

Within the discussion on the change it was determined that using the pre-generated configure from the 0.5.1 would produce the behavior. Rerunning ./autogen.sh would work around the issue. Due to some reorganization in the master branch the bug was hidden.
Thanks again for the report and helping with the repro.

bugdro… via monorail

unread,
Dec 9, 2016, 10:00:28 PM12/9/16
to webp-d...@webmproject.org
Updates:
Labels: merge-merged-0.5.2

Comment #8 on issue 306 by bugd...@chromium.org: Underlinking in libwebpmux (undefined reference to 'pow')
https://bugs.chromium.org/p/webp/issues/detail?id=306#c8


The following revision refers to this bug:

Author: James Zern
Date: Tue Aug 16 05:32:46 2016

mux/Makefile.am: add missing -lm

+ libwebpmux.pc

anim_encode.c relies on functions from math.h

BUG=webp:306

Change-Id: I3a8eb48febfd52bfbeb04f4dc615ccbed72926f7
(cherry picked from commit aaf2530cc38a69a46f0e612a281ddcbda566663a)

[modify] https://crrev.com/03f1c00877242ccc4765575bfa3ff9073b273fc2/src/mux/Makefile.am
[modify] https://crrev.com/03f1c00877242ccc4765575bfa3ff9073b273fc2/src/mux/libwebpmux.pc.in
Reply all
Reply to author
Forward
0 new messages