From: Brian J. <bjj...@us...> - 2001-06-04 22:19:43
|
I just tried getting the 0.9 snapshot to configure and build in SGI's internal freeware build environment. I ran into a few problems: - the "extern "C" void exit(int) throw();" lines in the configure test programs were interfering with a "extern void exit(int);" declaration in SGI's unistd.h. Deleting the " throw()"s fixed it. (Note: when I run autoconf 2.13 directly, it doesn't have this problem.) - the extended signal handlers test program was failing. Eventually I tracked it down to SGI's C++ compiler: it was optimizing out one of the writes to the page[] array, and moving the read of handler_called above the writes. Here's a patch which fixed it. Just declaring the variables volatile doesn't seem to do it; I had to insert the system call to force synchronization: --- sigsegv.cpp~ Sun May 20 22:21:54 2001 +++ sigsegv.cpp Mon Jun 4 14:20:44 2001 @@ -250,9 +250,9 @@ #include <fcntl.h> #include <sys/mman.h> -static caddr_t page = 0; +static volatile caddr_t page = 0; static int page_size; -static int handler_called = 0; +static volatile int handler_called = 0; static bool sigsegv_test_handler(sigsegv_address_t fault_address, sigsegv_address_t instruction_address) { @@ -281,6 +281,8 @@ page[123] = 45; page[123] = 45; + (void)close(zero_fd); // Be sure to read handler_called after writes! + if (handler_called != 1) return 1; There's probably a cleaner way to do this... but it works. I probably didn't see this problem before since I always ran configure with my local machine's environment instead of the official SGI freeware build environment, which may have changed the level of optimization used while configuring. Brian -------------------------------------------------------------------- "There is the greatest practical benefit in making a few failures early in life." -- Thomas Henry Huxley |