Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Rev 11 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 12
Line 319... Line 319...
319
 
319
 
320
# patch libcxx/include/locale
320
# patch libcxx/include/locale
321
# replace [!defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)] with [!defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__QNX__)]
321
# replace [!defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)] with [!defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__QNX__)]
322
# RATIONALE: QNX doesn't have catopen() to open a "message catalog"
322
# RATIONALE: QNX doesn't have catopen() to open a "message catalog"
323
backup_and_patch_if_necessary "libcxx/include/locale" __QNXNTO__ \
323
backup_and_patch_if_necessary "libcxx/include/locale" __QNXNTO__ \
324
        's/\!defined\(__BIONIC__\) \&\& \!defined\(_NEWLIB_VERSION\) \&\& \!defined\(__EMSCRIPTEN__\)/\!defined\(__BIONIC__\) \&\& \!defined\(_NEWLIB_VERSION\) \&\& \!defined\(__EMSCRIPTEN__\) \&\& \!defined\(__QNX__\)/g'
324
        's/\!defined\(__BIONIC__\) \&\& \!defined\(_NEWLIB_VERSION\) \&\& \!defined\(__EMSCRIPTEN__\)/!defined\(__BIONIC__\) \&\& !defined\(_NEWLIB_VERSION\) \&\& !defined\(__EMSCRIPTEN__\) \&\& !defined\(__QNXNTO__\)/g'
-
 
325
 
-
 
326
# patch libcxx/include/setjmp.h
-
 
327
# replace [#endif // __cplusplus] with [#ifdef __QNXNTO__\n#undef longjmp\n[[noreturn]] inline void longjmp(jmp_buf env, int val) { ::siglongjmp(env, val); }\n#endif\n\n#endif // __cplusplus]
-
 
328
# RATIONALE: QNX doesn't have longjmp() (or has it? it rather seems they don't *WANT* to expose it... check that) but instead siglongjmp()
-
 
329
backup_and_patch_if_necessary "libcxx/include/setjmp.h" __QNXNTO__ \
-
 
330
        's|#endif // __cplusplus|#ifdef __QNXNTO__\n#undef longjmp\n\[\[noreturn\]\] inline void longjmp\(jmp_buf env, int val\) { ::siglongjmp\(env, val\); }\n#endif\n\n#endif // __cplusplus|g'
-
 
331
 
-
 
332
# patch libcxx/include/__chrono/high_resolution_clock.h
-
 
333
# replace [#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK] with [#if defined(__QNXNTO__)\nclass _LIBCPP_VISIBILITY("default") high_resolution_clock\n{\npublic:\n    typedef nanoseconds duration;\n    typedef duration::rep rep;\n    typedef duration::period period;\n    typedef chrono::time_point<high_resolution_clock, duration> time_point;\n    static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;\n    static time_point now() _NOEXCEPT;\n};\n#elif !defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK)]
-
 
334
# RATIONALE: QNX provides its own implementation of a high resolution clock for libc++'s std::chrono, so better use it
-
 
335
backup_and_patch_if_necessary "libcxx/include/__chrono/high_resolution_clock.h" __QNXNTO__ \
-
 
336
        's/#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK/#if defined\(__QNXNTO__\)\nclass _LIBCPP_VISIBILITY\("default"\) high_resolution_clock\n{\npublic:\n    typedef nanoseconds duration;\n    typedef duration::rep rep;\n    typedef duration::period period;\n    typedef chrono::time_point<high_resolution_clock, duration> time_point;\n    static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;\n    static time_point now\(\) _NOEXCEPT;\n};\n#elif !defined\(_LIBCPP_HAS_NO_MONOTONIC_CLOCK\)/g'
325
 
337
 
326
# now configure LLVM -- and use ccache
338
# now configure LLVM -- and use ccache
327
# TAKE NOTE: THE VALUE OF LIBCXX*_ADDITIONAL_COMPILE_FLAGS CAN ONLY HAVE ONE FLAG! It is passed by CMake surrounded by quotes to the compiler, e.g. -Dflag "-Dflag1 -Dflag2" -Dflag which is WRONG.
339
# TAKE NOTE: THE VALUE OF LIBCXX*_ADDITIONAL_COMPILE_FLAGS CAN ONLY HAVE ONE FLAG! It is passed by CMake surrounded by quotes to the compiler, e.g. -Dflag "-Dflag1 -Dflag2" -Dflag which is WRONG.
328
echo "Configuring LLVM build..."
340
echo "Configuring LLVM build..."
329
export CCACHE_DIR="$(realpath "../${LLVM_SOURCES_DIR}/.ccache")"
341
export CCACHE_DIR="$(realpath "../${LLVM_SOURCES_DIR}/.ccache")"
Line 337... Line 349...
337
    -D LLVM_HOST_TRIPLE="${TARGET_TRIPLE}" \
349
    -D LLVM_HOST_TRIPLE="${TARGET_TRIPLE}" \
338
    -D LLVM_ENABLE_PROJECTS="clang;lld" \
350
    -D LLVM_ENABLE_PROJECTS="clang;lld" \
339
    -D LLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
351
    -D LLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
340
    -D LLVM_TARGETS_TO_BUILD="AArch64;X86" \
352
    -D LLVM_TARGETS_TO_BUILD="AArch64;X86" \
341
    -D COMPILER_RT_BUILD_SANITIZERS="OFF" \
353
    -D COMPILER_RT_BUILD_SANITIZERS="OFF" \
-
 
354
    -D COMPILER_RT_BUILD_XRAY="OFF" \
342
    -D LIBCXX_ADDITIONAL_COMPILE_FLAGS="-D_QNX_SOURCE=1" \
355
    -D LIBCXX_ADDITIONAL_COMPILE_FLAGS="-D_QNX_SOURCE=1" \
343
    -D LIBCXXABI_ADDITIONAL_COMPILE_FLAGS="-D_QNX_SOURCE=1" \
356
    -D LIBCXXABI_ADDITIONAL_COMPILE_FLAGS="-D_QNX_SOURCE=1" \
344
    -G Ninja \
357
    -G Ninja \
345
    "../${LLVM_SOURCES_DIR}/llvm" || exit 1
358
    "../${LLVM_SOURCES_DIR}/llvm" || exit 1
346
 
359