#2473 closed defect (invalid)

Error compiled nginx with '--with-zlib=zlib-ng-2.0.7'

Reported by: bullerdu@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.23.x
Keywords: zlib-ng Cc:
uname -a: Linux dev0.na61 4.19.91-008.x86_64 #1 SMP Fri Sep 4 17:33:26 CST 2020 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: ./configure --prefix=/home/yefei.dyf/nginx --with-zlib=/home/yefei.dyf/zlib-ng-2.0.7 --with-cc-opt=-I/home/yefei.dyf/boringssl/include --with-ld-opt='-L/home/yefei.dyf/boringssl/ssl -L/home/yefei.dyf/boringssl/crypto'

Description (last modified by bullerdu@…)

Test zlib-ng feature 'Gzip: support for zlib-ng.' https://hg.nginx.org/nginx/rev/1f3d0d9f893f

Downdload zlib-ng from https://github.com/zlib-ng/zlib-ng.

Then do configure ./configure --prefix=/home/yefei.dyf/nginx --with-zlib=/home/yefei.dyf/zlib-ng-2.0.7 --with-cc-opt=-I/home/yefei.dyf/boringssl/include --with-ld-opt='-L/home/yefei.dyf/boringssl/ssl -L/home/yefei.dyf/boringssl/crypto'

The compile error is as follows.

/built/gcc-6.5.1/gcc-6.5.1/bin/gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I/home/yefei.dyf/boringssl/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I /home/yefei.dyf/zlib-ng-2.0.7 -I objs -I src/http -I src/http/modules \
	-o objs/src/http/ngx_http_script.o \
	src/http/ngx_http_script.c
