All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][Patch v2 1/1] openssl: aarch64: configure with no-asm
@ 2025-05-06 14:10 max.oss.09
  2025-05-06 14:21 ` Khem Raj
  2025-05-06 15:22 ` Ross Burton
  0 siblings, 2 replies; 4+ messages in thread
From: max.oss.09 @ 2025-05-06 14:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Max Krummenacher

From: Max Krummenacher <max.krummenacher@toradex.com>

openssl has a couple of functionalities which use optimized
assembler code. With no-asm these are replaced by generic
C code implementation.

With GCC 15 OE by default uses the new AARCH64 specific GCS feature.
However the object files produced by the assembler are not marked
to provide the feature and consequently the produced shared objects
containing them also not.
The linker will warn when linking against such shared objects files
and, with all warnings are errors set linking will fail.
Without this patch systemd e.g. fails do_compile as it links against
libcrypto.so from openssl.

To test what features an object file (or .so, .a file) has use
readelf -ln and check the content of .note.gnu.property, e.g.
libcrypto-shlib-md5-aarch64.o build from assembler source,
libcrypto-shlib-md5_one.o build from C source:

$ aarch64-poky-linux-readelf -ln ./crypto/md5/libcrypto-shlib-md5-aarch64.o

There are no program headers in this file.

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC

$ aarch64-poky-linux-readelf -ln ./crypto/md5/libcrypto-shlib-md5_one.o

There are no program headers in this file.

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC, GCS

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 meta/recipes-connectivity/openssl/openssl_3.5.0.bb | 2 ++
 1 file changed, 2 insertions(+)

For reference also refer to this thread:
https://lore.kernel.org/all/aBilFkr4HF-MSBd6@toolbox/

diff --git a/meta/recipes-connectivity/openssl/openssl_3.5.0.bb b/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
index 865e04deb220..d025fc3ff100 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
@@ -36,6 +36,8 @@ B = "${WORKDIR}/build"
 do_configure[cleandirs] = "${B}"
 
 EXTRA_OECONF = "${@bb.utils.contains('PTEST_ENABLED', '1', '', 'no-tests', d)}"
+# aarch64 'as' doesn't mark objects to have the GCS feature, resulting *.so then produces linker warnings
+EXTRA_OECONF:append:aarch64 = " no-asm"
 
 #| ./libcrypto.so: undefined reference to `getcontext'
 #| ./libcrypto.so: undefined reference to `setcontext'
-- 
2.42.0



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

end of thread, other threads:[~2025-05-06 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 14:10 [OE-core][Patch v2 1/1] openssl: aarch64: configure with no-asm max.oss.09
2025-05-06 14:21 ` Khem Raj
2025-05-06 14:29   ` Mikko Rapeli
2025-05-06 15:22 ` Ross Burton

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.