New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with nginx 1.7.11 and --with-threads #948

Closed
crowell opened this Issue Apr 1, 2015 · 3 comments

Comments

Projects
None yet
1 participant
@crowell
Copy link
Contributor

crowell commented Apr 1, 2015

bug report from here : https://groups.google.com/forum/#!topic/ngx-pagespeed-discuss/62fSCt3av9A
configure nginx --with-threads
eg

CC=clang CXX=clang++ ./configure --with-threads --add-module=/tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta

jcrowell0 gnx/nginx-1.7.11 » make
make -f objs/Makefile
make[1]: Entering directory `/tmp/gnx/nginx-1.7.11'
clang -c -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Werror -g    -I src/core -I src/event -I src/event/modules -I src/os/unix -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/chromium/src -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/google-sparsehash/src -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/protobuf/src -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/re2/src -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/out/Release/obj/gen -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/apr/src/include -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/aprutil/src/include -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include -I objs -I src/http -I src/http/modules -I src/mail \
                -o objs/addon/src/ngx_message_handler.o \
                /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.h:21:
In file included from src/core/ngx_core.h:49:
src/os/unix/ngx_files.h:387:25: error: unknown type name 'ngx_thread_task_t'; did you mean 'ngx_thread_cond_t'?
ssize_t ngx_thread_read(ngx_thread_task_t **taskp, ngx_file_t *file,
                        ^~~~~~~~~~~~~~~~~
                        ngx_thread_cond_t
src/os/unix/ngx_thread.h:28:25: note: 'ngx_thread_cond_t' declared here
typedef pthread_cond_t  ngx_thread_cond_t;
                        ^
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.h:21:
In file included from src/core/ngx_core.h:57:
src/core/ngx_buf.h:105:50: error: unknown type name 'ngx_thread_task_t'; did you mean 'ngx_thread_cond_t'?
    ngx_int_t                  (*thread_handler)(ngx_thread_task_t *task,
                                                 ^~~~~~~~~~~~~~~~~
                                                 ngx_thread_cond_t
src/os/unix/ngx_thread.h:28:25: note: 'ngx_thread_cond_t' declared here
typedef pthread_cond_t  ngx_thread_cond_t;
                        ^
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.h:21:
In file included from src/core/ngx_core.h:57:
src/core/ngx_buf.h:107:5: error: unknown type name 'ngx_thread_task_t'; did you mean 'ngx_thread_cond_t'?
    ngx_thread_task_t           *thread_task;
    ^~~~~~~~~~~~~~~~~
    ngx_thread_cond_t
src/os/unix/ngx_thread.h:28:25: note: 'ngx_thread_cond_t' declared here
typedef pthread_cond_t  ngx_thread_cond_t;
                        ^
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.h:21:
In file included from src/core/ngx_core.h:62:
src/core/ngx_file.h:27:48: error: unknown type name 'ngx_thread_task_t'; did you mean 'ngx_thread_cond_t'?
    ngx_int_t                (*thread_handler)(ngx_thread_task_t *task,
                                               ^~~~~~~~~~~~~~~~~
                                               ngx_thread_cond_t
src/os/unix/ngx_thread.h:28:25: note: 'ngx_thread_cond_t' declared here
typedef pthread_cond_t  ngx_thread_cond_t;
                        ^
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed-release-1.9.32.3-beta/src/ngx_message_handler.h:21:
In file included from src/core/ngx_core.h:83:
src/core/ngx_connection.h:188:5: error: unknown type name 'ngx_thread_task_t'; did you mean 'ngx_thread_cond_t'?
    ngx_thread_task_t  *sendfile_task;
    ^~~~~~~~~~~~~~~~~
    ngx_thread_cond_t
src/os/unix/ngx_thread.h:28:25: note: 'ngx_thread_cond_t' declared here
typedef pthread_cond_t  ngx_thread_cond_t;
                        ^
5 errors generated.
make[1]: *** [objs/addon/src/ngx_message_handler.o] Error 1
make[1]: Leaving directory `/tmp/gnx/nginx-1.7.11'
make: *** [build] Error 2
@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Apr 1, 2015

