Skip to contentSkip to conversation

tclibc-baremetal.inc: Remove BASEDEPENDS on compilerlibs

PATCH In review Nathan Rossi 2 participants 3 messages Sep 10, 2018 – Sep 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tclibc-baremetal.inc: Remove BASEDEPENDS on compilerlibs

Without a libc the gcc-runtime provider of compilerlibs does not compile. As such avoid the default dependence on the virtual/${TARGET_PREFIX}compilerlibs provider.

---
 meta/conf/distro/include/tclibc-baremetal.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/distro/include/tclibc-baremetal.inc +3 -0
index b00917913f..e04f8c8812 100644
@@ -21,6 +21,9 @@ LIBC_DEPENDENCIES = ""
 EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
 DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
 
+# certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
+BASEDEPENDS_remove_class-target = "virtual/${TARGET_PREFIX}compilerlibs"
+
 TARGET_OS = "elf"
 TARGET_OS_arm = "eabi"
 

---
2.18.0

#1 lore raw
Quoted 5 lines · Nathan Rossi

Without a libc the gcc-runtime provider of compilerlibs does not compile. As such avoid the default dependence on the virtual/${TARGET_PREFIX}compilerlibs provider.

compilerlibs is compiler runtime, do we not have crtstuff and libgcc for baremetal ?

Quoted 26 lines
---
 meta/conf/distro/include/tclibc-baremetal.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/distro/include/tclibc-baremetal.inc +3 -1
index b00917913f..e04f8c8812 100644
@@ -21,6 +21,9 @@ LIBC_DEPENDENCIES = ""
 EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
 DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
 
+# certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
+BASEDEPENDS_remove_class-target = "virtual/${TARGET_PREFIX}compilerlibs"
+
 TARGET_OS = "elf"
 TARGET_OS_arm = "eabi"
 
---

2.18.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 10 lines · Khem Raj
Quoted 5 lines · Nathan Rossi

Without a libc the gcc-runtime provider of compilerlibs does not compile. As such avoid the default dependence on the virtual/${TARGET_PREFIX}compilerlibs provider.

compilerlibs is compiler runtime, do we not have crtstuff and libgcc for baremetal ?

At first I thought that might be an issue, but it turns out that the libgcc code (and 'crt(begin|end|i|n).o') is built by the libgcc recipe and populated into the sysroot from that recipe. 'compilerlibs' which is provided by gcc-runtime only handles other libraries (libgomp, libatomic, libstdc++v3, etc).

A larger problem that really prevents gcc-runtime from being used at all is the lack of libc (by choice of course) and because of that the lack of the crt[01].o objects which the compiler specs for "elfos". Which means the tclibc-baremetal is only practically useful with "-nostdlib" or equivalent being provided (otherwise by default it attempts to use "-lc" and "crt0.o"). Even with -nostdlib none of the gcc-runtime libraries compile (missing support for various libc features). Setting "-nostdlib" in tclibc-baremetal via TARGET_CC_ARGS might be worth adding as well?

Although I might be missing something? Since my use case for baremetal is just a c compiler and linker without any start objects or library code.

Thanks,
Nathan

Quoted 27 lines
Quoted 27 lines
---
 meta/conf/distro/include/tclibc-baremetal.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/distro/include/tclibc-baremetal.inc +3 -1
index b00917913f..e04f8c8812 100644
@@ -21,6 +21,9 @@ LIBC_DEPENDENCIES = ""
 EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
 DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
 
+# certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
+BASEDEPENDS_remove_class-target = "virtual/${TARGET_PREFIX}compilerlibs"
+
 TARGET_OS = "elf"
 TARGET_OS_arm = "eabi"
 
---

2.18.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core