ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

Update to LDC 1.20.0 stable release #109

Closed WebDrake closed 4 years ago

WebDrake commented 4 years ago

ldc2.conf has been updated to bring it in line with the upstream LDC build, adding a separate section for 32-bit config and dropping the now unneeded --no-warn-mismatch.

https://github.com/ldc-developers/ldc/releases/tag/v1.20.0

WebDrake commented 4 years ago

Updates to ldc2.conf are in line with discussion in https://github.com/ldc-developers/ldc2.snap/issues/102.

I'd like to also update to LLVM 10.0.1 but I keep getting build errors for SPIRV-LLVM-Translator:

[2336/3819] Building CXX object projects/SPIRV-LLVM-Translator/lib/SPIRV/CMakeFiles/LLVMSPIRVLib.dir/VectorComputeUtil.cpp.o
FAILED: /usr/bin/c++   -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/SPIRV-LLVM-Translator/lib/SPIRV -I/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV -Iinclude -I/root/parts/llvm/src/llvm/include -I/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/include -I/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV -I/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/Mangler -static-libstdc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG    -fno-exceptions -fno-rtti -std=c++14 -MMD -MT projects/SPIRV-LLVM-Translator/lib/SPIRV/CMakeFiles/LLVMSPIRVLib.dir/VectorComputeUtil.cpp.o -MF projects/SPIRV-LLVM-Translator/lib/SPIRV/CMakeFiles/LLVMSPIRVLib.dir/VectorComputeUtil.cpp.o.d -o projects/SPIRV-LLVM-Translator/lib/SPIRV/CMakeFiles/LLVMSPIRVLib.dir/VectorComputeUtil.cpp.o -c /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.cpp
/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.cpp:68:69: error: specialization of 'template<class Ty1, class Ty2, class Identifier> void SPIRV::SPIRVMap<Ty1, Ty2, Identifier>::init()' in different namespace [-fpermissive]
 template <> inline void SPIRVMap<VCRoundMode, VCFloatControl>::init() {
                                                                     ^
In file included from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVOpCode.h:43:0,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVEnum.h:44,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVInternal.h:43,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.h:43,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.cpp:39:
/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVUtil.h:84:8: error:   from definition of 'template<class Ty1, class Ty2, class Identifier> void SPIRV::SPIRVMap<Ty1, Ty2, Identifier>::init()' [-fpermissive]
   void init();
        ^
/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.cpp:74:69: error: specialization of 'template<class Ty1, class Ty2, class Identifier> void SPIRV::SPIRVMap<Ty1, Ty2, Identifier>::init()' in different namespace [-fpermissive]
 template <> inline void SPIRVMap<VCFloatMode, VCFloatControl>::init() {
                                                                     ^
In file included from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVOpCode.h:43:0,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVEnum.h:44,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVInternal.h:43,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.h:43,
                 from /root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/VectorComputeUtil.cpp:39:
/root/parts/llvm/src/llvm/projects/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVUtil.h:84:8: error:   from definition of 'template<class Ty1, class Ty2, class Identifier> void SPIRV::SPIRVMap<Ty1, Ty2, Identifier>::init()' [-fpermissive]
   void init();
        ^

Can anyone advise what the problem is? It's not obvious from the current LLVM Azure Pipelines setup.

JohanEngelen commented 4 years ago

@thewilsonator Do you know if building SPIRV is broken in LLVM 10.0.1?

kinke commented 4 years ago

There haven't been any issues wrt. SPIRV for 10.0.1. Are you sure you haven't just forgotten a git submodule update?

kinke commented 4 years ago

Btw 1.20.0 was bad, there's 1.20.1.

WebDrake commented 4 years ago

The submodule update should happen automatically when the code is first checked out (I'll verify, though). Are there any differences in terms of build setup, compiler to use, etc. that might make a difference?

kinke commented 4 years ago

Btw, LLVM 10 for < 1.21 final isn't recommended because of https://github.com/ldc-developers/ldc/issues/3397. - There might have been some host compiler bumps (even a jump from C++11 to 14), but I don't remember exactly (edit: assuming you're trying to upgrade from v9) - compare the Azure scripts if in doubt. The Shippable host compiler hasn't been updated in ages though (g++ 8).

WebDrake commented 4 years ago

OK, I'll save LLVM 10 for the 1.21 release then. The C(++) compiler might be an issue though: the setup is probably installing g++ 5.4.0.

How is the LLVM CI installing g++ 8? I just see a regular apt-get install g++ so I don't follow why it would be g++ 8, given that the VM image is ubuntu-16.04 and the default g++ in 16.04 is 5.4.0

WebDrake commented 4 years ago

Updated the patch to use LDC 1.20.1.

kinke commented 4 years ago

Wrt. LLVM and future snaps, note that I've switched to another repo with v9.0.1, and that monorepo required some changes. These changes shouldn't affect anyone using the custom src tarball though (instead of git), so I recommend simply using that one.

Wrt. g++ 8, that's for Shippable (the AArch64 CI service) and is simply due to their custom image. For Windows and Linux x86, I use clang (v10 now for 10.0.1, was v9 for 10.0.0).

WebDrake commented 4 years ago

Yes, I'm already using the llvm-project repo. I can try using the src tarball instead though.