[Patch] Configure broken for Solaris 2.6 (PR#12014)

David Collier-Brown davecb at Canada.Sun.COM
Fri Jan 8 16:13:40 GMT 1999


eischen at vigrid.com wrote:
> > For this to work, you have to define _LARGEFILE64_SOURCE, not _LARGEFILE_SOURCE.
> > The define for _FILE_OFFSET_BITS=64 is not necessary for detecting statvfs or
> > statvfs64.  In other words,
> >
> >   gcc -o conftest -O  -D_LARGEFILE64_SOURCE conftest.c -lsec -lsocket -lnsl -ldl -lpam
> >
> > will work.  Here is the diff for source/configure:
 
Jeremy Allison wrote:
> According to Dave Collier-Brown, who is a Sun engineer,
> this would be the wrong thing to do, which is why I didn't
> include the patch the first time. I forget the exact
> reasoning but I am CC:ing this message to samba-technical
> so he can explain again (sorry Dave :-).

	Ok, but this is my opinion, not necessarily Sun's.

	<factual part>
	There are two ways to use 64-bit files: by switching
	all files i/o to 64-bit, or by mixing 32 and 64 bit.

	The Sun incantation for mixed 32 & 64
	includes -D_LARGEFILE64_SOURCE.
	The one for all-files-64 includes -D_LARGEFILE_SOURCE.
	Both include -D_FILE_OFFSET_BITS=64, and the authors are
	insistent that it's necessary:  the man page says.
	"Set  the  compile-time  flag  _FILE_OFFSET_BITS  to 64
	before including any headers."

	Try man lfcompile (64bit) and lfcompile64 (32/64), plus man lf64
	to figure out what Sun's up to.

	<put on guru hat>
	Now, as to the "which to use" question: 
	the transitional interfaces allow you to use, for example,
	open() and open64() in the same program.  I strongly
	recommend against doing so: this is really for people
	whose programs are so horrible that they're scared to
	change to the new xxx_t types for fear something else will
	break. (I'm working on fixing one as we speak)

	The "all 64" scheme is the one I recommend: you'll get
	compiler warning if you try to use an int for a type which
	has turned into a long, which usually is all the hint you need.
	(I actually diff'd before-and-after-the-change compile logs to pick
	out the few new warnings from the hundreds of others).

	You don't have to change any function names, and when you go to
	a 64-bit os like Solaris 7 or the Alpha one (what do they call it
	now? digital compax?), you won't have to make any additional changes.

	<change hats to dunce cap>
	I have to admit I got a ton of strange compile messages initially,
	but it turned out that my compiler was set so that it emitted
	messages at then wrong moment while running configure. As a result
	configure thought several things had failed and generated bogus
	includes.  This meant I ended up tracing my way through configure
	checking, among others, the xxx64() test code.
	<remove dunce cap>

--dave
[I'm a philosopher and logician, formerly on the binary stability and
later
 forward migration project at Opcom in Toronto.  Right now I'm doing a
 sunos->solaris port for a customer. I speak for me, but with an
understanding
 of large-scale migration issues gained from the Sun stability project]
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | http://java.science.yorku.ca/~davecb
Work: (905) 477-0437 Home: (416) 223-8968 Email: davecb at canada.sun.com
-or-
David Collier-Brown,  | Cherish your enemies.  They're harder to
Trader 2000 Programme | come by than friends and more motivated.
Sun NAFO CE (Toronto) | davecb at canada.sun.com
(905) 477-0437        | http://elsbeth.canada.sun.com/~davecb


More information about the samba-technical mailing list