Closed mgaudet closed 7 years ago
Resolving the GC Type error, gets us into the compiler component, with a number of errors:
[2/760] Building CXX object jitbuilder/CMakeFiles/jitbuilder.dir/compile/Method.cpp.o
FAILED: jitbuilder/CMakeFiles/jitbuilder.dir/compile/Method.cpp.o
/usr/local/opt/ccache/libexec/c++ -DBITVECTOR_BIT_NUMBERING_MSB -DJ9HAMMER -DOSX -DPROD_WITH_ASSUMES -DSUPPORTS_THREAD_LOCAL -DTR_HOST_64BIT -DTR_HOST_X86 -DTR_TARGET_64BIT -DTR_TARGET_X86 -DUT_DIRECT_TRACE_REGISTRATION -D_FILE_OFFSET_BITS=64 -I../jitbuilder/x/amd64 -I../jitbuilder/x -I../jitbuilder -I../compiler/x/amd64 -I../compiler/x -I../compiler -I../ -I. -I.././include -I.././include_core -I.././third_party -Wno-write-strings -std=c++0x -fPIC -pthread -m64 -MD -MT jitbuilder/CMakeFiles/jitbuilder.dir/compile/Method.cpp.o -MF jitbuilder/CMakeFiles/jitbuilder.dir/compile/Method.cpp.o.d -o jitbuilder/CMakeFiles/jitbuilder.dir/compile/Method.cpp.o -c ../jitbuilder/compile/Method.cpp
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/TypeDictionary.hpp:431:23: note: in instantiation of template class 'std::__1::map<const char *, OMR::StructType *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, OMR::StructType *>, TR::Region &> >' requested here
StructMap _structsByName;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/TypeDictionary.hpp:435:23: note: in instantiation of template class 'std::__1::map<const char *, OMR::UnionType *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, OMR::UnionType *>, TR::Region &> >' requested here
UnionMap _unionsByName;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:197:32: note: in instantiation of template class 'std::__1::map<const char *, TR::SymbolReference *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, TR::SymbolReference *>, TR::Region &> >' requested here
SymbolMap _symbols;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:201:32: note: in instantiation of template class 'std::__1::map<const char *, int, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, int>, TR::Region &> >' requested here
ParameterMap _parameterSlot;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:205:32: note: in instantiation of template class 'std::__1::map<const char *, TR::IlType *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, TR::IlType *>, TR::Region &> >' requested here
SymbolTypeMap _symbolTypes;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:209:32: note: in instantiation of template class 'std::__1::map<int, const char *, std::__1::less<int>, TR::typed_allocator<std::__1::pair<int, const char *>, TR::Region &> >' requested here
SlotToSymNameMap _symbolNameFromSlot;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:219:32: note: in instantiation of template class 'std::__1::map<const char *, void *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, void *>, TR::Region &> >' requested here
MemoryLocationMap _memoryLocations;
^
In file included from ../jitbuilder/compile/Method.cpp:25:
In file included from ../compiler/il/SymbolReference.hpp:25:
In file included from ../compiler/il/OMRSymbolReference.hpp:38:
In file included from ../compiler/compile/SymbolReferenceTable.hpp:25:
In file included from ../compiler/compile/OMRSymbolReferenceTable.hpp:37:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:223:32: note: in instantiation of template class 'std::__1::map<const char *, TR::ResolvedMethod *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, TR::ResolvedMethod *>, TR::Region &> >' requested here
FunctionMap _functions;
^
../compiler/ilgen/MethodBuilder.hpp:111:46: error: cannot initialize object parameter of type 'OMR::IlBuilder' with an expression of type 'OMR::MethodBuilder'
void AppendBuilder(TR::IlBuilder *b) { this->OMR::IlBuilder::AppendBuilder(b); }
^~~~
../jitbuilder/compile/Method.cpp:52:16: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
: _fileName(m->getDefiningFile()),
^
../jitbuilder/compile/Method.cpp:53:18: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
_lineNumber(m->getDefiningLine()),
^
../jitbuilder/compile/Method.cpp:54:20: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
_name((char *)m->getMethodName()), // sad cast
^
../jitbuilder/compile/Method.cpp:55:16: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
_numParms(m->getNumParameters()),
^
../jitbuilder/compile/Method.cpp:56:17: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
_parmTypes(m->getParameterTypes()),
^
../jitbuilder/compile/Method.cpp:57:18: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
_returnType(m->getReturnType()),
^
../jitbuilder/compile/Method.cpp:60:18: error: static_cast from 'TR::MethodBuilder *' to 'TR::IlInjector *', which are not related by inheritance, is not allowed
_ilInjector(static_cast<TR::IlInjector *>(m))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../jitbuilder/compile/Method.cpp:161:23: error: cannot initialize object parameter of type 'OMR::MethodBuilder' with an expression of type 'TR::MethodBuilder'
name = (char *) bldr->getSymbolName(slot);
^~~~
17 errors generated.
@lmaisons does the
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../compiler/ilgen/MethodBuilder.hpp:223:32: note: in instantiation of template class 'std::__1::map<const char *, TR::ResolvedMethod *, bool (*)(const char *, const char *), TR::typed_allocator<std::__1::pair<const char *, TR::ResolvedMethod *>, TR::Region &> >' requested here
FunctionMap _functions;
static assert make sense to you?
Hmm, try changing the definition of the allocator type from:
TR::typed_allocator< std::pair< const char *, TR::ResolvedMethod * >, TR::ResolvedMethod * >
to
TR::typed_allocator< std::pair< const char * const, TR::ResolvedMethod * >, TR::ResolvedMethod * >
note the extra const in the pointer type declaration.
I expect all our std::map usages are going to have to be fixed like this :S
appending const
to the first parameter of pair
seems to have done the trick. I'll prepare a PR to fix the rest, and will update on subsequent errors.
With #1712 and #1708, I get a bit further.
mach_port_t
17:31 $ ninja -j1
[1/137] cd /Users/magaudet/open/xcode_fail/build && /usr/local/Cellar/cmake/3.9.0/bin/cmake -Domr_SOURCE_DIR=/Users/magaudet/open/xcode_fail -P /Users/magaudet/open/xcode_fail/cmake/CheckSourceTree.cmake
-- SRC = /Users/magaudet/open/xcode_fail/build
[2/137] Building CXX object fvtest/algotest/CMakeFiles/omralgotest.dir/algoTest.cpp.o
FAILED: fvtest/algotest/CMakeFiles/omralgotest.dir/algoTest.cpp.o
/usr/local/opt/ccache/libexec/c++ -DJ9HAMMER -DOSX -DUT_DIRECT_TRACE_REGISTRATION -D_FILE_OFFSET_BITS=64 -I. -I.././include -I.././include_core -I.././third_party -I../fvtest/omrGtestGlue/. -I../third_party/gtest-1.8.0/include -I../fvtest/util/. -I../omr/. -I../gc/. -Igc -I../gc/base -I../gc/base/segregated -I../gc/base/standard -I../gc/include -I../gc/startup -I../gc/stats -I../gc/structs -I../gc/verbose -I../gc/verbose/handler_standard -I../util/hookable/. -I../thread/. -I../util/hashtable/. -I../util/avl/. -I../example/glue -I../example/glue/.. -fPIE -pthread -m64 -MD -MT fvtest/algotest/CMakeFiles/omralgotest.dir/algoTest.cpp.o -MF fvtest/algotest/CMakeFiles/omralgotest.dir/algoTest.cpp.o.d -o fvtest/algotest/CMakeFiles/omralgotest.dir/algoTest.cpp.o -c ../fvtest/algotest/algoTest.cpp
In file included from ../fvtest/algotest/algoTest.cpp:24:
In file included from ../fvtest/omrGtestGlue/./omrTest.h:49:
In file included from ../third_party/gtest-1.8.0/include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/mutex:189:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__mutex_base:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:156:1: error: unknown type name 'mach_port_t'
mach_port_t __libcpp_thread_get_port();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:300:1: error: unknown type name 'mach_port_t'
mach_port_t __libcpp_thread_get_port() {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:301:12: error: use of undeclared identifier 'pthread_mach_thread_np'
return pthread_mach_thread_np(pthread_self());
^
3 errors generated.
ninja: build stopped: subcommand failed.
I found this recent comment with a fix/hack. Maybe it's vaguely useful :)
It looks like defining _XOPEN_SOURCE
kills the __threading_support
header.
As a minimum example, this will fail to compile:
#define _XOPEN_SOURCE
#include <ostream>
The _XOPEN_SOURCE
that's killing me is coming from omrport.h:912
:
#if !defined(WIN32)
#if defined(OSX)
#define _XOPEN_SOURCE
#endif /* defined(OSX) */
#include <ucontext.h>
#endif /* !WIN32 */
_XOPEN_SOURCE
is required to use ucontext.h
, but we can #undef
it immediately after inclusion, and everything builds.
I don't know why, but /usr/include/pthread.h
(which __threading_support
includes) has the following guards around mach_port_t
:
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#include <sys/_types/_mach_port_t.h>
#include <sys/_types/_sigset_t.h>
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
Has it ever worked? AFAIK we have never had the jit building under cmake + XCode
xcode provides the system compiler toolchain. We're not talking about cmake and xcode projects, the problem is just that the toolchain was upgraded.
There's also a number of new warnings that are popping up:
../fvtest/compilertest/tests/X86OpCodesTest.cpp:4698:4: note: in instantiation of function template specialization 'TestCompiler::OpCodesTest::compileOpCodeMethod<unsigned long long (*)(unsigned long long, unsigned long long)>' requested here
compileOpCodeMethod(_luDiv, _numberOfBinaryArgs, TR::ludiv, "luDiv", _argTypesBinaryLong, TR::Int64, rc);
^
../fvtest/compilertest/tests/OpCodesTest.hpp:204:19: note: parameter of type 'uint16_t' (aka 'unsigned short') is declared here
uint16_t numArgs = 0,
^
../fvtest/compilertest/tests/OpCodesTest.hpp:276:22: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start(args, numArgs);
^
being the most voluminous.
I think this can be closed though; with the merging of #1708, #1712 and #1721 my build of master has now succeeded w/ Xcode 9
Building with Xcode 9 fails in a couple of different places.
Here's my configuration:
DDR Compilation failure
If I disable DDR, the build gets further.
GC Typed Comparsion Error