Skip to content

Commit 57d1570

Browse files
author
Ira W. Snyder
committed
Fix static and dynamic mode compilation with nginx >= 1.9.11
The commit 42eeda5 "Dynamic Module support." does not compile in the static module mode on nginx >= 1.9.11. It gives the compiler error message: objs/ngx_modules.o:(.data+0x320): undefined reference to `ngx_http_aws_auth' collect2: error: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/nginx-1.9.11' make: *** [install] Error 2 It is possible to fix static mode, by changing ngx_module_name to "ngx_http_aws_auth_module", however, this breaks dynamic mode instead. To make both modes work correctly, the name of the C source code file is required to match the module struct name. And now both modes work correctly. Tested on nginx-1.9.11 and nginx-1.9.12.
1 parent 396137c commit 57d1570

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ ngx_addon_name=ngx_http_aws_auth
22

33
if test -n "$ngx_module_link"; then
44
ngx_module_type=HTTP
5-
ngx_module_name=ngx_http_aws_auth
5+
ngx_module_name=ngx_http_aws_auth_module
66
ngx_module_incs=
77
ngx_module_deps=
8-
ngx_module_srcs="$ngx_addon_dir/ngx_http_aws_auth.c"
8+
ngx_module_srcs="$ngx_addon_dir/ngx_http_aws_auth_module.c"
99
ngx_module_libs="$CORE_LIBS -lssl"
1010

1111
. auto/module
1212
else
1313
HTTP_MODULES="$HTTP_MODULES ngx_http_aws_auth_module"
14-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_aws_auth.c"
14+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_aws_auth_module.c"
1515
CORE_LIBS="$CORE_LIBS -lssl"
16-
fi
16+
fi

0 commit comments

Comments
 (0)