The following patch crashes any job: svn diff Index: main/pcl6_gcc.mak =================================================================== --- main/pcl6_gcc.mak (revision 10247) +++ main/pcl6_gcc.mak (working copy) @@ -178,13 +178,15 @@ HAVE_STDINT_H_DEFINE?=-DHAVE_STDINT_H HAVE_MKSTEMP_DEFINE?=-DHAVE_MKSTEMP HAVE_HYPOT_DEFINE?=-DHAVE_HYPOT +HAVE_FILE64_DEFINE?=-DHAVE_FILE64 -GCFLAGS?=-Wall -Wundef -Wstrict-prototypes -Wmissing-declarations \ +Gcflags?=-Wall -Wundef -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wpointer-arith \ -Wwrite-strings -Wno-strict-aliasing \ -fno-builtin -fno-common \ $(HAVE_STDINT_H_DEFINE) $(HAVE_MKSTEMP_DEFINE) $(HAVE_HYPOT_DEFINE) \ - $(GX_COLOR_INDEX_DEFINE) $(PSICFLAGS) $(PDL_INCLUDE_FLAGS) + $(GX_COLOR_INDEX_DEFINE) $(PSICFLAGS) $(PDL_INCLUDE_FLAGS) \ + $(HAVE_FILE64_DEFINE) CFLAGS?= $(GCFLAGS) $(XCFLAGS) Index: pl/plmain.c =================================================================== --- pl/plmain.c (revision 10247) +++ pl/plmain.c (working copy) @@ -790,7 +790,7 @@ /* Process the options on the command line. */ static FILE * pl_main_arg_fopen(const char *fname, void *ignore_data) -{ return fopen(fname, "r"); +{ return gp_fopen_64(fname, "r"); } static void @@ -1235,7 +1235,7 @@ if (fname[0] == '-' && fname[1] == 0) cursor->strm = mem->gs_lib_ctx->fstdin; else - cursor->strm = fopen(fname, "rb"); + cursor->strm = gp_fopen_64(fname, "rb"); if (!cursor->strm) return gs_error_ioerror; make pcl XCFLAGS="-D_FILE_OFFSET_BITS=64" works without any code changes but it was desired to use the portability layer and gp_fopen_64.
Makefile variables are case sensitive, so the Gcflags you're setting your patch isn't the same as GCFLAGS which is passed to the compiler. Apparently some of the other options are required: if I use the all-upper case define, I don't get a segfault. Universally defining HAVE_FILE64 doesn't work on my mac (MacOS X 10.4 intel), so some conditional define is necessary. Sorry, I forgot fopen64() etc. aren't always available. It's not ideal, but defining _FILE_OFFSET_BITS=64 just for the pcl build and hoping for the best would work. I was arguing that you couldn't just delete the gp_* stuff, not that it couldn't be cleaned up, or that the ghostpdl builds, with their narrower platform support couldn't ignore the issue.
Sorry that was a stupid finger fumble. > Universally defining HAVE_FILE64 doesn't work on my mac (MacOS X 10.4 intel), so > some conditional define is necessary. Sorry, I forgot fopen64() etc. aren't > always available. > > It's not ideal, but defining _FILE_OFFSET_BITS=64 just for the pcl build and > hoping for the best would work. I was arguing that you couldn't just delete the > gp_* stuff, not that it couldn't be cleaned up, or that the ghostpdl builds, > with their narrower platform support couldn't ignore the issue. It doesn't help windows. HAVE_FILE64 can be set in the pcl6_msvc.mak and pcl6_gcc.mak as a commented out option with a comment to uncomment if 64 bit access is needed and supported. Assign it back to me if you want me to make the change.
Grabbing a Ralph's bugs.
a bit of autoconf doesn't need to hurt too much?
Created attachment 6411 [details] some autoconf stuff to auto-detect file64, etc some autoconf stuff to auto-detect file64, etc and insert them into main/pcl6_gcc.mak . This mostly works like ghostscript's ./autogen.sh (except smaller and faster): it creates a ./configure script which tries to detect fopen64 and etc and put them in main/pcl6_gcc.mak , to avoid the editing. There is only one option: "./configure --with-old", which revert main/pcl6_gcc.mak to how it was shipped. (this is mainly so that svn update can still work).
Work flow should work as it was - the user just has the new choice of optionally run ./autogen.sh (or ./configure in a release) to massage main/pcl6_gcc.mak before he runs "make", as usual. (and "./autogen.sh --with-old" or "./configure --with-old" to revert all manual or automatic edits).
Re-assign back to reporter to test the patch. Some more code changes of fopen() to gp_fopen_64() etc probably are needed, but at least the new ./autgen.sh / ./configure should auto-detect the presence or absence of 64-bit file access support on 32-bit system and set (not set) -DHAVE_FILE64 .
Please don't adopt the patches in this bug directly. I think we need to talk to somebody in the know about LFS and reassess how ghostscript is handling LFS not just pcl. Changing to P4 as the customer has a workaround.
FYI, there is(was?) a 64-bit migration guide on Apple's dev web site I remember coming across which discusses these issues. (as well as a sizeable portion of glibc's release notes on linux systems).
GhostPDL now sets the HAVE_FILE64 compile flag the same as Ghostscript: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=f59dba32