All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
       [not found] <16FF8418B666136C.16989@lists.yoctoproject.org>
@ 2022-07-07 10:14 ` Robert P. J. Day
  2022-07-07 14:32   ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2022-07-07 10:14 UTC (permalink / raw)
  To: Yocto discussion list

On Thu, 7 Jul 2022, Robert P. J. Day wrote:


>   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> is a known issue as it's pretty much identical to what one reads here:
>
>   https://github.com/advancedtelematic/aktualizr/issues/1427
>
> the explanation being that, "not every atomic operation is currently
> supported by GCC on RISC-V."
>
>   oddly, building a riscv64 core-image-minimal once upon a time on
> fedora worked just fine, so i'm assuming a difference in gcc versions
> is what is causing this.
>
>   what is the recommended workaround for this?

  another data point, matches exactly what i'm referring to:

  https://github.com/curl/curl/issues/9055

rday


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 10:14 ` [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1' Robert P. J. Day
@ 2022-07-07 14:32   ` Khem Raj
  2022-07-07 15:09     ` Robert P. J. Day
  2022-07-07 17:06     ` Robert P. J. Day
  0 siblings, 2 replies; 7+ messages in thread
From: Khem Raj @ 2022-07-07 14:32 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Yocto discussion list

On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> On Thu, 7 Jul 2022, Robert P. J. Day wrote:
>
>
> >   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> > is a known issue as it's pretty much identical to what one reads here:
> >
> >   https://github.com/advancedtelematic/aktualizr/issues/1427
> >
> > the explanation being that, "not every atomic operation is currently
> > supported by GCC on RISC-V."
> >
> >   oddly, building a riscv64 core-image-minimal once upon a time on
> > fedora worked just fine, so i'm assuming a difference in gcc versions
> > is what is causing this.
> >
> >   what is the recommended workaround for this?
>
>   another data point, matches exactly what i'm referring to:
>
>   https://github.com/curl/curl/issues/9055
>

does backporting

https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2

to curl help ?


> rday
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#57470): https://lists.yoctoproject.org/g/yocto/message/57470
> Mute This Topic: https://lists.yoctoproject.org/mt/92225230/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 14:32   ` Khem Raj
@ 2022-07-07 15:09     ` Robert P. J. Day
  2022-07-07 17:06     ` Robert P. J. Day
  1 sibling, 0 replies; 7+ messages in thread
From: Robert P. J. Day @ 2022-07-07 15:09 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto discussion list

On Thu, 7 Jul 2022, Khem Raj wrote:

> On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> > On Thu, 7 Jul 2022, Robert P. J. Day wrote:
> >
> >
> > >   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> > > is a known issue as it's pretty much identical to what one reads here:
> > >
> > >   https://github.com/advancedtelematic/aktualizr/issues/1427
> > >
> > > the explanation being that, "not every atomic operation is currently
> > > supported by GCC on RISC-V."
> > >
> > >   oddly, building a riscv64 core-image-minimal once upon a time on
> > > fedora worked just fine, so i'm assuming a difference in gcc versions
> > > is what is causing this.
> > >
> > >   what is the recommended workaround for this?
> >
> >   another data point, matches exactly what i'm referring to:
> >
> >   https://github.com/curl/curl/issues/9055
> >
>
> does backporting
>
> https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2
>
> to curl help ?

  it does indeed fix the curl build error, thanks. i haven't tested
its operation yet, but getting a build was all i was after at the
moment.

rday


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 14:32   ` Khem Raj
  2022-07-07 15:09     ` Robert P. J. Day
@ 2022-07-07 17:06     ` Robert P. J. Day
  2022-07-07 17:23       ` Khem Raj
  1 sibling, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2022-07-07 17:06 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto discussion list

On Thu, 7 Jul 2022, Khem Raj wrote:

> On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> > On Thu, 7 Jul 2022, Robert P. J. Day wrote:
> >
> >
> > >   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> > > is a known issue as it's pretty much identical to what one reads here:
> > >
> > >   https://github.com/advancedtelematic/aktualizr/issues/1427
> > >
> > > the explanation being that, "not every atomic operation is currently
> > > supported by GCC on RISC-V."
> > >
> > >   oddly, building a riscv64 core-image-minimal once upon a time on
> > > fedora worked just fine, so i'm assuming a difference in gcc versions
> > > is what is causing this.
> > >
> > >   what is the recommended workaround for this?
> >
> >   another data point, matches exactly what i'm referring to:
> >
> >   https://github.com/curl/curl/issues/9055
> >
>
> does backporting
>
> https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2
>
> to curl help ?

  as i read it, this issue is also related to -pthread versus
-lpthread:

https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/

rday



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 17:06     ` Robert P. J. Day
@ 2022-07-07 17:23       ` Khem Raj
  2022-07-07 18:01         ` Robert P. J. Day
  0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2022-07-07 17:23 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Yocto discussion list

On Thu, Jul 7, 2022 at 1:06 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> On Thu, 7 Jul 2022, Khem Raj wrote:
>
> > On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > >
> > > On Thu, 7 Jul 2022, Robert P. J. Day wrote:
> > >
> > >
> > > >   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> > > > is a known issue as it's pretty much identical to what one reads here:
> > > >
> > > >   https://github.com/advancedtelematic/aktualizr/issues/1427
> > > >
> > > > the explanation being that, "not every atomic operation is currently
> > > > supported by GCC on RISC-V."
> > > >
> > > >   oddly, building a riscv64 core-image-minimal once upon a time on
> > > > fedora worked just fine, so i'm assuming a difference in gcc versions
> > > > is what is causing this.
> > > >
> > > >   what is the recommended workaround for this?
> > >
> > >   another data point, matches exactly what i'm referring to:
> > >
> > >   https://github.com/curl/curl/issues/9055
> > >
> >
> > does backporting
> >
> > https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2
> >
> > to curl help ?
>
>   as i read it, this issue is also related to -pthread versus
> -lpthread:
>

this would mean that you want to rely on side effects of -pthread
which may work with gcc but may not
work with clang or other compiler drivers. The issue you have is that
some variables are needing atomics
and solution is either you link with libatomic or avoid using the code
which needs them

> https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/
>
> rday
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 17:23       ` Khem Raj
@ 2022-07-07 18:01         ` Robert P. J. Day
  2022-07-07 18:12           ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2022-07-07 18:01 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto discussion list

On Thu, 7 Jul 2022, Khem Raj wrote:

> On Thu, Jul 7, 2022 at 1:06 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> > On Thu, 7 Jul 2022, Khem Raj wrote:
> >
> > > On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > > >
> > > > On Thu, 7 Jul 2022, Robert P. J. Day wrote:
> > > >
> > > >
> > > > >   on admittedly unsupported ubuntu 22.04 platform but it's clear this
> > > > > is a known issue as it's pretty much identical to what one reads here:
> > > > >
> > > > >   https://github.com/advancedtelematic/aktualizr/issues/1427
> > > > >
> > > > > the explanation being that, "not every atomic operation is currently
> > > > > supported by GCC on RISC-V."
> > > > >
> > > > >   oddly, building a riscv64 core-image-minimal once upon a time on
> > > > > fedora worked just fine, so i'm assuming a difference in gcc versions
> > > > > is what is causing this.
> > > > >
> > > > >   what is the recommended workaround for this?
> > > >
> > > >   another data point, matches exactly what i'm referring to:
> > > >
> > > >   https://github.com/curl/curl/issues/9055
> > > >
> > >
> > > does backporting
> > >
> > > https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2
> > >
> > > to curl help ?
> >
> >   as i read it, this issue is also related to -pthread versus
> > -lpthread:
> >
>
> this would mean that you want to rely on side effects of -pthread
> which may work with gcc but may not
> work with clang or other compiler drivers. The issue you have is that
> some variables are needing atomics
> and solution is either you link with libatomic or avoid using the code
> which needs them
>
> > https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/

  so while i'm still trying to wrap my head around all this, what
*would* be the ideal resolution for this? the link above suggests the
simple solution of introducing a gcc config option
"--always-link-libatomic". would that solve all this in a general way,
not just for RISC-V?

rday


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1'
  2022-07-07 18:01         ` Robert P. J. Day
@ 2022-07-07 18:12           ` Khem Raj
  0 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2022-07-07 18:12 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 2530 bytes --]

On Thu, Jul 7, 2022 at 2:01 PM Robert P. J. Day <rpjday@crashcourse.ca>
wrote:

> On Thu, 7 Jul 2022, Khem Raj wrote:
>
> > On Thu, Jul 7, 2022 at 1:06 PM Robert P. J. Day <rpjday@crashcourse.ca>
> wrote:
> > >
> > > On Thu, 7 Jul 2022, Khem Raj wrote:
> > >
> > > > On Thu, Jul 7, 2022 at 6:14 AM Robert P. J. Day <
> rpjday@crashcourse.ca> wrote:
> > > > >
> > > > > On Thu, 7 Jul 2022, Robert P. J. Day wrote:
> > > > >
> > > > >
> > > > > >   on admittedly unsupported ubuntu 22.04 platform but it's clear
> this
> > > > > > is a known issue as it's pretty much identical to what one reads
> here:
> > > > > >
> > > > > >   https://github.com/advancedtelematic/aktualizr/issues/1427
> > > > > >
> > > > > > the explanation being that, "not every atomic operation is
> currently
> > > > > > supported by GCC on RISC-V."
> > > > > >
> > > > > >   oddly, building a riscv64 core-image-minimal once upon a time
> on
> > > > > > fedora worked just fine, so i'm assuming a difference in gcc
> versions
> > > > > > is what is causing this.
> > > > > >
> > > > > >   what is the recommended workaround for this?
> > > > >
> > > > >   another data point, matches exactly what i'm referring to:
> > > > >
> > > > >   https://github.com/curl/curl/issues/9055
> > > > >
> > > >
> > > > does backporting
> > > >
> > > >
> https://github.com/curl/curl/commit/50efb0822aa0e0ab165158dd0a26e65a2290e6d2
> > > >
> > > > to curl help ?
> > >
> > >   as i read it, this issue is also related to -pthread versus
> > > -lpthread:
> > >
> >
> > this would mean that you want to rely on side effects of -pthread
> > which may work with gcc but may not
> > work with clang or other compiler drivers. The issue you have is that
> > some variables are needing atomics
> > and solution is either you link with libatomic or avoid using the code
> > which needs them
> >
> > >
> https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/
>
>   so while i'm still trying to wrap my head around all this, what
> *would* be the ideal resolution for this? the link above suggests the
> simple solution of introducing a gcc config option
> "--always-link-libatomic". would that solve all this in a general way,
> not just for RISC-V?


Probably, but again if you need a function from a library you include it on
linker cmdline if it’s intrinsics then compiler driver doing the needed is
best way
Preferably without introducing compiler specific options

>
>
> rday
>

[-- Attachment #2: Type: text/html, Size: 4130 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-07 18:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <16FF8418B666136C.16989@lists.yoctoproject.org>
2022-07-07 10:14 ` [yocto] meta-riscv: building curl, "undefined reference to '__atomic_exchange_1' Robert P. J. Day
2022-07-07 14:32   ` Khem Raj
2022-07-07 15:09     ` Robert P. J. Day
2022-07-07 17:06     ` Robert P. J. Day
2022-07-07 17:23       ` Khem Raj
2022-07-07 18:01         ` Robert P. J. Day
2022-07-07 18:12           ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.