All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: Bernd Kuhls <bernd@kuhls.net>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 1/2] package/libopenssl: disable atomic operations for m68k Coldfire
Date: Fri, 04 Sep 2026 13:51:28 +0200	[thread overview]
Message-ID: <874ig5p73z.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20260903063913.73831-1-bernd@kuhls.net> (Bernd Kuhls's message of "Thu, 3 Sep 2026 08:39:12 +0200")

>>>>> "Bernd" == Bernd Kuhls <bernd@kuhls.net> writes:

 > This patch fixes a build error with OpenSSL-enabled libcurl which was
 > detected by the Gitlab pipelines:

 > checking for openssl options with pkg-config... found
 > configure: pkg-config: SSL_LIBS: "-lssl -lcrypto -pthread"
 > configure: pkg-config: SSL_LDFLAGS: "-L/builds/bkuhls/buildroot/br-test-pkg/bootlin-m68k-5208-uclibc/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib"
 > configure: pkg-config: SSL_CPPFLAGS: ""
 > checking for HMAC_Update in -lcrypto... no
 > checking for HMAC_Init_ex in -lcrypto... no
 > checking OpenSSL linking with -ldl... no
 > checking OpenSSL linking with -ldl and -lpthread... no
 > checking for SSL_set_quic_use_legacy_codepoint... no
 > checking for SSL_set_quic_tls_cbs... no
 > configure: OpenSSL version does not speak any known QUIC API
 > configure: OPT_OPENSSL: /builds/bkuhls/buildroot/br-test-pkg/bootlin-m68k-5208-uclibc/host/m68k-buildroot-uclinux-uclibc/sysroot/usr
 > configure: OPENSSL_ENABLED:
 > configure: error: --with-openssl was given but OpenSSL could not be detected
 > make[1]: *** [package/pkg-generic.mk:263: /builds/bkuhls/buildroot/br-test-pkg/bootlin-m68k-5208-uclibc/build/libcurl-8.21.0/.stamp_configured] Error 1

 > Although OpenSSL was found using pkg-config the build tests fail.

 > A local build shows the concrete error in config.log, for example:

 > configure:27577: checking for HMAC_Update in -lcrypto
 > configure:27599: /home/bernd/buildroot/output/host/bin/m68k-linux-gcc
 >  -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 >  -D_FILE_OFFSET_BITS=64 -O2 -g0 -fno-dwarf2-cfi-asm -Wl,-elf2flt=-r
 >  -static -Werror-implicit-function-declaration -Wno-system-headers
 >  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 >  -D_GNU_SOURCE     -Wl,-elf2flt=-r -static
 >  -L/home/bernd/buildroot/output/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib
 >  -L/home/bernd/buildroot/output/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib
 >  conftest.c -lcrypto  -lssl -lcrypto -lz -pthread -lz  >&5
 > /home/bernd/buildroot/output/host/opt/ext-toolchain/m68k-buildroot-uclinux-uclibc/bin/ld.real:
 >  /home/bernd/buildroot/output/host/bin/../m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libcrypto.a(libcrypto-lib-threads_pthread.o):
 >  in function `ossl_rcu_read_lock':
 > threads_pthread.c:(.text+0xa4): undefined reference to `__atomic_fetch_add_8'

 > This error occurs many times for various atomic operations:

 > $ grep "undefined reference to \`__atomic" output/build/libcurl-8.20.0/config.log | sort -u | grep -v real
 > threads_pthread.c:(.text+0x28a): undefined reference to `__atomic_fetch_sub_8'
 > threads_pthread.c:(.text+0x3b4): undefined reference to `__atomic_fetch_add_8'
 > threads_pthread.c:(.text+0x9c8): undefined reference to `__atomic_is_lock_free'
 > threads_pthread.c:(.text+0xa4): undefined reference to `__atomic_fetch_add_8'
 > threads_pthread.c:(.text+0xa9c): undefined reference to `__atomic_is_lock_free'
 > threads_pthread.c:(.text+0xb66): undefined reference to `__atomic_is_lock_free'
 > threads_pthread.c:(.text+0xc30): undefined reference to `__atomic_is_lock_free'
 > threads_pthread.c:(.text+0xcdc): undefined reference to `__atomic_is_lock_free'

 > The build error can be reproduced with the current buildroot tree using
 > this defconfig:

 > BR2_m68k=y
 > BR2_m68k_cf5208=y
 > BR2_TOOLCHAIN_EXTERNAL=y
 > BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_M68K_COLDFIRE_UCLIBC_STABLE=y
 > BR2_PACKAGE_OPENSSL=y
 > BR2_PACKAGE_LIBCURL=y

 > Although the toolchain lacks atomics support

 > $ grep ATOMIC .config
 > $

 > it emits atomic-related defines, for example:

 > $ echo | output/host/bin/m68k-linux-gcc -dM -E - | grep __ATOMIC_ACQ_REL
 > #define __ATOMIC_ACQ_REL 4
 > $

 > This specific define __ATOMIC_ACQ_REL is used in OpenSSL to enable
 > atomic support at various places:
 > https://github.com/openssl/openssl/blob/openssl-3.6.3/crypto/threads_pthread.c

 > causing the build errors we see with the mentioned defconfig.

 > To fix the problem we use an OpenSSL-provided define to forcefully
 > disable the usage of atomic intrinsics.

 > The misdetection of atomic intrinsics for m68k coldfire is not a new
 > problem:
 > https://lists.buildroot.org/pipermail/buildroot/2017-May/180841.html
 > https://lists.buildroot.org/pipermail/buildroot/2026-May/803110.html

 > Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
 > ---
 > v2: fixed patch description (Baruch)

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2026-09-04 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  6:39 [Buildroot] [PATCH v2 1/2] package/libopenssl: disable atomic operations for m68k Coldfire Bernd Kuhls
2026-09-03  6:39 ` [Buildroot] [PATCH v2 2/2] package/libcurl: security bump to version 8.22.0 Bernd Kuhls
2026-09-04 11:51   ` Peter Korsgaard
2026-09-04 11:51 ` Peter Korsgaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ig5p73z.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=bernd@kuhls.net \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.