All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
@ 2021-01-09 12:33 Bernd Kuhls
  2021-01-09 21:58 ` Thomas Petazzoni
  2021-01-12 10:06 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Bernd Kuhls @ 2021-01-09 12:33 UTC (permalink / raw)
  To: buildroot

Fixes build error

output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-amd-linux-gnu/4.9.1/../../../../aarch64-amd-linux-gnu/bin/ld:
 cannot find -latomic

using this defconfig

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
BR2_PACKAGE_OPENSSL=y

libopenssl is only used here as an example: all packages adding -latomic
if BR2_TOOLCHAIN_HAS_LIBATOMIC=y are broken, like dav1d, ffmpeg, gnutls,
kodi and vlc.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 toolchain/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 395c8e36b8..553612c4aa 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -702,6 +702,7 @@ config BR2_TOOLCHAIN_HAS_SYNC_8
 config BR2_TOOLCHAIN_HAS_LIBATOMIC
 	bool
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \
+		!BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64 && \
 		BR2_TOOLCHAIN_HAS_THREADS && \
 		!BR2_BINFMT_FLAT
 
-- 
2.29.2

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

* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
  2021-01-09 12:33 [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic Bernd Kuhls
@ 2021-01-09 21:58 ` Thomas Petazzoni
  2021-01-09 22:20   ` Yann E. MORIN
  2021-01-12 10:06 ` Peter Korsgaard
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2021-01-09 21:58 UTC (permalink / raw)
  To: buildroot

On Sat,  9 Jan 2021 13:33:37 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> Fixes build error
> 
> output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-amd-linux-gnu/4.9.1/../../../../aarch64-amd-linux-gnu/bin/ld:
>  cannot find -latomic
> 
> using this defconfig
> 
> BR2_aarch64=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
> BR2_PACKAGE_OPENSSL=y
> 
> libopenssl is only used here as an example: all packages adding -latomic
> if BR2_TOOLCHAIN_HAS_LIBATOMIC=y are broken, like dav1d, ffmpeg, gnutls,
> kodi and vlc.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

This toolchain was build with --disable-libatomic:

$ ./bin/aarch64-amd-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./bin/aarch64-amd-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/thomas/projets/outputs/sourcery/host/opt/ext-toolchain/bin/../libexec/gcc/aarch64-amd-linux-gnu/4.9.1/lto-wrapper
Target: aarch64-amd-linux-gnu
Configured with: /scratch/meadori/aarch64-amd-linux-gnu-lite/src/gcc-4.9-2014.11/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=aarch64-amd-linux-gnu [...]--disable-libitm --disable-libatomic --disable-libssp [...]

So in fact our assumption that having gcc 4.8 implies that libatomic is
available is incorrect... as it depends on the toolchain configuration.

So I see two options here:

 (1) What you propose, which will just fix the problem for this
     particular toolchain, but not any other toolchain potentially built
     without libatomic.

 (2) Really detect the availability of libatomic, just like we do for
     other toolchain features.

I would have normally preferred (2), but here I believe the vast
majority of modern toolchains will have libatomic included, so it
bothers me a bit to introduce more complexity for a situation that is
uncommon today, and is going to become more and more uncommon.

