Solaris 10 issue with 0.7.10+ builds w/ patch fix

Victor Iggy lists at ruby-forum.com
Thu Sep 11 02:13:15 MSD 2008


/opt/SunStudioExpress/bin/cc -c -fast -xipo  -errwarn=%all -g  -I
src/core -I src/event -I src/event/modules -I src/os/unix -I ../pcre-7.6
-I objs \
    -o objs/src/os/unix/ngx_alloc.o \
    src/os/unix/ngx_alloc.c src/os/unix/ngx_sunpro_x86.il
"src/os/unix/ngx_alloc.c", line 55: warning: implicit function
declaration: posix_memalign
cc: acomp failed for src/os/unix/ngx_alloc.c
gmake[1]: *** [objs/src/os/unix/ngx_alloc.o] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/opt/extra/work/nginx-0.7.16'
gmake: *** [build] Error 2


Patch fix.

# diff -ur src/os/unix/ngx_alloc.c
../nginx-0.7.16-patched/src/os/unix/ngx_alloc.c
--- src/os/unix/ngx_alloc.c  Mon Nov 20 00:51:45 2006
+++ ../nginx-0.7.16-patched/src/os/unix/ngx_alloc.c  Tue Sep  9 00:23:59
2008
@@ -45,32 +45,11 @@
 }


Don't use the POSIX_MEMALIGN function on solaris. Just my little hack to
get nginx working correctly on Indiana.

-#if (NGX_HAVE_POSIX_MEMALIGN)
-
 void *
 ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
 {
     void  *p;

-    if (posix_memalign(&p, alignment, size) == -1) {
-        ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
-                      "posix_memalign() %uz bytes aligned to %uz
failed",
-                      size, alignment);
-    }
-
-    ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0,
-                   "posix_memalign: %p:%uz", p, size);
-
-    return p;
-}
-
-#elif (NGX_HAVE_MEMALIGN)
-
-void *
-ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
-{
-    void  *p;
-
     p = memalign(alignment, size);
     if (p == NULL) {
         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
@@ -84,4 +63,3 @@
     return p;
 }

-#endif
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list