#13948: Let MPIR build with Clang
--------------------------------------+-------------------------------------
       Reporter:  jpflori             |         Owner:  leif     
           Type:  defect              |        Status:  new      
       Priority:  major               |     Milestone:  sage-5.10
      Component:  packages: standard  |    Resolution:           
       Keywords:  spkg mpir clang     |   Work issues:           
Report Upstream:  N/A                 |     Reviewers:           
        Authors:                      |     Merged in:           
   Dependencies:  #13137              |      Stopgaps:           
--------------------------------------+-------------------------------------

Comment (by leif):

 Replying to [comment:2 leif]:
 > (I do have a trivial patch to `acinclude.m4` to make MPIR configure [and
 of course build and pass its test suite] with `clang`.  Haven't yet
 submitted it upstream either IIRC.)

 ''I think^TM^'' this is the ''resulting'' patch to `configure` (resulting
 from patching `acinclude.m4` in two places):
 {{{
 #!patch
 --- mpir-2.6.0/configure        2012-11-08 23:13:27.000000000 +0100
 +++ mpir-2.6.0/configure        2013-01-06 14:06:55.873290298 +0100
 @@ -5132,7 +5132,7 @@
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
  /* The following aborts with gcc-4.3.2 on a 64bit system which is an
 unusable compiler */
 -#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
 +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) &&
 !defined(__clang__)
  int __attribute__((noinline))
  foo(int i)
  {
 @@ -5588,7 +5588,7 @@
     Extracted from tests/mpn/t-iord_u.c.  Causes Apple's gcc 3.3 build
 1640 and
     1666 to segfault with e.g., -O2 -mpowerpc64.  */

 -#ifdef __GNUC__
 +#if    defined(__GNUC__) && !defined(__clang__)
  typedef unsigned long long t1;typedef t1*t2;
  __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
  {t1 c,x,r;int
 i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
 @@ -6393,7 +6393,7 @@
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
  /* The following aborts with gcc-4.3.2 on a 64bit system which is an
 unusable compiler */
 -#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
 +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) &&
 !defined(__clang__)
  int __attribute__((noinline))
  foo(int i)
  {
 @@ -6849,7 +6849,7 @@
     Extracted from tests/mpn/t-iord_u.c.  Causes Apple's gcc 3.3 build
 1640 and
     1666 to segfault with e.g., -O2 -mpowerpc64.  */

 -#ifdef __GNUC__
 +#if    defined(__GNUC__) && !defined(__clang__)
  typedef unsigned long long t1;typedef t1*t2;
  __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
  {t1 c,x,r;int
 i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13948#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to