Pseudo allows wrappers to define special comments in the wrapper lists to
pass extra arguments such as version=GLIBC_2.3 to control which symbol
version to search for.  However, these arguments can be architecture-specific.

When parsing the arguments, check for flags that end in the architecture name
(as returned by platform.machine()) and use those values instead.

Signed-off-by: Ross Burton <ross.bur...@arm.com>
---
 makewrappers | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/makewrappers b/makewrappers
index e68f6a9..6681e11 100755
--- a/makewrappers
+++ b/makewrappers
@@ -11,6 +11,7 @@ import glob
 import sys
 import re
 import os.path
+import platform
 import string
 import subprocess
 from templatefile import TemplateFile
@@ -290,10 +291,18 @@ class Function:
 
         # handle special comments, such as flags=AT_SYMLINK_NOFOLLOW
         if self.comments:
-            modifiers = self.comments.split(', ')
-            for mod in modifiers:
-                key, value = mod.split('=')
-                value = value.rstrip()
+            # Build a dictionary of key=value, key=value pairs
+            modifiers = dict(mod.split("=") for mod in 
self.comments.split(','))
+            # Strip all leading/trailing whitespace
+            modifiers = {k.strip():v.strip() for k, v in modifiers.items()}
+
+            arch = "-" + platform.machine()
+            # Sorted so that versions-foo appear after versions, so overrides 
are easy
+            for key in sorted(modifiers):
+                value = modifiers[key]
+                # If the key is version-arm64 and we're on arm64 then rename 
this to version
+                if key.endswith(arch):
+                    key = key.replace(arch, "")
                 setattr(self, key, value)
     
     def maybe_inode64(self):
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#146546): 
https://lists.openembedded.org/g/openembedded-core/message/146546
Mute This Topic: https://lists.openembedded.org/mt/79523831/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to