Closed npm-sdr closed 5 years ago
(I slightly edited your comment to preserve the line breaks)
Could you please post the output of the cmake
call? And could you put VERBOSE=1
in front of your make
call, and post the (affected) result lines here?
Hmm, I can't really reconstruct the situation here. Does the result change, if you apply the following patch? linker_flags.patch.txt
Hi Stefan,
I applied the patch and re-tried. It's still failing but with one less warning. Passing the linker flags to the linker using -Wl made no difference to -s and -z flags but the warning re unused -pie flag is now gone.
ld: warning: option -s is obsolete and being ignored
ld: unknown option: -z
I suspect clang-10.0.0 on macOS 10.14.2 doesn't support -z anymore and -s and flag is being deprecated.
$ clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Regards, Niro.
On Sun, 13 Jan 2019 at 17:54, Stefan Pöschel notifications@github.com wrote:
Hmm, I can't really reconstruct the situation here. Does the result change, if you apply the following patch? linker_flags.patch.txt https://github.com/Opendigitalradio/dablin/files/2753320/linker_flags.patch.txt
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Opendigitalradio/dablin/issues/44#issuecomment-453851104, or mute the thread https://github.com/notifications/unsubscribe-auth/AgFDs30UZAnelIZPYq5kM9enj77pJ1h1ks5vC3LcgaJpZM4Zwo5V .
Interesting that it makes a different in terms of PIE.....on my system GNU ld crashes with -Wl,-pie
...the other changes are fine and lead to the same result.
I suspect clang-10.0.0 on macOS 10.14.2 doesn't support -z anymore and -s and flag is being deprecated.
So the question arises, how are PIE, RELRO and striping enabled on Mac. Is there a different way? What does checksec.sh show, with the current compilation result on the one hand, and without the hardening added by the problematic commit on the other hand?
As there currently seems no way to use the respective params with clang/LLVM, I disabled the recently added parameters for now, if clang is used. Please check if this fixes your compilation and if so, close this issue.
Hi Stefan,
I've just updated to the top of next branch and rebuilt - builds fine on macOS now.
Sorry for the delay and many thanks. Niro.
Fixed
@npm-sdr These are not supported by GCC either. In fact, it is Apple linker does not accept these, compiler seems irrelevant.
Adding -z switch to the linker flags breaks linking on macOS using clang.
_Originally posted by @npm-sdr in https://github.com/Opendigitalradio/dablin/commit_comment/create#commitcomment-31847496_