Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
Merge branch 'revisit'
Browse files Browse the repository at this point in the history
Gnimuc committed Apr 11, 2019

Verified

This commit was signed with the committer’s verified signature.
rouault Even Rouault
2 parents 910974b + e724b44 commit e74795b
Showing 2 changed files with 50 additions and 54 deletions.
8 changes: 4 additions & 4 deletions build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -93,9 +93,6 @@ cmake .. ${CMAKE_FLAGS}
make -j${nproc} VERBOSE=1
make install VERBOSE=1
mkdir -p ${prefix}/usr/lib
ln -s ${prefix}/lib/* ${prefix}/usr/lib/
mkdir -p ${prefix}/src/clang-6.0.1/include
mkdir -p ${prefix}/src/llvm-6.0.1/include
mkdir -p ${prefix}/build/clang-6.0.1/lib/clang/6.0.1/include
@@ -104,6 +101,7 @@ mkdir -p ${prefix}/build/llvm-6.0.1/include
cp -r $WORKSPACE/srcdir/llvm-6.0.1.src/tools/clang/include/* ${prefix}/src/clang-6.0.1/include/
cp -r $WORKSPACE/srcdir/llvm-6.0.1.src/include/* ${prefix}/src/llvm-6.0.1/include/
cp -r $WORKSPACE/srcdir/LLVMBinary/include/* ${prefix}/build/llvm-6.0.1/include/
cp -r $WORKSPACE/srcdir/LLVMBinary/lib/* ${prefix}/lib/
cp -r $WORKSPACE/srcdir/LLVMBinary/lib/clang/6.0.1/include/* ${prefix}/build/clang-6.0.1/lib/clang/6.0.1/include/
cp -r ${prefix}/build/llvm-6.0.1/include/* ${prefix}/build/clang-6.0.1/include/
@@ -112,13 +110,15 @@ make -f GenerateConstants.Makefile BASE_LLVM_BIN=$WORKSPACE/srcdir/LLVMBinary BA
cp $WORKSPACE/srcdir/clang_constants.jl ${prefix}/build/
if [[ ${target} == *mingw32* ]] && [[ ${nbits} == 64 ]]; then
cp -r $WORKSPACE/srcdir/LLVMBinary/bin/* ${prefix}/bin
mkdir -p ${prefix}/mingw/include
mkdir -p ${prefix}/mingw/sys-root/include
cp -r /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/include/* ${prefix}/mingw/include/
cp -r /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/include/* ${prefix}/mingw/sys-root/include/
fi
if [[ ${target} == *mingw32* ]] && [[ ${nbits} == 32 ]]; then
cp -r $WORKSPACE/srcdir/LLVMBinary/bin/* ${prefix}/bin
mkdir -p ${prefix}/mingw/include
mkdir -p ${prefix}/mingw/sys-root/include
cp -r /opt/i686-w64-mingw32/i686-w64-mingw32/include/* ${prefix}/mingw/include/
@@ -129,7 +129,7 @@ fi

platforms = [
# BinaryProvider.Linux(:i686; libc=:glibc, compiler_abi=CompilerABI(:gcc7)),
# BinaryProvider.Linux(:x86_64; libc=:glibc, compiler_abi=CompilerABI(:gcc7)),
BinaryProvider.Linux(:x86_64; libc=:glibc, compiler_abi=CompilerABI(:gcc7)),
# BinaryProvider.Linux(:aarch64; libc=:glibc, compiler_abi=CompilerABI(:gcc7)),
# BinaryProvider.Linux(:armv7l; libc=:glibc, compiler_abi=CompilerABI(:gcc7)),
# BinaryProvider.MacOS(:x86_64; compiler_abi=CompilerABI(:gcc7)),
96 changes: 46 additions & 50 deletions libcxxffi/bootstrap.cpp
Original file line number Diff line number Diff line change
@@ -16,25 +16,6 @@
#define _OS_WINDOWS_
#endif

#if defined(_CPU_X86_64_)
# define _P64
#elif defined(_CPU_X86_)
# define _P32
#elif defined(_OS_WINDOWS_)
/* Not sure how to determine pointer size on Windows running ARM. */
# if _WIN64
# define _P64
# else
# define _P32
# endif
#elif __SIZEOF_POINTER__ == 8
# define _P64
#elif __SIZEOF_POINTER__ == 4
# define _P32
#else
# error pointer size not known for your platform / compiler
#endif

