-
Notifications
You must be signed in to change notification settings - Fork 282
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
clang: error: unknown argument: '-fstack-protector-strong' #1243
Comments
Welcome back @ryandesign I recall speaking with you about something 2 or 3 years ago. OS X 10.9? That's rather elderly. The current macOS is Catalina:
It's curious that Apple changed the name to "macOS" and nobody updated sw_vers. We had issues on other platforms with that flag (Solaris, I think). You're right, it's probably better to test compile the flag. Would you like to propose a patch as you have the environment in which to test it. I have a VM with Yosemite, however I don't believe I have Xcode 6 on any of my machines. |
Yes it is. It's nice to support even elderly systems when possible. MacPorts has automated build servers for Mac OS X 10.6 and later. We even still fix issues reported by users running Mac OS X 10.4 when we can.
Yes it is.
I've heard that they've changed it in macOS Big Sur.
I don't know cmake very well so I couldn't propose a patch, but I can certainly test any changes you make. |
Yes. I prefer not to "drop" elderly platforms if retaining them is pain free. So on Visual Studio, we build all the way back to 2008. Let me have a think what to do about this. @piponazo is our CMake expert. Is there any urgency about this? |
No I can't really call problems affecting OS versions this old urgent. I've worked around the problem in MacPorts by requiring a newer compiler for now. |
I appreciate you working on MacPorts. I'm not an expert on CMake I'll try to get something done about this. It's too late now for v0.27.3 which shipped on 2020-06-30. |
It looks like maybe we want to use CheckCCompilerFlag. |
Good idea. I've downloaded Xcode 6.1 and the command-line tools on Yosemite and I'll look at this later today. |
@ryandesign I've tried this on Yosemite with cmake 3.6 (we need 3.3.2 mininum). Doesn't seem to work. The 3.6 documentation has that command documented in Upper case. And that doesn't seem to work either. I'm going to leave this for somebody else to investigate as I'm working on a book about Exiv2 and will retire when that's finished.
|
I think cmake commands are case-insensitive so either |
You're right. I didn't have the include thing and that's why it didn't work. I'll look at this again tomorrow. |
@ryandesign I've submitted a PR #1245 to branch 0.27-maintenance. I will test it this on my home build-server mingw, cygwin, msvc2019, linux, macOS, solaris, FreeBSD and NetBSD. I've tested this on Yosemite with Xcode 6.1. When I installed python3, the test suite ran successfully on 0.27-maintenance. I haven't submitted code to 'master' for a couple of years now as I want to retire and leave Exiv2 to other people. I have continued to maintain the 0.27-maintenance branch and hope Exiv2 v0.28 will be released in the next year. Once 0.28 ships, 0.27 "dots" will no longer be needed. I'm writing a book Image Metadata and Exiv2 Architecture to document my knowledge for a future maintainer. https://clanmills.com/exiv2/book |
@ryandesign Thanks very much for the review. I had noticed that I had a redundant define. I hadn't noticed stuff like Can you can give me the modified file or, even better, can you update the PR. If I wind my way though all your comments, I will make mistakes and introduce new errors. You mentioned something about an alternative to check_c_compiler_flag and I don't know CMake well enough to comment. However @piponazo is a wizard at this stuff and I hope he'll look at this over the weekend. May I grant you write permission to our repos and you can update the PR? |
Sure, I could add commits to the PR to make the changes I mentioned. Maybe I'll wait until @piponazo comments first. |
I closed PR #1245 because it's wrong. I can't fix it because of my dyslexia. |
I believe this is fixed with #1271. |
Describe the bug
Build fails:
Here is a full build log
To Reproduce
Build exiv2 0.27.3 on OS X 10.9 with Apple clang from Xcode
Expected behavior
successful build
Desktop (please complete the following information):
Additional context
The problem is the code in your cmake/compilerFlags.cmake which says:
Apple clang and open source clang use different version numbering schemes. So even if this flag is supported in open source clang 3.7 and later, the version number of Apple clang in which it was added is a different number. I don't know what that number is specifically, but for comparison, it built fine on OS X 10.10 with Apple clang 7.0.2.7000181 (from Xcode 7.2.1). So it may be that support for this flag was added in Apple clang 7.
But as you see, using compiler version numbers to infer availability of features is brittle. It would be better to actually test the compiler to see whether it supports a flag.
The text was updated successfully, but these errors were encountered: