Re: [PATCH v4 3/3] gnu: Update ldc to 0.17.1.

2016-09-13 Thread Danny Milosavljevic
Sigh. Yeah, I've researched a bit why that happens.

The story is this:

glibc wanted to have isinf work with double AND float etc without conversion. 
Therefore, there is a special gcc construct where you can find out what type a 
parameter is IN A MACRO. Therefore, in C, isnan is a macro and so is isinf. The 
include file defining it is 

However, in C++ there's a include file . This one provides normal 
functions in the namespace "std" (since overloads are possible in C++).

dmd2 undefs isinf which is why the C version doesn't work anymore (that's 
stupid, really. What were they thinking?). But then they dont use the namespace 
std so it won't use that one either. "::isinf" is DEFINITELY wrong - no idea 
how that ever worked. It won't find the macro that way AND it won't find the 
function in namespace std either (since :: definitely says you want 
the one without namespace).

Some LLVM versions include  somewhere in their header files - so dmd2 is 
forced to use cmath rather than math.h even though they *want* to use math.h 
and the source code says so.

Therefore, I now use the C++ std::isinf - I hope LLVM won't change their mind 
again because then it will break again.



Re: [PATCH v4 3/3] gnu: Update ldc to 0.17.1.

2016-09-13 Thread Efraim Flashner
https://wiki.dlang.org/LDC
https://github.com/ldc-developers/ldc/releases/tag/v0.17.1

After 0.17.1 is working on guix *someone* should change the supported
platforms to include arm.  Based on the wiki it sounds like maybe we
should try building it on mips also.


-- 
Efraim Flashner      אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


Re: [PATCH v4 3/3] gnu: Update ldc to 0.17.1.

2016-09-13 Thread Leo Famulari
On Tue, Sep 13, 2016 at 12:30:42PM +0200, Danny Milosavljevic wrote:
> * gnu/packages/ldc.scm (ldc): Update to 0.17.1.

With this patch, LDC fails to build on my x86_64 machine with the
familiar errors about isnan and isinf:

[ 11%] Building CXX object CMakeFiles/LDCShared.dir/dmd2/scope.c.o
/gnu/store/frrj3bfbmg5vrd0flh9cf8j64h7cr2v4-gcc-4.9.3/bin/c++   -DDMDV2 
-DHAVE_SC_ARG_MAX -DIN_LLVM 
-DLDC_INSTALL_PREFIX=\"/gnu/store/4p7hh4a7dyp2wg7zd08lvlxafayrjznx-ldc-0.17.1\" 
-DLDC_LLVM_VER=307 
-DLLVM_INTRINSIC_TD_PATH=\"/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include\"
 -DOPAQUE_VTBLS -D__LITTLE_ENDIAN__ 
-I/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/. 
-I/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2 
-I/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root 
-I/tmp/guix-build-ldc-0.17.1.drv-0/build/dmd2 
-I/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1 -isystem 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include -isystem 
/gnu/store/1v4anv1dwvskkav1zj08gicwaibachr1-libconfig-1.5/include  -O2 -g 
-DNDEBUG   -I/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include  
-fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter 
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic 
-Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11 
-ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -fno-rtti  
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS   -w -DPOSIX -DLDC_POSIX  -o 
CMakeFiles/LDCShared.dir/dmd2/scope.c.o -c 
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/scope.c
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c: In static member 
function ‘static int Port::isNan(double)’:
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:773:19: error: 
‘isnan’ was not declared in this scope
 return isnan(r);
   ^
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:773:19: note: 
suggested alternative:
In file included from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/DataTypes.h:35:0,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/SwapByteOrder.h:19,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/MathExtras.h:18,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/SmallVector.h:20,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/ArrayRef.h:14,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/APInt.h:19,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/APFloat.h:20,
 from 
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:677:
/gnu/store/frrj3bfbmg5vrd0flh9cf8j64h7cr2v4-gcc-4.9.3/include/c++/cmath:632:5: 
note:   ‘std::isnan’
 isnan(_Tp __x)
 ^
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c: In static member 
function ‘static int Port::isNan(longdouble)’:
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:789:19: error: 
‘isnan’ was not declared in this scope
 return isnan(r);
   ^
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:789:19: note: 
suggested alternative:
In file included from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/DataTypes.h:35:0,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/SwapByteOrder.h:19,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/MathExtras.h:18,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/SmallVector.h:20,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/ArrayRef.h:14,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/APInt.h:19,
 from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/ADT/APFloat.h:20,
 from 
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:677:
/gnu/store/frrj3bfbmg5vrd0flh9cf8j64h7cr2v4-gcc-4.9.3/include/c++/cmath:632:5: 
note:   ‘std::isnan’
 isnan(_Tp __x)
 ^
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c: In static member 
function ‘static int Port::isInfinity(double)’:
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:817:19: error: 
‘isinf’ was not declared in this scope
 return isinf(r);
   ^
/tmp/guix-build-ldc-0.17.1.drv-0/ldc-0.17.1/dmd2/root/port.c:817:19: note: 
suggested alternative:
In file included from 
/gnu/store/vy5wrh1igqlcswxi6bmfdl16frpjw7nf-llvm-3.7.1/include/llvm/Support/DataTypes.h:35:0,
 from