Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1526 closed defect (fixed)

Tor build fails with zlib 1.2.5 on MacOS X

Reported by: sjmurdoch Owned by: nickm
Priority: Medium Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tor fails to build after I upgraded zlib to 1.2.5. The error is:

gcc -DHAVE_CONFIG_H -I. -I../..   -I../../src/common -I/opt/local/include             -I/Users/sjm217/local/include -I/Users/sjm217/local/include  -g -O2 -Wall -g -O2 -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 --param ssp-buffer-size=1 -Wshorten-64-to-32 -MT torgzip.o -MD -MP -MF .deps/torgzip.Tpo -c -o torgzip.o torgzip.c
In file included from /opt/local/include/zlib.h:34,
                 from torgzip.c:19:
/opt/local/include/zconf.h:373:6: error: "_LARGEFILE64_SOURCE" is not defined
In file included from torgzip.c:19:
/opt/local/include/zlib.h:1574:32: error: "_FILE_OFFSET_BITS" is not defined
lude/zlib.h:1574:32: error: "_FILE_OFFSET_BITS" is not defined

If _LARGEFILE64_SOURCE is defined, there is a different error:

gcc -DHAVE_CONFIG_H -I. -I../..   -I../../src/common -I/opt/local/include             -I/Users/sjm217/local/include -I/Users/sjm217/local/include  -D_LARGEFILE64_SOURCE -Wall -g -O2 -fno-strict-aliasing -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1 --param ssp-buffer-size=1 -Wshorten-64-to-32 -MT torgzip.o -MD -MP -MF .deps/torgzip.Tpo -c -o torgzip.o torgzip.c
In file included from /opt/local/include/zlib.h:34,
                 from torgzip.c:19:
/opt/local/include/zconf.h:397:37: error: "_LFS64_LARGEFILE" is not defined
In file included from torgzip.c:19:
/opt/local/include/zlib.h:1565:37: error: "_LFS64_LARGEFILE" is not defined
/opt/local/include/zlib.h:1574:32: error: "_FILE_OFFSET_BITS" is not defined

This is on MacOS X Snow Leopard, using the MacPorts version of zlib. I am trying to build Tor master (faf51fa), with some small modifications which shouldn't have affected anything.

Child Tickets

Change History (8)

comment:1 Changed 9 years ago by sjmurdoch

MacPorts had a similar (same?) problem with zlib 1.2.4, and patched it; see https://trac.macports.org/ticket/24067

They removed this patch with zlib 1.2.5, because this version of zlib fixed the problem, but clearly it didn't fix it for Tor.

comment:2 Changed 9 years ago by nickm

For a possible fix, see branch "bug1526" in my public repository. It is against maint-0.2.1, but should merge cleanly into master as well.

comment:3 Changed 9 years ago by Sebastian

That branch doesn't fix the issue for 1.2.4, but it does fix it for 1.2.5. Adding this line right before the include of zlib.h in torgzip.c fixes the issue, though:

#define off64_t int64_t

comment:4 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-final
Owner: set to nickm
Status: newassigned

Please try revised branch bug1526-v2 ? It adds the line that sebastian says worked for him.

[closed bug #1355 as a duplicate of this one.]

comment:5 Changed 9 years ago by sjmurdoch

The patch from bug1526-v2 works for me (zlib 1.2.5 on MacOS X). Thanks

comment:6 Changed 9 years ago by nickm

Sebastian, does it work for you with 1.2.4 ?

comment:7 Changed 9 years ago by nickm

Resolution: fixed
Status: assignedclosed

merged.

comment:8 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.