Skip to contentSkip to conversation

gcc-cross-canadian: Install gcc/g++ wrappers for musl

PATCH In review Alejandro Hernandez Samaniego 2 participants 3 messages May 27, 2021 – May 28, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc-cross-canadian: Install gcc/g++ wrappers for musl

From: Khem Raj <[email protected]>

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]

(From OE-Core rev: e6fbac7aeabe00d8fb734992012dd629a8527b25)

---
 .../gcc/gcc-cross-canadian.inc                | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +23 -0
index 553ef7fe62..c5935b978d 100644
@@ -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"
Signature · 1 line
2.25.1
#1 lore raw

I get an autobuilder failure on core-image-mingw-sdktest, details here:

https://errors.yoctoproject.org/Errors/Details/585665/

Perhaps we need additional patch/patches from master?

Steve

Quoted 58 lines · Alejandro Hernandez Samaniego

From: Khem Raj <[email protected]>

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]

(From OE-Core rev: e6fbac7aeabe00d8fb734992012dd629a8527b25)

---
 .../gcc/gcc-cross-canadian.inc                | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +23 -1
index 553ef7fe62..c5935b978d 100644
@@ -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"
--

2.25.1

#2 lore raw

Perhaps, I will take a look at it.

Thanks

Alejandro

Quoted 70 lines · Steve Sakoman

I get an autobuilder failure on core-image-mingw-sdktest, details here:

https://errors.yoctoproject.org/Errors/Details/585665/

Perhaps we need additional patch/patches from master?

Steve

Quoted 60 lines · Alejandro Hernandez Samaniego

From: Khem Raj <[email protected]>

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]

(From OE-Core rev: e6fbac7aeabe00d8fb734992012dd629a8527b25)

---
  .../gcc/gcc-cross-canadian.inc                | 23 +++++++++++++++++++
  1 file changed, 23 insertions(+)
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +23 -1
index 553ef7fe62..c5935b978d 100644
@@ -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"
--

2.25.1