[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

README v1.5 - darwin build note

From: Rick Robino
Subject: README v1.5 - darwin build note
Date: Wed, 21 May 2003 03:23:35 -0700

Greetings hauk, long time no talk to. This is a developer type message, but the general list was all I could find.

I happened to be peeking about the CVS repository for monit to see what is cooking for v4 and read that the Mac OS X port was giving you problems on the compile farm. Since your code is so beautiful I just knew it would compile with only a little autoconf push ;-) Actually, I tried to reproduce the pthread sigmask problem and didn't see it in the standard error output from configure/make, but I did get some problems about multiple and undeclared definitions of FALSE and TRUE, etc. - most apple folks by now are familiar with these sorts of silly errors. Addressing two items in configure(.ac) yields a working binary for me, with just a few innocuous warnings:

1. Apple's linker is kind of strange, and the behavior has changed between major versions, so some things that didn't generate complaints now do and vice versa - the complaints do not necessarily indicate a real problem that the compiler is saving you from. For example: multiple definitions. Anyway, the magic incantation with the latest version of the tools Apple ships is: -multiply_defined <error|warn|suppress>. Default is error, but suppressing them is usually safe if you think it should be. FWIW, the other common bogus compiler error tends to be cured with: CFLAGS="-no-cpp-precomp", just in case you or someone else run into any other common mac problems.

2. Since gcc is Apple's native compiler, AND openssl is actually part of the system (as in residing in /usr instead of /usr/local) the ssl tests pick up system paths that gcc has already fixed the includes for, causing gcc to choke on the new -I or -L that is already part of its standard lookup path. OpenBSD has a similar ssl situation, I would imagine that the current configure runs into this same problem on that platform as well.

If #1 is not handled the kit still compiles but with the multiply_defined warning, but #2 is a show stopper for gcc if ssl support is built. Once resolved, the only warnings remaining are during the final stages where gcc complains:

gcc -c -g -O2 -Wall -DREENTRANT -DDARWIN -I. -I./protocols -I./http -I./process lex.yy.c -o lex.yy.o
lex.yy.c:2494: warning: `yyunput' defined but not used
gcc -c -g -O2 -Wall -DREENTRANT -DDARWIN -I. -I./protocols -I./http -I./process process/sysdep_DARWIN.c -o process/sysdep_DARWIN.o
process/sysdep_DARWIN.c: In function `calcru':
process/sysdep_DARWIN.c:103: warning: unused variable `tv'
process/sysdep_DARWIN.c: In function `get_process_info_sysdep':
process/sysdep_DARWIN.c:215: warning: unused variable `pstats'
process/sysdep_DARWIN.c:218: warning: unused variable `rup'
/usr/include/stdio.h: At top level:
process/sysdep_DARWIN.c:96: warning: `calcru' defined but not used

Upon running the finished product the runtime linker (?) does give a warning:

$ ./monit -c ~/.monitrc -d 60
*** malloc[3867]: Deallocation of a pointer not malloced: 0x2359a4; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Starting monit daemon
Starting httpd at [localhost:2812]

I haven't looked any farther into this warning, other than testing out the running daemon - seems to work well with my fairly complex config. Service restarts work, monit takes signals and does not die, for the short time I ran the daemon I did not see it grow stack size in top(1). So... unless there really is a free() bug or the duplicate symbol truly does pose a problem, I'd say that monit does compile and work fine on OS X. Very tiny diff attached.

My environment particulars should be common to most present mac users, thanks to auto update: Darwin spiff.local. 6.6 Darwin Kernel Version 6.6: Thu May 1 21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC Power Macintosh powerpc
(a.k.a Mac OS X 10.2.6)

Apple Developer Tools, December 2002:
gcc (GCC) 3.1 20020420 (prerelease)
autoconf 2.52  (yes, I fudged this one down in


Richard T. Robino
Internet Systems Architect
Wave Division Consulting

reply via email to

[Prev in Thread] Current Thread [Next in Thread]