OS X Lion, make check stalls

Jack Howarth howarth at bromo.med.uc.edu
Thu Jul 28 21:03:23 CEST 2011


On Thu, Jul 28, 2011 at 06:39:32PM +0200, Hans Aberg wrote:
> On 28 Jul 2011, at 12:16, Torbjorn Granlund wrote:
> 
> > ...  I see the LLVM name in your report.  That
> > compiler is very immature, and miscompiles most non-trivial programs at
> > at least some optimisation level.
> 
> Apple has switched to a Clang/LLVM based compiler, though it is their own homebrew. Xcode 4.1, I think, still has both a GCC derived compiler together with the LLVM derivation, but in Xcode 4.2, GCC has been removed altogether.

   Mac OS X 10.7, Lion, is compiled with the llvm-gcc compiler (although an Apple specific version). The problem
here was that GMP had its own configure test for "checking how to switch to read-only data section... " which
I don't believe exists any other software. According to the darwin linker developer the test used there was
flawed. Looking back through my email exchanges with the darwin linker developer I also found...

---------------------------------------------------------------------------------------
It is fine for single 4-byte constants to be in the literal4 section.  The problem is having arrays of constants.    The configure tes
t seems to be assuming that the section that holds one 4-byte constant can also be used to hold an array.  If you try an array, you'l 
see clang uses a different section:

[/tmp]> cat > a.c
const int foo[] = { 1,2,3 };
[/tmp]> clang -Os a.c -S
[/tmp]> cat a.s
	.section	__TEXT,__text,regular,pure_instructions
	.section	__TEXT,__const
	.globl	_foo                    ## @foo
	.align	2
_foo:
	.long	1                       ## 0x1
	.long	2                       ## 0x2
	.long	3                       ## 0x3

----------------------------------------------------------------------------------------------------------------------------------------

FYI, originally clang was also broken for this test but at some point during the Xcode 4.1 development
clang no longer issued the literal4 but llvm-gcc still did. I think that only shows that without using an
array, a compiler on darwin is free to use different sections (but may or may not do so).
                    Jack

> 
> There is this link, though, using one of the latest GCC:
>   http://hpc.sourceforge.net/
> 
> Hans
> 
> 
> _______________________________________________
> gmp-bugs mailing list
> gmp-bugs at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-bugs


More information about the gmp-bugs mailing list