Opened 3 years ago

Last modified 2 years ago

#18706 needs_information defect

tor-0.2.8.2-alpha, undefined symbolo "signbit" when compiling for Solaris10

Reported by: RainerSchmidt Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.8.2-alpha
Severity: Normal Keywords: undefined symbolo signbit regression solaris needs-patch
Cc: relays2me@… Actual Points:
Parent ID: Points: small
Reviewer: Sponsor:

Description

I am trying to compile tor-0.2.8.2-alpha under Solaris 10 with gcc and I'm getting an" Undefined symbol error" for "signbit" in src/common/libor.a(util.o)

In file included from ./src/common/torint.h:14,

from ./src/common/crypto.h:17,
from src/or/torcert.c:11:

./orconfig.h:686:1: warning: "_FILE_OFFSET_BITS" redefined
In file included from /usr/include/stdio.h:21,

from ./src/common/crypto.h:16,
from src/or/torcert.c:11:

/usr/include/sys/feature_tests.h:187:1: warning: this is the location of the previous definition

CC src/or/src_or_libtor_testing_a-onion_ntor.o
AR src/or/libtor-testing.a
CC src/or/tor_main.o
CCLD src/or/tor

gcc: unrecognized option `-rdynamic'
Undefined first referenced

symbol in file

signbit src/common/libor.a(util.o)
ld: fatal: symbol referencing errors. No output written to src/or/tor
collect2: ld returned 1 exit status
gmake[1]: * [src/or/tor] Error 1
gmake[1]: Leaving directory `/usr/local/lib/tor-0.2.8.2-alpha'
gmake:
* [all] Error 2

I had no issues compiling and running tor-0.2.7.6 on this system.

Any help is appreciated.

Thanks.

Regards
Rainer

Child Tickets

Change History (8)

comment:1 Changed 3 years ago by nickm

Component: - Select a componentTor
Keywords: regression added
Points: small

Hmmm. The only place we're assuming a global signbit is clamp_double_to_int64() in util.c, which is new in 0.2.8.1-alpha.

Can you tell whether Solaris10 has a signbit() function and we are somehow not linking against the library that has it, or whether Solaris10 is missing signbit and we'll have to define our own?

comment:2 Changed 3 years ago by RainerSchmidt

Solaris10 has a signbit(), see included man page.
But I found some comments via google that the implementation is wrong, search for:
signbit solaris

Thanks.
Rainer

man page for signbit:


Mathematical Library Functions signbit(3M)

NAME

signbit - test sign

SYNOPSIS

c99 [ flag... ] file... -lm [ library... ]#include <math.h>

int signbit(real-floating x);

DESCRIPTION

The signbit() macro determines whether the sign of its argu-ment value is negative. NaNs, zeros, and infinities have asign bit.

RETURN VALUES

The signbit() macro returns a non-zero value if and only ifthe sign of its argument value is negative.

ERRORS

No errors are defined.

ATTRIBUTES

See attributes(5) for descriptions of the following attri-butes:

| ATTRIBUTE TYPE | ATTRIBUTE VALUE |

|_|_

Interface Stability | Standard _|_ MT-Level | MT-Safe _|_|

SEE ALSO

fpclassify(3M), isfinite(3M), isinf(3M), isnan(3M),isnormal(3M), math.h(3HEAD), attributes(5), standards(5)

SunOS 5.10 Last change: 12 Jul 2006

comment:3 in reply to:  1 Changed 3 years ago by yawning

Replying to nickm:

Can you tell whether Solaris10 has a signbit() function and we are somehow not linking against the library that has it, or whether Solaris10 is missing signbit and we'll have to define our own?

As far as I can tell from searching the intertubes, certain versions of GCC on Slowlaris ship a version of signbit() that causes aliasing warnings. That said, per the man page, including math.h should be enough (since it's by definition macro), and we also link with the math library...

What version of GCC are you using?

comment:4 Changed 3 years ago by RainerSchmidt

Thanks, your answer helped.
I did use gcc 3.4.6 (yes, pretty old)
After installing gcc 5.2.0 the issue with the signbit() is gone and I could compile tor.
But now I'm getting a core dump short after starting tor.

I went back to tor-0.2.7.6 and recompiled with gcc 5.2.0 to see if this could be the reason, but the tor-0.2.7.6 binary compiled with gcc 5.2.0 runs fine.

I will investigate a bit more tomorrow and add the config and compile logs and a truss output of the tor process (should I open a new ticket for this?)

Thanks.

Regards
Rainer

comment:5 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-final

comment:6 Changed 3 years ago by nickm

Status: newneeds_information

comment:7 Changed 2 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: unspecified

comment:8 Changed 2 years ago by nickm

Keywords: solaris needs-patch added
Note: See TracTickets for help on using tickets.