posix arch: build on aarch64 / allow host-specific cmake includes
This change enables specific compiler and linker options to be used in
the case that an arch/posix/os.arch.cmake file exists.
Note: os and arch in the above case are evaluations of
CMAKE_HOST_SYSTEM_NAME and CMAKE_HOST_SYSTEM_PROCESSOR.
Otherwise, the existing "generic" compiler and linker flags in
arch/posix/CMakeLists.txt are used.
Additional flags and checks are provided in
arch/posix/Linux.aarch64.cmake.
Added scripts/user_wordsize.py to detect if userspace is 64-bit or
32-bit, which should be consistent with the value of CONFIG_64BIT
for Aarch64 on Linux.
Fixes #24842
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
diff --git a/scripts/user_wordsize.py b/scripts/user_wordsize.py
new file mode 100644
index 0000000..46c8f6b
--- /dev/null
+++ b/scripts/user_wordsize.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2020, Friedt Professional Engineering Services, Inc
+#
+# SPDX-License-Identifier: Apache-2.0
+import struct
+import sys
+
+def main():
+ print(struct.calcsize("P") * 8)
+ sys.exit(0)
+
+if __name__ == "__main__":
+ main()