View Single Post
Posts: 26 | Thanked: 8 times | Joined on Nov 2013 @ Argentina
#4
Thanks!!
now madde & clang 3.5:

Code:
#!/bin/bash

# Compiler wrapper for using clang within a cmake-based buildsystem for producing MeeGo Harmattan packages
# Written by Jan Kundrát <jkt@flaska.net> during a sleepless night
# Licensed under a three-clause BSD license
#
#
# 1) Create a new Madde target, i.e. "clang-rm680", a blank directory within ~/QtSDK/Madde/targets/
#
# 2) Set up the following directory structure:
# jkt@svist ~/QtSDK/Madde/targets/clang-rm680 $ tree
# .
# |-- bin
# |   |-- addr2line -> ../../harmattan_10.2011.34-1_rt1.2/bin/addr2line
# |   |-- ar -> ../../harmattan_10.2011.34-1_rt1.2/bin/ar
# |   |-- as -> ../../harmattan_10.2011.34-1_rt1.2/bin/as
# |   |-- c++
# |   |-- c++filt -> ../../harmattan_10.2011.34-1_rt1.2/bin/c++filt
# |   |-- cc -> ../../harmattan_10.2011.34-1_rt1.2/bin/cc
# |   |-- cpp -> ../../harmattan_10.2011.34-1_rt1.2/bin/cpp
# |   |-- g++ -> ../../harmattan_10.2011.34-1_rt1.2/bin/g++
# |   |-- gcc -> ../../harmattan_10.2011.34-1_rt1.2/bin/gcc
# |   |-- gccbug -> ../../harmattan_10.2011.34-1_rt1.2/bin/gccbug
# |   |-- gcov -> ../../harmattan_10.2011.34-1_rt1.2/bin/gcov
# |   |-- gdb -> ../../harmattan_10.2011.34-1_rt1.2/bin/gdb
# |   |-- gdbtui -> ../../harmattan_10.2011.34-1_rt1.2/bin/gdbtui
# |   |-- gprof -> ../../harmattan_10.2011.34-1_rt1.2/bin/gprof
# |   |-- ld -> ../../harmattan_10.2011.34-1_rt1.2/bin/ld
# |   |-- lrelease -> ../../harmattan_10.2011.34-1_rt1.2/bin/lrelease
# |   |-- lupdate -> ../../harmattan_10.2011.34-1_rt1.2/bin/lupdate
# |   |-- mgen -> ../../harmattan_10.2011.34-1_rt1.2/bin/mgen
# |   |-- mmoc -> ../../harmattan_10.2011.34-1_rt1.2/bin/mmoc
# |   |-- mmoc.pl -> ../../harmattan_10.2011.34-1_rt1.2/bin/mmoc.pl
# |   |-- moc -> ../../harmattan_10.2011.34-1_rt1.2/bin/moc
# |   |-- nm -> ../../harmattan_10.2011.34-1_rt1.2/bin/nm
# |   |-- objcopy -> ../../harmattan_10.2011.34-1_rt1.2/bin/objcopy
# |   |-- objdump -> ../../harmattan_10.2011.34-1_rt1.2/bin/objdump
# |   |-- qmake -> ../../harmattan_10.2011.34-1_rt1.2/bin/qmake
# |   |-- qt.conf -> ../../harmattan_10.2011.34-1_rt1.2/bin/qt.conf
# |   |-- ranlib -> ../../harmattan_10.2011.34-1_rt1.2/bin/ranlib
# |   |-- rcc -> ../../harmattan_10.2011.34-1_rt1.2/bin/rcc
# |   |-- readelf -> ../../harmattan_10.2011.34-1_rt1.2/bin/readelf
# |   |-- size -> ../../harmattan_10.2011.34-1_rt1.2/bin/size
# |   |-- strings -> ../../harmattan_10.2011.34-1_rt1.2/bin/strings
# |   |-- strip -> ../../harmattan_10.2011.34-1_rt1.2/bin/strip
# |   `-- uic -> ../../harmattan_10.2011.34-1_rt1.2/bin/uic
# |-- config.sh -> ../harmattan_10.2011.34-1_rt1.2/config.sh
# |-- information -> ../harmattan_10.2011.34-1_rt1.2/information
# |-- lib -> ../harmattan_10.2011.34-1_rt1.2/lib
# `-- specs -> ../harmattan_10.2011.34-1_rt1.2/specs
#
# 3) Put this file into the bin/c++
#
# 4) When building, use "clang-rm680" as the Madde target

# crude hack for detecting whether to forward this to GCC's c++ in case it's about linking...
echo "${@}" | grep -q -E -- '-rdynamic|-soname'
if [[ $? -eq 1 ]]; then
    # Funny fact: clang 3.3 doesn't do exceptions on ARM by default    
    # See http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-February/059015.html
    # and the rest of the thread    
    clang++ -target armv7l-linux-gnueabi -mfloat-abi=hard --sysroot=${SYSROOT_DIR} -integrated-as $@

    #-mllvm -arm-enable-ehabi -mllvm -arm-enable-ehabi-descriptors no need in 3.5.0 http://llvm.org/releases/3.5.0/docs/ReleaseNotes.html
    # resource http://clang.llvm.org/docs/CrossCompilation.html    
    # Theoretically, we could perhaps pass the -B $(dirname "${BASH_SOURCE[0]}")
    # but that should not be needed as we really want to delegate the linking to
    # the GNU toolchain.
    # This delegation is required because I have no idea how to persuade clang++
    # to not strip the resulting ELFs
else
    $(dirname $(readlink -f $(dirname "${BASH_SOURCE[0]}")/ld))/c++ $@
fi
 

The Following User Says Thank You to gdelca5 For This Useful Post: