-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MC 4.8.22 doesn't compile on AIX 7.2 #3960
Comments
|
Sounds like compilation on AIX got busted by PASE changes :( Does any of you have access to AIX / can help with that? |
|
dp, could you please try the attached patch out? thanks! |
Replying to zaytsev:
Yes, of course. I can help you. I have an unlimited access to AIX. |
Replying to zaytsev:
I have done it, but the compilation failed again.(( |
|
Replying to dp:
There is no difference between logs. |
Replying to andrew_b:
Sorry, no. I didn't know it. This time mc has been successfully compiled. |
|
|
GCC has AIX 7.1 and AIX 7.3 machines. Sadly no IBM i access. But I suspect that the problem is/was the same as on macOS. They implemented nanosecond access via st_atimespec instead of st_atim, so instead of this patch we should check whether this is true and maybe still implement the ultimate support. |
|
So I think I've got mc @ 4542_nanoseconds_cleanup to build on AIX 7.3 with glib-2.43.92 and latest gettext / libffi / slang.
It even seems to even mostly work correctly in as far as timestamps are concerned, which is impressive. The original patches were wrong, the kernel actually support everything almost correctly, only structure name is different for binary compatibility reasons (!?), so barring a hard cast one could just assign field by field and be done with it.
If anyone has interest to test on AIX or PASE, you are most welcome. I could also get my hands on AIX 7.1, but the machines are so slow and AIX is so painful to work with.
The magic sauce for mc is (it finds termcap, but can't link?):
Slang must be compiled with make static and make install-static.
glib-2.43.92 (need to patch out -werror and codegen stuff):
libffi and gettext are ok. Next time maybe still a good idea to install pkg-config...
P.S. Broken termcap detection is fixed on master. |
AIX can show nanosecond timestamps with ls -als --full-time if GNU ls is available. |
Interesting remaining warnings: probably some size_t type of thing? Not sure how to fix this.
The rest looks really surprisingly good. Just a few warnings from GNU code and some gettext stuff. |
Replying to zaytsev:
Probably change int to ssize_t (as read(2) returns ssize_t), initialization and size_t/ssize_t casting: index 70602db04..760f79975 100644
--- a/src/filemanager/cmd.c
+++ b/src/filemanager/cmd.c
@@ -210,7 +210,8 @@ compare_files (const vfs_path_t *vpath1, const vfs_path_t *vpath2, off_t size)
#else
/* Don't have mmap() :( Even more ugly :) */
char buf1[BUFSIZ], buf2[BUFSIZ];
- int n1, n2;
+ ssize_t n1 = 0;
+ ssize_t n2 = 0;
rotate_dash (TRUE);
do
@@ -220,8 +221,9 @@ compare_files (const vfs_path_t *vpath1, const vfs_path_t *vpath2, off_t size)
while ((n2 = read (file2, buf2, sizeof (buf2))) == -1 && errno == EINTR)
;
}
- while (n1 == n2 && n1 == sizeof (buf1) && memcmp (buf1, buf2, sizeof (buf1)) == 0);
- result = (n1 != n2) || memcmp (buf1, buf2, n1);
+ while (n1 == n2 && n1 == (ssize_t) sizeof (buf1)
+ && memcmp (buf1, buf2, sizeof (buf1)) == 0);
+ result = (n1 != n2) || memcmp (buf1, buf2, (size_t) n1);
#endif /* !HAVE_MMAP */
close (file2);
} |
So this problem is caused by GCC bug, but I would suggest the following patch for clarity anyways:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100571
But the real problem is that our mmap-code is not used, and instead a fallback is used. There is an unsafe way to override it, but I would delete it:
It's only used in file comparison nowadays, and even though mmap version is probably more performant, I'm not sure if that really matters.
The problem here is that the Autoconf test fails:
But it's not clear to me whether the test is bad, or AIX has been broken for decades. I've asked on the autoconf list, but probably it's on pre-moderation. |
https://lists.gnu.org/archive/html/autoconf/2024-07/msg00006.html |
So it seems that the facts are as follows:
Having that said, I would just remove mmap code, the override and whatever else has to do with that and can be removed. Then we can close this ticket... for now. Sounds good? |
Yes. |
Branch: 3960_remove_mmap
I hope IO_BUFSIZE is okay for the stack...?
Also, I took time to update the documentation: mmap isn't used in the viewer, so I removed that. Some other advice is either obsolete or wrong. So I deleted extra files and updated the links. Also I have removed some general tutorial text on how to use autotools, and replaced it with specific advice for bootstrapping and porting. I hope that this is uncontroversial. |
|
|
|
Important
This issue was migrated from Trac:
dp
(adxru@….ru)jax
(softwoehr@….com),IBMJesseG
(jgorzins@….ibm.com)Hi there,
The compilation fails on AIX 7.2 (7200-03-01-1838) with the following error messages:
The full listing is attached.
Note
Original attachments:
dp
(adxru@….ru) onJan 10, 2019 at 15:48 UTC
andrew_b
(@aborodin) onJan 12, 2019 at 11:53 UTC
dp
(adxru@….ru) onJan 15, 2019 at 7:21 UTC
The text was updated successfully, but these errors were encountered: