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

CFLAGS error #58

Closed
Logic-gate opened this issue Jul 6, 2016 · 9 comments
Closed

CFLAGS error #58

Logic-gate opened this issue Jul 6, 2016 · 9 comments

Comments

@Logic-gate
Copy link

Logic-gate commented Jul 6, 2016

Hey guys,

I am not proficient with building from source, but unfortunately I have to since there is no package in Solus repos.

I am getting this:

/c-ares-1.11.0 # ./configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... not specified (assuming yes)
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to expose internal static functions for testing... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ar... /usr/bin/ar
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking whether to build with code coverage support... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
configure: using CFLAGS: -mtune=generic -march=x86-64 -ftree-vectorize -g2 -O2 -pipe -fPIC -Wformat -Wformat-security -fno-omit-frame-pointer -fstack-protector-strong --param ssp-buffer-size=4 -fexceptions -D_FORTIFY_SOURCE=2 -feliminate-unused-debug-types -Wno-error -Wp,-D_REENTRANT
configure: CFLAGS error: CFLAGS may only be used to specify C compiler flags, not macro definitions. Use CPPFLAGS for: -D_FORTIFY_SOURCE=2
configure: error: Can not continue. Fix errors mentioned immediately above this line.
`

I am not sure if this is an issue from my side or yours. Would appreciate any feedback.

Addendum: Running on Solus 1.2. C-ares version 1.11.0.

@dfandrich
Copy link
Collaborator

dfandrich commented Jul 6, 2016 via email

@Logic-gate
Copy link
Author

I received some assistance from the Solus community(kfrc4267) that resolved the issue.

export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2}"

@Pixeliz3d
Copy link

Today I encountered this problem in FreeBSD, when compiling from ports. This patch helped:
patch-configure.txt
I placed it to /usr/ports/dns/c-ares/files/
Everything was compiled without any errors.

P.S. GitHub does not allow to upload a file without an extension. It needs to be removed (.txt).

@dfandrich
Copy link
Collaborator

dfandrich commented Jun 30, 2018 via email

@Pixeliz3d
Copy link

This flag I added myself and other programs in the ports it does not prevent to build. I really do not understand why these tests exist.

@dfandrich
Copy link
Collaborator

dfandrich commented Jun 30, 2018 via email

@Pixeliz3d
Copy link

Pixeliz3d commented Jun 30, 2018

There are no problems with using preprocessor flags in CFLAGS (except ideological ones). But with these tests there is definitely a problem where preprocessor flags are set in CFLAGS.
For example, -DHARDENEDBSD in HardenedBSD.

https://stackoverflow.com/questions/2754966/cflags-vs-cppflags#2756681

@dfandrich
Copy link
Collaborator

dfandrich commented Jun 30, 2018 via email

@Pixeliz3d
Copy link

Pixeliz3d commented Jun 30, 2018

Well, it looks like I got excited. Indeed, there is a case where only CPPFLAGS is used. It's funny, I just updated the ports. This patch does not seem to be needed anymore (in FreeBSD and forks). Because it has long been in the ports.

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

3 participants