Have a nice day,
I have a problem with compile nginx web server on SunBlade-100
$ gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I
src/os/unix -I objs \
-o objs/src/core/ngx_times.o \
src/core/ngx_times.c
/home/andrey/tmp/ccjb1kos.s: Assembler messages:
/home/andrey/tmp/ccjb1kos.s:377: Error: Architecture mismatch on "casa".
/home/andrey/tmp/ccjb1kos.s:377: (Requires v9|v9a|v9b; requested
architecture is sparclite.)
/home/andrey/tmp/ccjb1kos.s:585: Error: Architecture mismatch on "membar".
/home/andrey/tmp/ccjb1kos.s:585: (Requires v9|v9a|v9b; requested
architecture is sparclite.)
$ gcc -v
Using built-in specs.
Target: sparc-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre
--enable-mpfr --disable-werror --with-cpu=v7 --enable-checking=release
sparc-linux-gnu
Thread model: posix
gcc version 4.0.3 2005 (prerelease) (Debian 4.0.2-4)
$ uname -a
Linux blade 2.6.14-2-sparc64 #1 Wed Nov 9 20:40:45 PST 2005 sparc64
GNU/Linux
$ dpkg -l libc6*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name Version
Description
+++-==-==-
ii libc6 2.3.5-8GNU C
Library: Shared libraries and Timezone data
ii libc6-dev 2.3.5-8GNU C
Library: Development Libraries and Header Files
ii libc6-dev-sparc64 2.3.5-8GNU C
Library: 64bit Development Libraries for UltraSPARC
ii libc6-sparc64 2.3.5-8GNU C
Library: 64bit Shared libraries for UltraSPARC
The source file (ngx_times.c) with problem is included
--
Andrey Chernomyrdin
/*
* Copyright (C) Igor Sysoev
*/
#include
#include
/*
* The time may be updated by signal handler or by several threads.
* The time update operations are rare and require to hold the ngx_time_lock.
* The time read operations are frequent, so they are lock-free and get time
* values and strings from the current slot. Thus thread may get the corrupted
* values only if it is preempted while copying and then it is not scheduled
* to run more than NGX_TIME_SLOTS seconds.
*/
#define NGX_TIME_SLOTS 64
static ngx_uint_tslot = NGX_TIME_SLOTS;
static ngx_atomic_t ngx_time_lock;
volatile ngx_msec_t ngx_current_msec;
volatile ngx_time_t *ngx_cached_time;
volatile ngx_str_t ngx_cached_err_log_time;
volatile ngx_str_t ngx_cached_http_time;
volatile ngx_str_t ngx_cached_http_log_time;
static ngx_time_tcached_time[NGX_TIME_SLOTS];
static u_charcached_err_log_time[NGX_TIME_SLOTS]
[sizeof("1970/09/28 12:00:00")];
static u_charcached_http_time[NGX_TIME_SLOTS]
[sizeof("Mon, 28 Sep 1970 06:00:00 GMT")];
static u_charcached_http_log_time[NGX_TIME_SLOTS]
[sizeof("28/Sep/1970:12:00:00 +0600")];
static char *week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
void
ngx_time_init(void)
{
ngx_cached_err_log_time.len = sizeof("1970/09/28 12:00:00") - 1;
ngx_cached_http_time.len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
ngx_cached_http_log_time.len = sizeof("28/Sep/1970:12:00:00 +0600") - 1;
ngx_cached_time = &cached_time[0];
#if !(NGX_WIN32)
tzset();
#endif
ngx_time_update(0, 0);
}
void
ngx_time_update(time_t sec, ngx_uint_t msec)
{
u_char *p0, *p1, *p2;
ngx_tm_t tm, gmt;
ngx_time_t *tp;
struct timeval tv;
if (!ngx_trylock(&ngx_time_lock)) {
return;
}
if (slot == NGX_TIME_SLOTS) {
slot = 0;
} else {
slot++;
}
if (sec == 0) {
ngx_gettimeofday(&tv);
sec = tv.tv_sec;
msec = tv.tv_usec / 1000;
}
ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;
tp = &cached_time[slot];
tp->msec = msec;
if (tp->sec == sec) {
ngx_unlock(&ngx_time_lock);
return;
}
tp->sec = sec;
ngx_gmtime(sec, &gmt);
p0 = cached_http_time[slot];
(void) ngx_sprintf(p0, "%s