-
Notifications
You must be signed in to change notification settings - Fork 134
Fix build failure of asm1130 on recent Gentoo (gcc version 14.2.1) #523
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
base: master
Are you sure you want to change the base?
Conversation
This failed to build with gcc version:
gcc version 14.2.1 20241221 (Gentoo 14.2.1_p20241221 p7)
with the following error:
---snip---
asm1130.c: In function ‘save_symbols’
asm1130.c:2132:9: error: implicit declaration of function ‘unlink’; did you mean ‘x_link’? [-Wimplicit-function-declaration]
2132 | unlink(SYSTEM_TABLE);
| ^~~~~~
---snip---
|
Have you tested it on Windows? |
|
It doesn't look like the Github test scripts build this subdirectory. I wonder about an include of "unistd" on Windoze. |
|
@pkoning2 said: It doesn't look like the Github test scripts build this subdirectory. I wonder about an include of "unistd" on Windoze. FYI, there has been no effort to avoid excess warning messages when building things in this directory. In fact, I've never known anyone who actually tried to run any of the makefiles in this directory. On windows, the builds have many warnings, but all but checkdisk.mak produce binaries. Looking closely at that build failure and the details in the checkdisk.mak seem to refer to include files from way before Visual Studio 2008 which is the oldest I've got. Removing the irrelevant references in checkdisk.mak and a binary is built. All the windows binaries run and spit out a usage message. The simplest change to the asm1130.c source would be to change: |
|
Thanks Mark. @romforth could you make that update? |
|
As I mentioned, there was all sorts of warning messages produced when building all those programs on windows. When building asm1130 on Ubuntu, many warnings are also produced, including about unlink. Meanwhile, a binary is produced and no link errors were generated, so I suspect the result works just fine. |
|
My point is that removing a single warning among many, if the resulting binary works fine, probably doesn't warrant a dedicated change. |
|
On Ubuntu I see: Your original complaint has the same message, but in your case we see "error:" rather than "warning:". Is something about your build causing warnings to return as errors? |
|
It's probably caused by gcc moving to a newer edition of the C standard for its default dialect, one in which this issue is an error. |
|
Hi Paul and Mark, I didn't have a Windows system to test - so the only testing I did was on Ubuntu 16.04 (which worked with the original code) and on a recent build of Gentoo (where I saw the failure that this fix attempts to solve). Sorry about causing the Github CI build failures - the fix that I pushed to my repo just now should fix it, I think. Thanks for the code review. |
Rather than use this change (which would affect anything other than Windows), I've chosen to do the more conservative |
I can build asm1130 using my ancient Ubuntu version where gcc -v shows:
gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)
But using a recent version of Gentoo where gcc -v shows:
gcc version 14.2.1 20241221 (Gentoo 14.2.1_p20241221 p7)
the build (
make asm1130, within the Ibm1130/utils subdirectory) fails with:---snip---
asm1130.c: In function ‘save_symbols’
asm1130.c:2132:9: error: implicit declaration of function ‘unlink’; did you mean ‘x_link’? [-Wimplicit-function-declaration]
2132 | unlink(SYSTEM_TABLE);
| ^~~~~~
---snip---
man -s2 unlinkshows that#include <unistd.h>is needed but that iscurrently ifdef'ed under VMS. So the fix is to use it unconditionally.
I've tested that this works on both the old and newer gcc versions.
BTW, I was using
asm1130as the cross-assembler for my port ofromforth which is dialect of Forth
to the IBM 1130 (only under emulation, using SIMH/ibm1130 as the emulator)