Opened 7 years ago

Closed 7 years ago

#7235 closed defect (fixed)

tor-0.2.4.{2,3,4}: fails with undefined reference to libm functions in libor.a when --disable-upnp

Reported by: blueness Owned by:
Priority: Medium Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version: Tor: 0.2.4.5-alpha
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When ./configure --disable-upnp on a Gentoo system, the build fails with. This is easily fixed by linking tor-fw-helper to libm. I'll attach the patch to src/tools/tor-fw-helper/include.am in my next post.

CCLD src/tools/tor-resolve
CCLD src/tools/tor-fw-helper/tor-fw-helper

src/common/libor.a(util.o): In function `tor_lround':
util.c:(.text+0xf27): undefined reference to `ceil'
src/common/libor.a(util.o): In function `tor_llround':
util.c:(.text+0xf87): undefined reference to `ceil'
src/common/libor.a(util.o): In function `tor_mathlog':
util.c:(.text+0xee9): undefined reference to `log'
collect2: ld returned 1 exit status
make[1]: * [src/tools/tor-fw-helper/tor-fw-helper] Error 1
make[1]:
* Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/net-misc/tor-0.2.4.5_alpha/work/tor-0.2.4.5-alpha'
make: * [all] Error 2

The downstream bug is at

https://bugs.gentoo.org/show_bug.cgi?id=435040

Child Tickets

Attachments (2)

tor-0.2.4.5-fix-udef-ref-math.patch (1.4 KB) - added by blueness 7 years ago.
Improved patch
0001-Fix-undefined-reference-to-libm-functions-linking-to.patch (1.6 KB) - added by blueness 7 years ago.
Cleaned up patch using git format-patch

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by nickm

Status: newneeds_revision

Hm. I think we want to move the "-lm" out of miniupnpc_ldadd too so that we won't wind up giving two -lm instances on the same command line. And we should put it in src_tools_tor_fw_helper_tor_fw_helper_LDADD , not src_tools_tor_fw_helper_tor_fw_helper_LDFLAGS . (LDADD is for libraries; LDFLAGS is for library search paths and stuff.)

Changed 7 years ago by blueness

Improved patch

comment:2 in reply to:  1 Changed 7 years ago by blueness

Replying to nickm:

Hm. I think we want to move the "-lm" out of miniupnpc_ldadd too so that we won't wind up giving two -lm instances on the same command line. And we should put it in src_tools_tor_fw_helper_tor_fw_helper_LDADD , not src_tools_tor_fw_helper_tor_fw_helper_LDFLAGS . (LDADD is for libraries; LDFLAGS is for library search paths and stuff.)

Yeah, I see clearly now what's going on. The improved patch has been tested and works.

comment:3 Changed 7 years ago by nickm

Looks good; when I go to apply it, though, "git am" says "Patch format detection failed." What tool did you use to make this? "git format-patch" usually makes something that's easier to apply.

Changed 7 years ago by blueness

Cleaned up patch using git format-patch

comment:4 in reply to:  3 Changed 7 years ago by blueness

Replying to nickm:

Looks good; when I go to apply it, though, "git am" says "Patch format detection failed." What tool did you use to make this? "git format-patch" usually makes something that's easier to apply.

Its a home grown tool useful for patching in gentoo. I redid the patch against git HEAD. Sorry for the inconvenience.

comment:5 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_revisionclosed

Great; applied to git master. Thanks!

Note: See TracTickets for help on using tickets.