#ifdef _OS_WINDOWS_
#define STDCALL __stdcall
# ifdef LIBRARY_EXPORTS
@@ -48,6 +29,7 @@
#endif

#include <iostream>

#include <cstdlib>
#ifdef _OS_WINDOWS_
#include <windows.h>
@@ -154,39 +136,53 @@ struct CxxInstance {
};
const clang::InputKind CKind = clang::InputKind::C;

extern "C" {

#define TYPE_ACCESS(EX,IN) \
JL_DLLEXPORT const clang::Type *EX(CxxInstance *Cxx) { \
return Cxx->CI->getASTContext().IN.getTypePtrOrNull(); \
}

TYPE_ACCESS(cT_char,CharTy)
TYPE_ACCESS(cT_cchar,CharTy)
TYPE_ACCESS(cT_int1,BoolTy)
TYPE_ACCESS(cT_int8,SignedCharTy)
TYPE_ACCESS(cT_uint8,UnsignedCharTy)
TYPE_ACCESS(cT_int16,ShortTy)
TYPE_ACCESS(cT_uint16,UnsignedShortTy)
TYPE_ACCESS(cT_int32,IntTy)
TYPE_ACCESS(cT_uint32,UnsignedIntTy)
#ifdef _P32
TYPE_ACCESS(cT_int64,LongLongTy)
TYPE_ACCESS(cT_uint64,UnsignedLongLongTy)
#if defined(_CPU_X86_64_)
# define _P64
#elif defined(_CPU_X86_)
# define _P32
#elif defined(_OS_WINDOWS_)
/* Not sure how to determine pointer size on Windows running ARM. */
# if _WIN64
# define _P64
# else
# define _P32
# endif
#elif __SIZEOF_POINTER__ == 8
# define _P64
#elif __SIZEOF_POINTER__ == 4
# define _P32
#else
TYPE_ACCESS(cT_int64,LongTy)
TYPE_ACCESS(cT_uint64,UnsignedLongTy)
# error pointer size not known for your platform / compiler
#endif
TYPE_ACCESS(cT_size,getSizeType())
TYPE_ACCESS(cT_int128,Int128Ty)
TYPE_ACCESS(cT_uint128,UnsignedInt128Ty)
TYPE_ACCESS(cT_complex64,FloatComplexTy)
TYPE_ACCESS(cT_complex128,DoubleComplexTy)
TYPE_ACCESS(cT_float32,FloatTy)
TYPE_ACCESS(cT_float64,DoubleTy)
TYPE_ACCESS(cT_void,VoidTy)
TYPE_ACCESS(cT_wint,WIntTy)
} // extern "C"

extern "C" {

TYPE_ACCESS(cT_char,CharTy)
TYPE_ACCESS(cT_cchar,CharTy)
TYPE_ACCESS(cT_int1,BoolTy)
TYPE_ACCESS(cT_int8,SignedCharTy)
TYPE_ACCESS(cT_uint8,UnsignedCharTy)
TYPE_ACCESS(cT_int16,ShortTy)
TYPE_ACCESS(cT_uint16,UnsignedShortTy)
TYPE_ACCESS(cT_int32,IntTy)
TYPE_ACCESS(cT_uint32,UnsignedIntTy)
// #ifdef _P32
TYPE_ACCESS(cT_int64,LongLongTy)
TYPE_ACCESS(cT_uint64,UnsignedLongLongTy)
// #else
// TYPE_ACCESS(cT_int64,LongTy)
// TYPE_ACCESS(cT_uint64,UnsignedLongTy)
// #endif
TYPE_ACCESS(cT_size,getSizeType())
TYPE_ACCESS(cT_int128,Int128Ty)
TYPE_ACCESS(cT_uint128,UnsignedInt128Ty)
TYPE_ACCESS(cT_complex64,FloatComplexTy)
TYPE_ACCESS(cT_complex128,DoubleComplexTy)
TYPE_ACCESS(cT_float32,FloatTy)
TYPE_ACCESS(cT_float64,DoubleTy)
TYPE_ACCESS(cT_void,VoidTy)
TYPE_ACCESS(cT_wint,WIntTy)
}

// Utilities
clang::SourceLocation getTrivialSourceLocation(CxxInstance *Cxx) {

0 comments on commit e74795b

Please sign in to comment.