-
Notifications
You must be signed in to change notification settings - Fork 154
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
error: implicit declaration of function 'ERROR_dictionary' is invalid in C99 #1462
Comments
OS X 10.6 is also known as "Snow Leopard". It was released on 2009-08-28 and the last update was 2011-07-25. From a ksh perspective that OS would be considered a new enough platform to warrant supporting. So we should probably try to support it if feasible. I have a Snow Leopard VM for VirtualBox but haven't booted it in a couple of years. Fortunately, it isn't necessary to boot up a Snow Leopard system to figure out what's wrong. This has been broken since we switched to Meson more than two years ago. That macro used to have multiple definitions in the source. For example, from ./src/cmd/ksh93/include/defs.h:
Looking at the
Note that the last one in error.h (written by the old AST team) does not correctly use The build failure on OS X Snow Leopard is nominally due to the test in ./features/dll/meson.build:
That causes this unconditional definition of Line 35 in e770c77
It is not obvious if, and why, this used to be valid. Perhaps the old build process allowed unresolved symbols. The main thing is that this problem report points out that on OS X 10.6 the block of code in src/lib/libdll/dlfcn.c predicated on this symbol is true :
Why isn't that true on current (e.g., 10.15) versions of OS X? That it is true causes the code to try and resolve a function that should otherwise be an identity macro. |
The obvious fix, and the one I'll commit, is to predicate the definition of |
I think the relevant difference is that on 10.6 (and I guess earlier) the meson output says:
while on 10.7 and later it says:
I think this means that on 10.7 and later it's taking this code path in ast/src/lib/libdll/dlfcn.c:
while on 10.6 and earlier it's taking the code path where Note that on both systems we're linking in the MacortsLegacySupport library to provide some newer functions to older systems. If you want to fully support 10.6 without needing our compatibility library, I'll report those issues separately. |
And meson-log.txt says this is because:
|
@ryandesign Thanks for the extra info. Does MacPorts use clang or gcc when building ksh? Which version of the compiler? We currently don't really have much support for old OS releases in our CI environments. So, I think I'll try and get my OS X Snow Leopard VM up to date and build ksh on it since this seems like a good test of support for an old environment. |
We are using clang. On 10.7 and later we get by with the clang that comes with Xcode. The clang that comes with Xcode on 10.6 is very old and only has the C compiler, not the C++ compiler, so on 10.6 we use a copy of clang 9 that was installed with MacPorts. |
And this could perhaps explain why it used to work years ago but doesn't now. The default compiler on 10.6 was Apple gcc 4.2.1. It may have allowed things that clang doesn't. The error message mentioned C99 specifically. gcc 4.2.1 defaulted to C89 mode while clang originally defaulted to C99 mode and more recent versions have started defaulting to C11 mode. |
Description of problem:
ksh fails to build on Mac OS X 10.6 with clang 9
Ksh version:
2020.0.0 and latest master (43d1853)
How reproducible:
Always
Steps to reproduce:
Actual results:
Build log for 2020.0.0
Build log for 43d1853
Expected results:
Successful build
Additional info:
It builds fine on later versions of Mac OS X.
The text was updated successfully, but these errors were encountered: