From a3005fa1a62a88a94f2078ecff7b64c9fae1f6cd Mon Sep 17 00:00:00 2001 From: Shin Umeda Date: Thu, 12 Feb 2026 20:13:47 -0800 Subject: [PATCH 1/3] add oslib option, fix crt0 flag --- prebuilt/conanfile.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/prebuilt/conanfile.py b/prebuilt/conanfile.py index 004d7d7..c9f3c82 100644 --- a/prebuilt/conanfile.py +++ b/prebuilt/conanfile.py @@ -12,14 +12,21 @@ class PrebuiltGccPicolibc(ConanFile): package_type = "static-library" build_policy = "missing" options = { + "oslib": [ + None, + "semihost", + ], "crt0": [ + "default", + "none", "semihost", "hosted", "minimal", ] } default_options = { - "crt0": "semihost", + "oslib": None, + "crt0": "default", } def validate(self): @@ -62,11 +69,17 @@ def package_info(self): PICOLIB_CPP_SPECS = Path(self.package_folder) / 'lib' / 'gcc' / \ 'arm-none-eabi' / LONG_VERSION / 'picolibcpp.specs' - self.cpp_info.exelinkflags = [ + flags = [ f"-specs={PICOLIB_CPP_SPECS}", f"--picolibc-prefix={PREFIX}", - f"--oslib={str(self.options.crt0)}", + f"--oslib={str(self.options.oslib)}", ] + if not self.options.crt0 == "default": + flags += f"--crt0={str(self.options.crt0)}" + + self.cpp_info.exelinkflags = flags + self.cpp_info.cppflags = flags + self.cpp_info.cflags = flags self.output.info(f"link flags: {self.cpp_info.exelinkflags}") self.output.info(f"crt0: {str(self.options.crt0)}") From 62b713fb2714aff39e48818d1d23a58d9b1fb3ec Mon Sep 17 00:00:00 2001 From: Shin Umeda Date: Thu, 12 Feb 2026 20:20:58 -0800 Subject: [PATCH 2/3] fix oslib stringification --- prebuilt/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prebuilt/conanfile.py b/prebuilt/conanfile.py index c9f3c82..188a09e 100644 --- a/prebuilt/conanfile.py +++ b/prebuilt/conanfile.py @@ -72,8 +72,10 @@ def package_info(self): flags = [ f"-specs={PICOLIB_CPP_SPECS}", f"--picolibc-prefix={PREFIX}", - f"--oslib={str(self.options.oslib)}", + ] + if self.options.oslib is not None: + flags += f"--oslib={str(self.options.oslib)}" if not self.options.crt0 == "default": flags += f"--crt0={str(self.options.crt0)}" From d5bdc379cdca64b48c17dc8e8d8b30c7271a4d61 Mon Sep 17 00:00:00 2001 From: Shin Umeda Date: Thu, 12 Feb 2026 20:31:53 -0800 Subject: [PATCH 3/3] fix None comparison --- prebuilt/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prebuilt/conanfile.py b/prebuilt/conanfile.py index 188a09e..4127bc4 100644 --- a/prebuilt/conanfile.py +++ b/prebuilt/conanfile.py @@ -74,10 +74,10 @@ def package_info(self): f"--picolibc-prefix={PREFIX}", ] - if self.options.oslib is not None: - flags += f"--oslib={str(self.options.oslib)}" + if self.options.oslib.value is not None: + flags += [f"--oslib={str(self.options.oslib)}"] if not self.options.crt0 == "default": - flags += f"--crt0={str(self.options.crt0)}" + flags += [f"--crt0={str(self.options.crt0)}"] self.cpp_info.exelinkflags = flags self.cpp_info.cppflags = flags