Skip to content

Conversation

@rnpnr
Copy link
Contributor

@rnpnr rnpnr commented Dec 30, 2024

Hi, I've recently acquired an aarch64 laptop and wanted to use strace on it. While I was at it I bumped the version. This requires the linux-headers bump, #130, as well.

There are still a few packages that don't build on aarch64 - python, ffmpeg, and dav1d. If I have the time I will look into them as well.

@hovercats
Copy link
Contributor

with the presens of #130, you should probably remove the linux-headers commit in this pr. not that @michaelforney merges prs through github afaik, but nevertheless :p

@rnpnr
Copy link
Contributor Author

rnpnr commented Dec 31, 2024

with the presens of #130, you should probably remove the linux-headers commit in this pr. not that @michaelforney merges prs through github afaik, but nevertheless :p

👍 done, just to be clear though this will not build without that commit

@hovercats
Copy link
Contributor

hovercats commented Jan 1, 2025 via email

Copy link
Collaborator

@michaelforney michaelforney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed the 6.12 commit (with config.h regenerated). I have a few minor comments on the aarch64 commit, but it mostly looks good to me.

Thanks for working on this!

aarch64='aarch64',
x86_64='x86_64',
})[config.target.platform:match('[^-]*')]
if not arch then error('unsupported arch') end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we error here, then setup.lua will fail on any other architecture, even if strace isn't selected in config.lua.

Instead, maybe we should just return here, as if strace doesn't exist on those targets?

'-D IN_STRACE',
-- it is important that the arch-specific directory is searched first
'-I $srcdir/src/linux/x86_64',
'-I $srcdir/src/linux/' .. arch,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nitpick: the rest of the project doesn't use spaces around the .. operator


local arch_h_count = {}
arch_h_count['aarch64'] = 1
arch_h_count['x86_64'] = 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer just putting these values in the table constructor instead of adding them later.

local arch_h_count = {
	aarch64=1,
	x86_64=2,
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized I forgot the config.h changes during the update to 6.8, so I added those in a separate commit.

Compared to what I get with a configure, I see several differences here:

diff --git a/pkg/strace/config.h b/pkg/strace/config.h
index d23aaf92..2bbd1090 100644
--- a/pkg/strace/config.h
+++ b/pkg/strace/config.h
@@ -222,7 +222,7 @@
 #define HAVE_STRUCT_IOCB_AIO_RW_FLAGS 1
 #define HAVE_STRUCT_KBDIACRSUC 1
 #define HAVE_STRUCT_KBDIACRUC 1
-/* #undef HAVE_STRUCT_KVM_CPUID2 */
+#define HAVE_STRUCT_KVM_CPUID2 1
 #define HAVE_STRUCT_KVM_REGS 1
 #define HAVE_STRUCT_KVM_SREGS 1
 #define HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION 1
@@ -258,13 +258,13 @@
 #define HAVE_STRUCT_TERMIOS2 1
 /* #undef HAVE_STRUCT_TERMIOS_C_ISPEED */
 /* #undef HAVE_STRUCT_TERMIOS_C_OSPEED */
-/* #undef HAVE_STRUCT_USER_DESC */
-/* #undef HAVE_STRUCT_USER_DESC_LM */
+#define HAVE_STRUCT_USER_DESC 1
+#define HAVE_STRUCT_USER_DESC_LM 1
 #define HAVE_STRUCT_UTSNAME_DOMAINNAME 1
 /* #undef HAVE_STRUCT___AIO_SIGSET */
 #define HAVE_STRUCT___KERNEL_SOCK_TIMEVAL 1
 #define HAVE_STRUCT___KERNEL_TIMESPEC 1
-/* #undef HAVE_STRUCT___OLD_KERNEL_STAT */
+#define HAVE_STRUCT___OLD_KERNEL_STAT 1
 #define HAVE_STRUCT___PTRACE_SYSCALL_INFO 1
 #define HAVE_SYNC_FILE_RANGE 1
 #define HAVE_SYS_EVENTFD_H 1

Is this due to running on aarch64 vs x86_64, or maybe the linux headers your system compiler sees are causing configure to detect things differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is from running the script on aarch64 vs x86_64. I should have looked earlier and left a comment.

  • HAVE_STRUCT_KVM_CPUID2 is specific to x86/x86_64
  • HAVE_STRUCT_USER_DESC is specific to x86/x86_64
  • HAVE_STRUCT_USER_DESC_LM is specific to x86_64
  • HAVE_STRUCT___OLD_KERNEL_STAT is for x86 kernels or x86_64 kernels running with 32-bit emulation enabled.
    These are all provided by the architecture specific linux headers. I'm not really sure why strace is checking for any of them specifically since checking the architecture being targeted would be sufficient for all of these.

@rnpnr
Copy link
Contributor Author

rnpnr commented Feb 13, 2025

I have rebased and hopefully addressed all your comments, let me know if there are further issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants