toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
PATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
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.
--- toolchain/Config.in | 1 + 1 file changed, 1 insertion(+)
toolchain/Config.in +1 -0
@@ -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
Signature · 1 line
2.29.2
PATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
Quoted 12 lines · On Sat, 9 Jan 2021 13:33:37 +0100 Bernd Kuhls <[email protected]> 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 -latomicusing this defconfig
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
BR2_PACKAGE_OPENSSL=y
Quoted 5 lines
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 <[email protected]>
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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Yann E. MORIN
AppliedPATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
Thomas, Bernd, All,
On 2021-01-09 22:58 +0100, Thomas Petazzoni spake thusly:
Quoted 4 lines
Quoted 2 lines · On Sat, 9 Jan 2021 13:33:37 +0100 Bernd Kuhls <[email protected]> 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--]
Quoted 9 lines
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.
Quoted 6 lines
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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
In reply to Bernd KuhlsQuoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Bernd" == Bernd Kuhls <[email protected]> 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 -latomicusing this defconfig
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
BR2_PACKAGE_OPENSSL=y
Quoted 5 lines
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 <[email protected]>
Committed to 2020.02.x and 2020.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
Hi Peter,
Quoted 13 lines · Peter Korsgaard
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Bernd" == Bernd Kuhls <[email protected]> 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 -latomicusing this defconfig
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64=y
BR2_PACKAGE_OPENSSL=y
Quoted 7 lines
Quoted 5 lines
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 <[email protected]>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
Signature · 3 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 toolchain: CodeSourcery AArch64 2014.11 does not contain libatomic
Quoted 4 lines · Baruch Siach
Quoted 1 line
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!
Signature · 1 line
Bye, Peter Korsgaard