In file included from src/http/modules/ngx_http_log_module.c:13:0:
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:227:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘const’
 Z_EXTERN const char * Z_EXPORT zlibVersion(void);
          ^~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:257:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflate(z_stream *strm, int flush);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:370:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateEnd(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:407:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflate(z_stream *strm, int flush);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:527:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateEnd(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:617:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateSetDictionary(z_stream *strm,
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:661:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateGetDictionary (z_stream *strm, unsigned char *dictionary, unsigned int *dictLength);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:681:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateCopy(z_stream *dest, z_stream *source);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:698:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateReset(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:709:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateParams(z_stream *strm, int level, int strategy);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:745:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateTune(z_stream *strm, int good_length, int max_lazy, int nice_length, int max_chain);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:758:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT deflateBound(z_stream *strm, unsigned long sourceLen);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:772:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflatePending(z_stream *strm, uint32_t *pending, int *bits);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:785:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflatePrime(z_stream *strm, int bits, int value);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:800:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateSetHeader(z_stream *strm, gz_headerp head);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:877:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateSetDictionary(z_stream *strm, const unsigned char *dictionary, unsigned int dictLength);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:898:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateGetDictionary(z_stream *strm, unsigned char *dictionary, unsigned int *dictLength);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:911:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateSync(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:930:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateCopy(z_stream *dest, z_stream *source);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:945:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateReset(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:955:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateReset2(z_stream *strm, int windowBits);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:968:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflatePrime(z_stream *strm, int bits, int value);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:987:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘long’
 Z_EXTERN long Z_EXPORT inflateMark(z_stream *strm);
          ^~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1015:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateGetHeader(z_stream *strm, gz_headerp head);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1078:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateBack(z_stream *strm, in_func in, void *in_desc, out_func out, void *out_desc);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1146:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateBackEnd(z_stream *strm);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1154:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT zlibCompileFlags(void);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1208:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT compress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
          ^~~
In file included from src/http/modules/ngx_http_log_module.c:13:0:
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1222:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT compress2(unsigned char *dest, unsigned long *destLen, const unsigned char *source,
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1237:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT compressBound(unsigned long sourceLen);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1244:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT uncompress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1262:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT uncompress2 (unsigned char *dest,         unsigned long *destLen,
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1320:1: error: unknown type name ‘Z_EXTERN’
 Z_EXTERN gzFile Z_EXPORT gzdopen(int fd, const char *mode);
 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1320:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
 Z_EXTERN gzFile Z_EXPORT gzdopen(int fd, const char *mode);
                 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1320:17: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1343:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzbuffer(gzFile file, unsigned size);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1359:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzsetparams(gzFile file, int level, int strategy);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1370:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzread(gzFile file, void *buf, unsigned len);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1400:1: error: unknown type name ‘Z_EXTERN’
 Z_EXTERN size_t Z_EXPORT gzfread (void *buf, size_t size, size_t nitems, gzFile file);
 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1400:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
 Z_EXTERN size_t Z_EXPORT gzfread (void *buf, size_t size, size_t nitems, gzFile file);
                 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1400:17: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1425:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzwrite(gzFile file, void const *buf, unsigned len);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1431:1: error: unknown type name ‘Z_EXTERN’
 Z_EXTERN size_t Z_EXPORT gzfwrite(void const *buf, size_t size, size_t nitems, gzFile file);
 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1431:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
 Z_EXTERN size_t Z_EXPORT gzfwrite(void const *buf, size_t size, size_t nitems, gzFile file);
                 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1431:17: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1442:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORTVA gzprintf(gzFile file, const char *format, ...);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1457:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzputs(gzFile file, const char *s);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1465:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
 Z_EXTERN char * Z_EXPORT gzgets(gzFile file, char *buf, int len);
          ^~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1479:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzputc(gzFile file, int c);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1485:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzgetc(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1494:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzungetc(int c, gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1506:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzflush(gzFile file, int flush);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1540:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzrewind(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1568:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzeof(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1583:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzdirect(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1604:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzclose(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1617:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzclose_r(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1618:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzclose_w(gzFile file);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1629:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘const’
 Z_EXTERN const char * Z_EXPORT gzerror(gzFile file, int *errnum);
          ^~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1645:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 Z_EXTERN void Z_EXPORT gzclearerr(gzFile file);
          ^~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1662:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT adler32(unsigned long adler, const unsigned char *buf, unsigned int len);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1682:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT adler32_z(unsigned long adler, const unsigned char *buf, size_t len);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1698:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT crc32(unsigned long crc, const unsigned char *buf, unsigned int len);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1716:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long Z_EXPORT crc32_z(unsigned long crc, const unsigned char *buf, size_t len);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1739:1: error: unknown type name ‘Z_EXTERN’
 Z_EXTERN uint32_t Z_EXPORT crc32_combine_op(uint32_t crc1, uint32_t crc2,
 ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1739:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
 Z_EXTERN uint32_t Z_EXPORT crc32_combine_op(uint32_t crc1, uint32_t crc2,
                   ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1739:19: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1753:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateInit_(z_stream *strm, int level, const char *version, int stream_size);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1754:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateInit_(z_stream *strm, const char *version, int stream_size);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1755:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT deflateInit2_(z_stream *strm, int  level, int  method, int windowBits, int memLevel,
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1757:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateInit2_(z_stream *strm, int  windowBits, const char *version, int stream_size);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1758:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT inflateBackInit_(z_stream *strm, int windowBits, unsigned char *window,
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1783:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORT gzgetc_(gzFile file);  /* backward compatibility */
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1793:4: error: unknown type name ‘Z_EXTERN’
    Z_EXTERN gzFile Z_EXPORT gzopen64(const char *, const char *);
    ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1793:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
    Z_EXTERN gzFile Z_EXPORT gzopen64(const char *, const char *);
                    ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1793:20: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1794:4: error: unknown type name ‘Z_EXTERN’
    Z_EXTERN z_off64_t Z_EXPORT gzseek64(gzFile, z_off64_t, int);
    ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1794:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
    Z_EXTERN z_off64_t Z_EXPORT gzseek64(gzFile, z_off64_t, int);
                       ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1794:23: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1795:4: error: unknown type name ‘Z_EXTERN’
    Z_EXTERN z_off64_t Z_EXPORT gztell64(gzFile);
    ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1795:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
    Z_EXTERN z_off64_t Z_EXPORT gztell64(gzFile);
                       ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1795:23: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1796:4: error: unknown type name ‘Z_EXTERN’
    Z_EXTERN z_off64_t Z_EXPORT gzoffset64(gzFile);
    ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1796:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_EXPORT’
    Z_EXTERN z_off64_t Z_EXPORT gzoffset64(gzFile);
                       ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1796:23: error: unknown type name ‘Z_EXPORT’
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1797:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
    Z_EXTERN unsigned long Z_EXPORT adler32_combine64(unsigned long, unsigned long, z_off64_t);
             ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1798:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
    Z_EXTERN unsigned long Z_EXPORT crc32_combine64(unsigned long, unsigned long, z_off64_t);
             ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1799:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
    Z_EXTERN void Z_EXPORT crc32_combine_gen64(uint32_t *op, z_off64_t);
             ^~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1833:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘const’
 Z_EXTERN const char     * Z_EXPORT zError           (int);
          ^~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1834:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int              Z_EXPORT inflateSyncPoint (z_stream *);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1835:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘const’
 Z_EXTERN const uint32_t * Z_EXPORT get_crc_table    (void);
          ^~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1836:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int              Z_EXPORT inflateUndermine (z_stream *, int);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1837:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int              Z_EXPORT inflateValidate  (z_stream *, int);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1838:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unsigned’
 Z_EXTERN unsigned long    Z_EXPORT inflateCodesUsed (z_stream *);
          ^~~~~~~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1839:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int              Z_EXPORT inflateResetKeep (z_stream *);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1840:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int              Z_EXPORT deflateResetKeep (z_stream *);
          ^~~
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1846:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 Z_EXTERN int Z_EXPORTVA gzvprintf(gzFile file, const char *format, va_list va);
          ^~~
src/http/modules/ngx_http_log_module.c: In function ‘ngx_http_log_gzip’:
/home/yefei.dyf/zlib-ng-2.0.7/zlib.h:1763:9: error: implicit declaration of function ‘deflateInit2_’ [-Werror=implicit-function-declaration]
         deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \
         ^
src/http/modules/ngx_http_log_module.c:637:10: note: in expansion of macro ‘deflateInit2’
     rc = deflateInit2(&zstream, (int) level, Z_DEFLATED, wbits + 16, memlevel,
          ^~~~~~~~~~~~
src/http/modules/ngx_http_log_module.c:650:10: error: implicit declaration of function ‘deflate’ [-Werror=implicit-function-declaration]
     rc = deflate(&zstream, Z_FINISH);
          ^~~~~~~
src/http/modules/ngx_http_log_module.c:666:10: error: implicit declaration of function ‘deflateEnd’ [-Werror=implicit-function-declaration]
     rc = deflateEnd(&zstream);
          ^~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/src/http/modules/ngx_http_log_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/yefei.dyf/github/nginx'
make: *** [build] Error 2

Change History (2)

comment:1 by bullerdu@…, 13 months ago

Description: modified (diff)

I tried to fix the problem, as follows:

# HG changeset patch
# User Buller Du <duyefei@outlook.com>
# Date 1679478784 -28800
#      Wed Mar 22 17:53:04 2023 +0800
# Node ID aa8d7c65ac5687971fe94d220d07f3d9237ba411
# Parent  8771d35d55d0a2b1cefaab04401d6f837f5a05a2
Gzip: Compatible to compile zlib-ng

diff -r 8771d35d55d0 -r aa8d7c65ac56 auto/lib/zlib/conf
--- a/auto/lib/zlib/conf        Fri Mar 10 07:43:50 2023 +0300
+++ b/auto/lib/zlib/conf        Wed Mar 22 17:53:04 2023 +0800
@@ -35,6 +35,7 @@
             have=NGX_ZLIB . auto/have
             LINK_DEPS="$LINK_DEPS $ZLIB/libz.a"
             CORE_LIBS="$CORE_LIBS $ZLIB/libz.a"
+            CORE_DEPS="$CORE_DEPS $ZLIB/zlib.h"
             #CORE_LIBS="$CORE_LIBS -L $ZLIB -lz"
         ;;

diff -r 8771d35d55d0 -r aa8d7c65ac56 auto/lib/zlib/make
--- a/auto/lib/zlib/make        Fri Mar 10 07:43:50 2023 +0300
+++ b/auto/lib/zlib/make        Wed Mar 22 17:53:04 2023 +0800
@@ -50,9 +50,11 @@

             cat << END                                        >> $NGX_MAKEFILE

+$ZLIB/zlib.h:  $NGX_MAKEFILE
+
 $ZLIB/libz.a:  $NGX_MAKEFILE
        cd $ZLIB \\
-       && \$(MAKE) distclean \\
+       && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
        && \$(MAKE) -f win32/Makefile.gcc \\
                CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
                libz.a
@@ -73,9 +75,11 @@

                 cat << END                                    >> $NGX_MAKEFILE

+$ZLIB/zlib.h:  $NGX_MAKEFILE
+
 $ZLIB/libz.a:  $NGX_MAKEFILE
        cd $ZLIB \\
-       && \$(MAKE) distclean \\
+       && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
        && cp contrib/asm586/match.S . \\
        && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
                ./configure \\
@@ -90,9 +94,11 @@

                 cat << END                                    >> $NGX_MAKEFILE

+$ZLIB/zlib.h:  $NGX_MAKEFILE
+
 $ZLIB/libz.a:  $NGX_MAKEFILE
        cd $ZLIB \\
-       && \$(MAKE) distclean \\
+       && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
        && cp contrib/asm686/match.S . \\
        && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
                ./configure \\
@@ -123,9 +129,11 @@

     cat << END                                                >> $NGX_MAKEFILE

+$ZLIB/zlib.h:  $NGX_MAKEFILE
+
 $ZLIB/libz.a:  $NGX_MAKEFILE
        cd $ZLIB \\
-       && \$(MAKE) distclean \\
+       && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
        && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
                ./configure \\
        && \$(MAKE) libz.a

comment:2 by Maxim Dounin, 13 months ago

Resolution: invalid
Status: newclosed

The zlib-ng library is a different library, not zlib, so trying to instruct nginx to build it by using --with-zlib= configure option is expected to fail.

Instead, consider building zlib-ng yourself. If it's not installed system-wide, make sure to provide appropriate include and library dirs with --with-cc-opt="-I /path/to/zlib-ng/include" and --with-ld-opt="-L /path/to/zlib-ng/lib" when building nginx. Alternatively, load it with LD_PRELOAD when starting nginx compiled with zlib.

Note well that you'll have to build zlib-ng with zlib compatibility, --zlib-compat. Please refer to zlib-ng documentation for more details.

Note: See TracTickets for help on using tickets.