applying this diff fixes the build for 1.7.11, but breaks 1.6.2 (the current stable)

diff --git a/src/ngx_message_handler.h b/src/ngx_message_handler.h
index fdcaf0b..cfa2f33 100644
--- a/src/ngx_message_handler.h
+++ b/src/ngx_message_handler.h
@@ -18,6 +18,7 @@
 #define NGX_MESSAGE_HANDLER_H_

 extern "C" {
+  #include <ngx_thread.h>
   #include <ngx_core.h>
   #include <ngx_log.h>
 }
diff --git a/src/ngx_rewrite_driver_factory.h b/src/ngx_rewrite_driver_factory.h
index 9ce36dd..5d97e95 100644
--- a/src/ngx_rewrite_driver_factory.h
+++ b/src/ngx_rewrite_driver_factory.h
@@ -20,6 +20,7 @@
 #define NGX_REWRITE_DRIVER_FACTORY_H_

 extern "C" {
+  #include <ngx_thread.h>
   #include <ngx_core.h>
   #include <ngx_http.h>
   #include <ngx_config.h>

@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Apr 1, 2015

error from building on 1.6.2 with that patch applied

clang -c -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Werror -g    -I src/core -I src/event -I src/event/modules -I src/os/unix -I /tmp/gnx/ngx_pagespeed/psol/include -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/chromium/src -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/google-sparsehash/src -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/protobuf/src -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/re2/src -I /tmp/gnx/ngx_pagespeed/psol/include/out/Release/obj/gen -I /tmp/gnx/ngx_pagespeed/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/apr/src/include -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/aprutil/src/include -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/apr/gen/arch/linux/x64/include -I /tmp/gnx/ngx_pagespeed/psol/include/third_party/aprutil/gen/arch/linux/x64/include -I objs -I src/http -I src/http/modules -I src/mail \
                -o objs/addon/src/ngx_message_handler.o \
                /tmp/gnx/ngx_pagespeed/src/ngx_message_handler.cc
In file included from /tmp/gnx/ngx_pagespeed/src/ngx_message_handler.cc:17:
In file included from /tmp/gnx/ngx_pagespeed/src/ngx_message_handler.h:21:
In file included from src/os/unix/ngx_thread.h:13:
In file included from src/core/ngx_core.h:41:
src/core/ngx_rbtree.h:51:24: error: unknown type name 'ngx_thread_volatile'
void ngx_rbtree_insert(ngx_thread_volatile ngx_rbtree_t *tree,
                       ^
src/core/ngx_rbtree.h:51:57: error: expected ')'
void ngx_rbtree_insert(ngx_thread_volatile ngx_rbtree_t *tree,
                                                        ^
src/core/ngx_rbtree.h:51:23: note: to match this '('
void ngx_rbtree_insert(ngx_thread_volatile ngx_rbtree_t *tree,
                      ^
src/core/ngx_rbtree.h:53:24: error: unknown type name 'ngx_thread_volatile'
void ngx_rbtree_delete(ngx_thread_volatile ngx_rbtree_t *tree,
                       ^
src/core/ngx_rbtree.h:53:57: error: expected ')'
void ngx_rbtree_delete(ngx_thread_volatile ngx_rbtree_t *tree,
                                                        ^
src/core/ngx_rbtree.h:53:23: note: to match this '('
void ngx_rbtree_delete(ngx_thread_volatile ngx_rbtree_t *tree,
                      ^
4 errors generated.
make[1]: *** [objs/addon/src/ngx_message_handler.o] Error 1
make[1]: Leaving directory `/tmp/gnx/nginx-1.6.2'
make: *** [build] Error 2
@crowell

This comment has been minimized.

Copy link
Contributor

crowell commented Apr 1, 2015

fixed in a81cc99

@crowell crowell closed this Apr 1, 2015

@jeffkaufman jeffkaufman changed the title ngx_pagespeed fails to build with nginx 1.7.11 and --with-threads Fails to build with nginx 1.7.11 and --with-threads Jul 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment