]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gcc-cross-canadian: Install gcc/g++ wrappers for musl
authorKhem Raj <raj.khem@gmail.com>
Thu, 20 Aug 2020 08:01:14 +0000 (01:01 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 22 Aug 2020 14:46:51 +0000 (15:46 +0100)
gcc needs -mmusl option to be passed in SDK since we ship crossdk compiler
configured for glibc by default, this helps in creating correct
compiler defaults for musl based SDK compilers

[YOCTO #13459]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Leon Woestenberg <leon@sidebranch.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-cross-canadian.inc

index db17ae468513de3ade6b209dcfc00f3d92cc2dfb..d3875c94d346a65790aea53a4b23490ef9179c4c 100644 (file)
@@ -139,6 +139,29 @@ do_install () {
        chown -R root:root ${D}
        
        cross_canadian_bindirlinks
+
+       for i in linux ${CANADIANEXTRAOS}
+       do
+               for v in ${CANADIANEXTRAVENDOR}
+               do
+                       d=${D}${bindir}/../${TARGET_ARCH}$v-$i
+                       install -d $d
+                       for j in ${TARGET_PREFIX}gcc${EXEEXT} ${TARGET_PREFIX}g++${EXEEXT}
+                       do
+                               p=${TARGET_ARCH}$v-$i-`echo $j | sed -e s,${TARGET_PREFIX},,`
+                               case $i in
+                               *musl*)
+                                       rm -rf $d/$p
+                                       echo "#!/usr/bin/env sh" > $d/$p
+                                       echo "exec \`dirname \$0\`/../${TARGET_SYS}/$j -mmusl \$@" >> $d/$p
+                                       chmod 0755 $d/$p
+                                       ;;
+                               *)
+                                       ;;
+                               esac
+                       done
+               done
+       done
 }
 
 ELFUTILS = "nativesdk-elfutils"