Fri 08 Nov 2013 05:07:56 AM UTC, original submission:
GNU Make 4.0 needed a bit of work to build and run on this platform. Everything is in the attached patch against git master; below are the issues addressed.
1. Tru64 doesn't know about RTLD_GLOBAL:
cc: Error: /tmp/make-4.0/load.c, line 51: In this statement, "RTLD_GLOBAL" is not declared. (undeclared)
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
-----------------------------------------^
cc: Error: /tmp/make-4.0/load.c, line 68: In this statement, "RTLD_GLOBAL" is not declared. (undeclared)
dlp = dlopen (concat (2, "./", ldname), RTLD_LAZY|RTLD_GLOBAL);
----------------------------------------------------------^
2. va_copy() does not exist on this platform (but the definition near the top of output.c works)
3. vsnprintf() segfaults when passed a NULL buffer
4. When the buffer passed to Tru64's vsnprintf() is too small, the function returns (buffer_size - 1). The code was erroneously interpreting this to mean that the buffer was large enough, resulting in truncated output.
I noticed bug #40361, and I also need to build GNU Make on HP-UX, so I rewrote the vfmtconcat() function to address the issues on both platforms.
(The initial value of fmtbuf.size can be adjusted, of course. I didn't want to set an overly large value as that would potentially mask problems in the subsequent vsnprintf() loop.)
It's worth noting that the Raptor library (librdf.org/raptor) handles vsnprintf() in a similar way; look at raptor/src/snprintf.c, specifically the VSNPRINTF_NOT_C99_BLOCK() macro.
|