Problem with configure compiling 64-bit under Solaris 10

John Center john.center at villanova.edu
Sun Mar 15 17:37:32 GMT 2009


Hi,

There is a problem with configure when trying to compile 64-bit binaries 
on Solaris 10 using Sun Studio 12.  When some of the tests are run, the 
CFLAGS variable is completely replaced with one that contains an option 
for testing.  For example, when testing for compiler warnings, CFLAGS is 
replaced with Werror_FLAGS, which can contain -Werror, -w2 or -errwarn. 
  This fails in 64-bit mode because the appropriate option, "-m64", is 
not included.  Without this flag, conftest fails with a "wrong ELF 
class" error, which configure does not catch.

The offending lines in configure are often in the form:

	old_CFLAGS="$CFLAGS";
	CFLAGS="$Werror_FLAGS";
	export CFLAGS;

where Werror_FLAGS is defined as:  Werror_FLAGS="<errflag>".

I think Werror_FLAGS should be redefined instead as:

	Werror_FLAGS="$CFLAGS <errflag>"

maintaining the builder's CFLAGS.  This would prevent problems like this 
from occurring in the future.

Thanks.

	-John


-- 
John Center
Villanova University


More information about the samba-technical mailing list