Opened 6 years ago

Closed 6 years ago

#11426 closed defect (fixed)

Can't compile, endian.h not part of SunOS / Solaris

Reported by: Rainer Owned by:
Priority: High Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version: Tor: 0.2.5.3-alpha
Severity: Keywords: tor-client 025-triaged
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I can't compile tor-0.2.5.3-alpha on SunOS / Solaris 5.10 anymore because Solaris
does not have a header file "endian.h", which is now required in "src/ext/csiphash.c"

This issue was not with tor-0.2.5.2-alpha.
Can this be fixed?

gmake
gmake all-am
gmake[1]: Entering directory `/usr/local/lib/tor-0.2.5.3-alpha'

CC src/common/address.oCC src/common/backtrace.oCC src/common/compat.oCC src/common/container.oCC src/common/di_ops.oCC src/common/log.oCC src/common/memarea.oCC src/common/mempool.oCC src/common/procmon.o

src/common/procmon.c: In function `tor_process_monitor_poll_cb':
src/common/procmon.c:327: warning: int format, pid_t arg (arg 4)

CC src/common/util.o

src/common/util.c: In function `tor_get_exit_code':
src/common/util.c:4127: warning: int format, pid_t arg (arg 5)
src/common/util.c:4133: warning: int format, pid_t arg (arg 5)

CC src/common/util_codedigest.oCC src/common/sandbox.oCC src/ext/csiphash.o

src/ext/csiphash.c:55:24: endian.h: No such file or directory
src/ext/csiphash.c: In function `siphash24':
src/ext/csiphash.c:106: warning: implicit declaration of function `le64toh'
gmake[1]: * [src/ext/csiphash.o] Error 1
gmake[1]: Leaving directory `/usr/local/lib/tor-0.2.5.3-alpha'
gmake:
* [all] Error 2

Child Tickets

Attachments (1)

endian.diff (436 bytes) - added by nickm 6 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by Sebastian

I don't have a Solaris box to test, but can you try changing the line
"# include <endian.h>"
to
"# include <sys/isa_defs.h>"

and recompile? If that works I can cook up a proper patch.

comment:2 Changed 6 years ago by yawning

Solaris uses a different set of macros IIRC.

https://github.com/Yawning/tor/commit/0d078c38d1d522480e197ef783c0a40120df0f05

*Should* work.

comment:3 Changed 6 years ago by arma

Milestone: Tor: 0.2.5.x-final

comment:4 Changed 6 years ago by nickm

Looking at sys/byteorder.h from opensolaris... couldn't you just make that patch be...

+#elif defined(sun) || defined(__sun)
+#  include <sys/byteorder.h>
+#  define _le64toh(x) LE_64(x)

?

(Attaching untested patch; it's also my branch "bug11426".)

Changed 6 years ago by nickm

Attachment: endian.diff added

comment:5 Changed 6 years ago by nickm

Keywords: tor-client 025-triaged added
Priority: normalmajor
Status: newneeds_review

Rainer, could you let me know if the "endian.diff" patch above makes it work for you?

comment:6 Changed 6 years ago by Rainer

Hi nickm, the patch you provided did it, I now have tor-0.2.5.3-alpha up and running on Solaris 5.10
Thanks.
Rainer

comment:7 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Great; I've merged the patch to master so it can go into 0.2.5.4-alpha. Thanks for testing it!

Note: See TracTickets for help on using tickets.