Enable stack smashing protection - #315
Conversation
This is wrong, as it wouldn't recognize afl-gcc, gcc-${PLATFORM}. Also, it will probably break on Apple, as here Isn't there a better way to check for feature existence? This would also allw skipping the version check stuff. EDIT: Enter / Ctrl-Enter is unintuitive. |
|
The first two solutions that I can think are:
|
|
Your second option probably won't work reliably on Apple. Your first option sounds perfect, as we use and expect grep anyway, and wc should be installed on most systems. Thanks for your work, btw! |
|
Perfect :) Just changed |
|
Looks good. I'll squash it though, as two of three commits are just fixes of the first commit. |
|
I'm too dump to click 'squash', apparently. Other than that, let's hope the |
|
@BenWiederhake Would you like someone to test that? I could download a FreeBSD VM tonight and give it a spin. |
|
That would be nice, yes please. |
|
So I got a PC-BSD VM installed and I tried to build telegram-purple, I got ./configure to work after installing pkgconf but when I tried to make I got a 'Need an operator' error on lines 36, 38, 48 and 51, after that make fails. Anything else you guys need to test feel free to ping me. |
|
"Need an operator"? That doesn't sound like an error message from either Make, our makefile, the compiler, or anything else I know. |
|
I wish I could give you more details but that's all the make process spits out, no logs or anything AFAIK. |
Well, telling us what it spits out would be a helpful start. Also, please note that you'll need GNU make, not BSD make, and it's called |
|
Looks like I may have been using BSD make, will try again with gmake. |
|
gmake worked, forgot about that little BSD quirk, however it now fails with another error gmake -C tgl libs/libtgl.a define be16toh(x) betoh16(x)^ define le16toh(x) letoh16(x)^ define be32toh(x) betoh32(x)^ define le32toh(x) letoh32(x)^ define be64toh(x) betoh64(x)^ define le64toh(x) letoh64(x)^ |
|
I should have mentioned that you'll need to take care of a few things, as FreeBSD support is still a little rough, sorry: #260 (comment) For instance, you'll need this PR: vysheng/tl-parser#12 |
Same PR as the one in tgl. It adds compiler flags "-fstack-protector-strong" and "-D_FORTIFY_SOURCE=2", they increase security (protecting from stack smashing) in a production environment and allow developers to find bugs easily.