hrydgard / ppsspp-glslang

This contains the latest glslang compiler from the Vulkan SDK.
1 stars 1 forks source link

Fails to build with libc++ >= 3.8 #1

Open jbeich opened 7 years ago

jbeich commented 7 years ago

FreeBSD 11.0 or later include https://github.com/llvm-mirror/libcxx/commit/14ba0ad6894e which causes the following error:

$ c++ -DGLSLANG_OSINCLUDE_UNIX -fPIC -std=c++11 -c glslang/MachineIndependent/glslang_tab.cpp
In file included from C:/Projects/glslang/glslang/MachineIndependent/glslang.y:58:
In file included from glslang/MachineIndependent/SymbolTable.h:68:
In file included from glslang/MachineIndependent/../Include/intermediate.h:50:
In file included from glslang/MachineIndependent/../Include/../Include/Types.h:43:
glslang/MachineIndependent/../Include/../Public/ShaderLang.h:76:22: warning: calling convention
      '__fastcall__' ignored for this target [-Wignored-attributes]
SH_IMPORT_EXPORT int __fastcall ShFinalize();
                     ^
/usr/include/sys/cdefs.h:387:35: note: expanded from macro '__fastcall'
#define __fastcall      __attribute__((__fastcall__))
                                       ^
In file included from C:/Projects/glslang/glslang/MachineIndependent/glslang.y:58:
In file included from glslang/MachineIndependent/SymbolTable.h:67:
In file included from glslang/MachineIndependent/../Include/../Include/Common.h:75:
/usr/include/c++/v1/map:820:5: error: static_assert failed "Allocator::value_type must be same type
      as value_type"
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glslang/MachineIndependent/../Include/../Include/Common.h:166:21: note: in instantiation of template
      class 'std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, std::__1::less<std::__1::basic_string<char,
      std::__1::char_traits<char>, glslang::pool_allocator<char> > >,
      glslang::pool_allocator<std::__1::pair<std::__1::basic_string<char,
      std::__1::char_traits<char>, glslang::pool_allocator<char> >, std::__1::basic_string<char,
      std::__1::char_traits<char>, glslang::pool_allocator<char> > > > >' requested here
class TMap : public std::map<K, D, CMP, pool_allocator<std::pair<K, D> > > {
                    ^
glslang/MachineIndependent/../Include/intermediate.h:865:27: note: in instantiation of template class
      'glslang::TMap<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, std::__1::less<std::__1::basic_string<char,
      std::__1::char_traits<char>, glslang::pool_allocator<char> > > >' requested here
    ~TIntermAggregate() { delete pragmaTable; }
                          ^
In file included from C:/Projects/glslang/glslang/MachineIndependent/glslang.y:58:
In file included from glslang/MachineIndependent/SymbolTable.h:67:
In file included from glslang/MachineIndependent/../Include/../Include/Common.h:75:
/usr/include/c++/v1/map:820:5: error: static_assert failed "Allocator::value_type must be same type
      as value_type"
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glslang/MachineIndependent/../Include/../Include/Common.h:166:21: note: in instantiation of template
      class 'std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, glslang::TExtensionBehavior,
      std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> > >,
      glslang::pool_allocator<std::__1::pair<std::__1::basic_string<char,
      std::__1::char_traits<char>, glslang::pool_allocator<char> >, glslang::TExtensionBehavior> > >'
      requested here
class TMap : public std::map<K, D, CMP, pool_allocator<std::pair<K, D> > > {
                    ^
glslang/MachineIndependent/ParseHelper.h:325:39: note: in instantiation of template class
      'glslang::TMap<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> >, glslang::TExtensionBehavior,
      std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>,
      glslang::pool_allocator<char> > > >' requested here
    TMap<TString, TExtensionBehavior> extensionBehavior;    // for each extension string, wha...
                                      ^
1 warning and 2 errors generated.
hrydgard commented 7 years ago

Is this fixed by your pull request that I just merged, or a separate issue?

I could try upgrading to the latest glslang I suppose, and see if they've fixed it upstream.

jbeich commented 7 years ago

A separate issue I don't have a ready fix for. It probably affects OS X as well with new enough clang/libc++.

jbeich commented 7 years ago

KhronosGroup/glslang@ec1476b70603 is enough to unbreak build.

hrydgard commented 7 years ago

Nice one!

jbeich commented 7 years ago

Can you either cherry-pick the fix or update? I've verified KhronosGroup/glslang@432576fdce62 snapshot builds fine on FreeBSD with either Clang 3.9.1 or GCC 6.2.0.

hrydgard commented 7 years ago

Yup, I will soon.

hrydgard commented 7 years ago

I'm re-pointing PPSSPP to build from my proper glslang fork at https://github.com/hrydgard/glslang in new pull request https://github.com/hrydgard/ppsspp/pull/9171 .