Skip to contentSkip to conversation

libfdt: pass sources as keyword argument to library()

PATCH Applied Héctor Orón Martínez 2 participants 2 messages Sep 8 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdt: pass sources as keyword argument to library()

Meson expects the source list for library() to be passed either as positional arguments after the target name or via the 'sources:' keyword. Using the implicit positional form can lead to malformed linker commands on some toolchains, with spurious arguments such as 'libfdt' and '.' being treated as input files.

Explicitly pass the source list via 'sources: sources' and declare the ABI version with 'soversion: '1'' to match the installed libfdt.so.1 soname.

This fixes build failures where the linker reported:
cannot find libfdt: file format not recognized cannot find .: file format not recognized

---
 libfdt/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
libfdt/meson.build +3 -1
index 68d4c1d..6c41f9f 100644
@@ -27,8 +27,10 @@ endif
 
 link_args += version_script
 libfdt = library(
-  'fdt', sources,
+  'fdt',
+  sources: sources,
   version: meson.project_version(),
+  soversion: '1',
   link_args: link_args,
   link_depends: 'version.lds',
   install: get_option('default_library') != 'static' or not wheel_only,
Signature · 1 line
2.55.0
Applied
#1 lore raw
Quoted 10 lines · Héctor Orón Martínez

Meson expects the source list for library() to be passed either as positional arguments after the target name or via the 'sources:' keyword. Using the implicit positional form can lead to malformed linker commands on some toolchains, with spurious arguments such as 'libfdt' and '.' being treated as input files.

Explicitly pass the source list via 'sources: sources' and declare the ABI version with 'soversion: '1'' to match the installed libfdt.so.1 soname.

Quoted 5 lines

This fixes build failures where the linker reported:
cannot find libfdt: file format not recognized cannot find .: file format not recognized

Applied, thanks.

Quoted 24 lines
---
 libfdt/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
libfdt/meson.build +3 -1
index 68d4c1d..6c41f9f 100644
@@ -27,8 +27,10 @@ endif
 
 link_args += version_script
 libfdt = library(
-  'fdt', sources,
+  'fdt',
+  sources: sources,
   version: meson.project_version(),
+  soversion: '1',
   link_args: link_args,
   link_depends: 'version.lds',
   install: get_option('default_library') != 'static' or not wheel_only,
Signature · 1 line
2.55.0
Signature · 4 lines
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson