diff mbox series

[kirkstone] gcc-runtime: Use static dummy libstdc++

Message ID 20230517100548.1431325-1-niko.mauno@vaisala.com
State New, archived
Headers show
Series [kirkstone] gcc-runtime: Use static dummy libstdc++ | expand

Commit Message

Niko Mauno May 17, 2023, 10:05 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>

some standalone targets e.g. riscv64-elf disable shared linking for
baremetal ELF ABI in ld, therefore lets make it a static library

(From OE-Core rev: 3c6219dfcbcbde314648ba8cc54a90b32ea1c952)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-runtime.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Steve Sakoman May 17, 2023, 3:21 p.m. UTC | #1
This patch does not apply to current kirkstone HEAD:

Applying: gcc-runtime: Use static dummy libstdc++
Using index info to reconstruct a base tree...
M meta/recipes-devtools/gcc/gcc-runtime.inc
Falling back to patching base and 3-way merge...
Auto-merging meta/recipes-devtools/gcc/gcc-runtime.inc
CONFLICT (content): Merge conflict in meta/recipes-devtools/gcc/gcc-runtime.inc
error: Failed to merge in the changes.
Patch failed at 0001 gcc-runtime: Use static dummy libstdc++

Steve

On Wed, May 17, 2023 at 12:06 AM Niko Mauno via lists.openembedded.org
<niko.mauno=vaisala.com@lists.openembedded.org> wrote:
>
> From: Khem Raj <raj.khem@gmail.com>
>
> some standalone targets e.g. riscv64-elf disable shared linking for
> baremetal ELF ABI in ld, therefore lets make it a static library
>
> (From OE-Core rev: 3c6219dfcbcbde314648ba8cc54a90b32ea1c952)
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-devtools/gcc/gcc-runtime.inc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> index 8074bf1025..d019b0790b 100644
> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> @@ -68,7 +68,8 @@ do_configure () {
>         # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
>         # tests. Create a dummy empty lib for the purposes of configure.
>         mkdir -p ${WORKDIR}/dummylib
> -       ${CC} -x c /dev/null -nostartfiles -shared -o ${WORKDIR}/dummylib/libstdc++.so
> +       ${CC} -x c /dev/null -c -o ${WORKDIR}/dummylib/dummylib.o
> +       ${AR} rcs ${WORKDIR}/dummylib/libstdc++.a ${WORKDIR}/dummylib/dummylib.o
>         for d in libgcc ${RUNTIMETARGET}; do
>                 echo "Configuring $d"
>                 rm -rf ${B}/${TARGET_SYS}/$d/
> --
> 2.39.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#181484): https://lists.openembedded.org/g/openembedded-core/message/181484
> Mute This Topic: https://lists.openembedded.org/mt/98944818/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Niko Mauno May 17, 2023, 6:06 p.m. UTC | #2
Hi Steve, I must admit this is surprising to me as I am unable to 
reproduce the failure You describe by issuing

   $ git checkout poky/kirkstone
   Note: switching to 'poky/kirkstone'.

   HEAD is now at f53ab3a2ff build-appliance-image: Update to kirkstone 
head revision

   $ git cherry-pick 591f14c698f43ca4ae6431c8cd96225d1ed5dbf5
   Auto-merging meta/recipes-devtools/gcc/gcc-runtime.inc
   [detached HEAD 935862b25f] gcc-runtime: Use static dummy libstdc++
   Author: Khem Raj <raj.khem@gmail.com>
   Date: Sun Jul 24 08:10:21 2022 -0700
   1 file changed, 2 insertions(+), 1 deletion(-)

Could you provide any further pointers/hints regarding what could be 
wrong..?

-Niko

On 5/17/23 18:21, Steve Sakoman wrote:
> This patch does not apply to current kirkstone HEAD:
> 
> Applying: gcc-runtime: Use static dummy libstdc++
> Using index info to reconstruct a base tree...
> M meta/recipes-devtools/gcc/gcc-runtime.inc
> Falling back to patching base and 3-way merge...
> Auto-merging meta/recipes-devtools/gcc/gcc-runtime.inc
> CONFLICT (content): Merge conflict in meta/recipes-devtools/gcc/gcc-runtime.inc
> error: Failed to merge in the changes.
> Patch failed at 0001 gcc-runtime: Use static dummy libstdc++
> 
> Steve
> 
> On Wed, May 17, 2023 at 12:06 AM Niko Mauno via lists.openembedded.org
> <niko.mauno=vaisala.com@lists.openembedded.org> wrote:
>>
>> From: Khem Raj <raj.khem@gmail.com>
>>
>> some standalone targets e.g. riscv64-elf disable shared linking for
>> baremetal ELF ABI in ld, therefore lets make it a static library
>>
>> (From OE-Core rev: 3c6219dfcbcbde314648ba8cc54a90b32ea1c952)
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>>   meta/recipes-devtools/gcc/gcc-runtime.inc | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
>> index 8074bf1025..d019b0790b 100644
>> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
>> @@ -68,7 +68,8 @@ do_configure () {
>>          # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
>>          # tests. Create a dummy empty lib for the purposes of configure.
>>          mkdir -p ${WORKDIR}/dummylib
>> -       ${CC} -x c /dev/null -nostartfiles -shared -o ${WORKDIR}/dummylib/libstdc++.so
>> +       ${CC} -x c /dev/null -c -o ${WORKDIR}/dummylib/dummylib.o
>> +       ${AR} rcs ${WORKDIR}/dummylib/libstdc++.a ${WORKDIR}/dummylib/dummylib.o
>>          for d in libgcc ${RUNTIMETARGET}; do
>>                  echo "Configuring $d"
>>                  rm -rf ${B}/${TARGET_SYS}/$d/
>> --
>> 2.39.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#181484): https://lists.openembedded.org/g/openembedded-core/message/181484
>> Mute This Topic: https://lists.openembedded.org/mt/98944818/3620601
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Steve Sakoman May 17, 2023, 6:26 p.m. UTC | #3
On Wed, May 17, 2023 at 8:06 AM Niko Mauno <niko.mauno@vaisala.com> wrote:
>
> Hi Steve, I must admit this is surprising to me as I am unable to
> reproduce the failure You describe by issuing
>
>    $ git checkout poky/kirkstone
>    Note: switching to 'poky/kirkstone'.

Sigh, your patch is fine!  I'm the one who messed up :-)

Sometimes it takes more than one cup of coffee to get going in the morning!

Steve
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 8074bf1025..d019b0790b 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -68,7 +68,8 @@  do_configure () {
 	# libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
 	# tests. Create a dummy empty lib for the purposes of configure.
 	mkdir -p ${WORKDIR}/dummylib
-	${CC} -x c /dev/null -nostartfiles -shared -o ${WORKDIR}/dummylib/libstdc++.so
+	${CC} -x c /dev/null -c -o ${WORKDIR}/dummylib/dummylib.o
+	${AR} rcs ${WORKDIR}/dummylib/libstdc++.a ${WORKDIR}/dummylib/dummylib.o
 	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
 		rm -rf ${B}/${TARGET_SYS}/$d/