What do others think ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
  2021-01-09 21:58 ` Thomas Petazzoni
@ 2021-01-09 22:20   ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-01-09 22:20 UTC (permalink / raw)
  To: buildroot

Thomas, Bernd, All,

On 2021-01-09 22:58 +0100, Thomas Petazzoni spake thusly:
> On Sat,  9 Jan 2021 13:33:37 +0100
> Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> > output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-amd-linux-gnu/4.9.1/../../../../aarch64-amd-linux-gnu/bin/ld:
> >  cannot find -latomic
[--SNIP--]
> So I see two options here:
> 
>  (1) What you propose, which will just fix the problem for this
>      particular toolchain, but not any other toolchain potentially built
>      without libatomic.
> 
>  (2) Really detect the availability of libatomic, just like we do for
>      other toolchain features.
> 
> I would have normally preferred (2), but here I believe the vast
> majority of modern toolchains will have libatomic included, so it
> bothers me a bit to introduce more complexity for a situation that is
> uncommon today, and is going to become more and more uncommon.
> 
> What do others think ?

When I saw Bernd's patch, I was not very happy with that hack. So I
started (more or less) working on implementing option 2. But it is quite
a bit of work...

And then, we have only this one toolchain, pretty old now, which we may
as well get rid of, soon enough at least. So this little one-off
workaround is just good-enough...

So, after seeing the reply from Thomas, and after a bit of back-n-forth
in my head and with Thomas on IRC, I decided that this was just not worth
the effort to go for option 2.

I am still not very happy with option 1, which I find not very
satisfying... But oh well, this is really "Just-Good-Enough ?".

Applied to master, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
  2021-01-09 12:33 [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic Bernd Kuhls
  2021-01-09 21:58 ` Thomas Petazzoni
@ 2021-01-12 10:06 ` Peter Korsgaard
  2021-01-12 14:03   ` Baruch Siach
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2021-01-12 10:06 UTC (permalink / raw)
  To: buildroot

>>>>> "Bernd" == Bernd Kuhls <bernd.kuhls@t-online.de> writes:

 > Fixes build error
 > output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-amd-linux-gnu/4.9.1/../../../../aarch64-amd-linux-gnu/bin/ld:
 >  cannot find -latomic

 > using this defconfig

 > BR2_aarch64=y
 > BR2_TOOLCHAIN_EXTERNAL=y
 > BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
 > BR2_PACKAGE_OPENSSL=y

 > libopenssl is only used here as an example: all packages adding -latomic
 > if BR2_TOOLCHAIN_HAS_LIBATOMIC=y are broken, like dav1d, ffmpeg, gnutls,
 > kodi and vlc.

 > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Committed to 2020.02.x and 2020.11.x, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
  2021-01-12 10:06 ` Peter Korsgaard
@ 2021-01-12 14:03   ` Baruch Siach
  2021-01-12 20:34     ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2021-01-12 14:03 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Tue, Jan 12 2021, Peter Korsgaard wrote:
>>>>>> "Bernd" == Bernd Kuhls <bernd.kuhls@t-online.de> writes:
>
>  > Fixes build error
>  > output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-amd-linux-gnu/4.9.1/../../../../aarch64-amd-linux-gnu/bin/ld:
>  >  cannot find -latomic
>
>  > using this defconfig
>
>  > BR2_aarch64=y
>  > BR2_TOOLCHAIN_EXTERNAL=y
>  > BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
>  > BR2_PACKAGE_OPENSSL=y
>
>  > libopenssl is only used here as an example: all packages adding -latomic
>  > if BR2_TOOLCHAIN_HAS_LIBATOMIC=y are broken, like dav1d, ffmpeg, gnutls,
>  > kodi and vlc.
>
>  > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
>
> Committed to 2020.02.x and 2020.11.x, thanks.

Not in 2020.11.x as of commit b460962f5900 ("package/nodejs: security
bump to version 12.20.1").

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
  2021-01-12 14:03   ` Baruch Siach
@ 2021-01-12 20:34     ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2021-01-12 20:34 UTC (permalink / raw)
  To: buildroot

On Tue, Jan 12, 2021 at 3:03 PM Baruch Siach <baruch@tkos.co.il> wrote:
> > Committed to 2020.02.x and 2020.11.x, thanks.
>
> Not in 2020.11.x as of commit b460962f5900 ("package/nodejs: security
> bump to version 12.20.1").

Ups, indeed - Fixed, thanks!

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2021-01-12 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 12:33 [Buildroot] [PATCH 1/1] toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic Bernd Kuhls
2021-01-09 21:58 ` Thomas Petazzoni
2021-01-09 22:20   ` Yann E. MORIN
2021-01-12 10:06 ` Peter Korsgaard
2021-01-12 14:03   ` Baruch Siach
2021-01-12 20:34     ` Peter Korsgaard

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.