Skip to content
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

fix c-ares after introducing -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION #413

Closed
kcc opened this issue Feb 22, 2017 · 3 comments
Closed

fix c-ares after introducing -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION #413

kcc opened this issue Feb 22, 2017 · 3 comments

Comments

@kcc
Copy link
Contributor

kcc commented Feb 22, 2017

See #410 (comment)

configure: CFLAGS error: CFLAGS may only be used to specify C compiler flags, not macro definitions. 

One solution is to remove -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION from global flags and use it only in those projects there needed. (would be sad).

Another solution is to hack https://github.com/google/oss-fuzz/blob/master/projects/c-ares/build.sh to cut -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION from CFLAGS (ouch!). Let me try this first.

Also, let me ask David why is the configure script that picky...

OMG, I hate build systems.

@daviddrysdale
Copy link
Contributor

AIUI you should use CPPFLAGS for preprocessor definitions, and CFLAGS for C-specific options. That way, the preprocessor options (-Iwherever -Dwhatever) can also be used in a C++ rule, without needing duplication between CFLAGS and CXXFLAGS.

Cf. http://stackoverflow.com/questions/2754966/cflags-vs-cppflags

@kcc
Copy link
Contributor Author

kcc commented Feb 23, 2017

Not all build systems will understand CPPFLAGS (or will they?), and only c-ares complains this way.
Do you know what is special about c-ares that it forbids the use of -DFOO in CFLAGS?

@daviddrysdale
Copy link
Contributor

Looks like the check only went in a few years ago, but I don't the reasons why. c-ares does get used on a lot of obscure platforms though, so it may have been an attempt to reduce misconfigurations with odd toolsets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants