Questions tagged [cflags]

CFLAGS are switches that can be passed to the C compiler while compiling software.

CFLAGS are switches that can be passed to the C compiler while compiling software. CFLAGS are normally used inside Makefiles to have the same set of flags for the compilation.

CFLAGS can also be provided from outside of the Makefile via environment variables.

75 questions
1
vote
2 answers

Swift Package Manager throws nonWhitelistedFlags error

The problem occurs with system modules where it's necessary to use pkgConfig and pkgConfig contains flag definitions. ImageMagick (homebrewed) I create two packages: CMagicWand, type system-module module.modulemap module CMagickWand [system] { …
1
vote
1 answer

Determine which options OpenSSH was compiled with?

I want to upgrade openssh-server from source code. I have a problem on how to find out what options OpenSSH was compiled with. How can I determine which options OpenSSH was compiled with?
thorsiv
  • 91
  • 2
  • 6
1
vote
1 answer

For Android Studio NDK Gradle, how do I set different cFlags for different files?

I'm trying to create a C/C++ library using the latest version of Android studio (2.2.2). How can I specify different compile options for different code files? Some of the .cpp code in my library uses STL and requires "-std=gnu++11" in order to…
RCohen
  • 11
  • 2
1
vote
0 answers

CMake: how to avoid escaping spaces in command line?

I'm trying to write a CMakeLists.txt file for a project with some Makefile-based dependencies. To build the dependencies I use ExternalProject CMake plugin. In simple cases all is OK. But now I want to redefine CFLAGS variable for Makefile-based…
1
vote
1 answer

Per-source cflags

Is there a way in gyp to enable certain cflags only for some source files? In the context of this bug I'd like to find a way to have some code compiled with some SSE features enabled, while other code (to detect the availability of said features at…
MvG
  • 57,380
  • 22
  • 148
  • 276
1
vote
0 answers

Bundler install with cflags / distcc for a Rails 4 appllication

I am setting up a Rails 4 application on a Raspberry Pi. In order to speed up the installation of gems when I run bundle install I set up a distcc server (with the ARM cross compiler) on my Linux desktop. What I cannot find is a way to pass either…
Axiombadger
  • 161
  • 10
1
vote
1 answer

How to add '-march=' as default option to gcc?

I can not compile a simple c program without specifying '-march=native', I need to run it as: 'gcc -march=native -o hello hello.c'. I did: export CFLAGS='-march=native' export CXXFLAGS='-march=native' but didn't help. user@server:~$ gcc…
Balazs Varhegyi
  • 991
  • 1
  • 18
  • 37
0
votes
1 answer

react-native module - automatic CFlags

I created a react-native module. For iOS builds on Intel architecture I need the custom CFlags -maes -mpclmul Right now it works if the "consuming" project configures those for my module by clicking Pods -> "My Module" -> Build Settings -> Other C…
0
votes
0 answers

How can i set a define in a makefile with multiple executables

I am trying to compile a game (program1.exe) and editor(program2.exe) which share many of thesame source files, currently i use a #define in the source files, but i'd like to automate this if its even possible and move this to the makefile. The text…
Askalot
  • 1
  • 1
0
votes
1 answer

__stack_chk_fail_local and -fno-stack-protector - how to get it working?

Update: I've just discovered that the issue was specifically with a pre-built library included in my project (libxml2). It had been built with stack protection enabled, and so was relying on the __stack_chk_fail_local method. I've now rebuilt that…
Darren Taft
  • 198
  • 1
  • 8
0
votes
1 answer

Prepending custom dirs ($ZPFX/{include,libs}) to CPP..../LDFLAGS with use of config.site file of autotools?

I'm using a $CONFIG_SITE set to $ZPFX/share/config.site file containing: CPPFLAGS="-I$ZPFX/include $CPPFLAGS" LDFLAGS="-L$ZPFX/lib $LDFLAGS" where $ZPFX variable is my custom user prefix, similar to ~/.local. Now, the problem is that the system…
psprint
  • 3
  • 2
0
votes
0 answers

How to compile Python with CFLAGS = "-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"

I am trying to check perf profiling for python code.. I followed the official documentation. Updated my python3.10 to python3.12, I was not able to get function names in the perf report I tried running the way, documentation said python -X perf…
arivappa
  • 1
  • 1
0
votes
0 answers

Exclude directory from includes from `CFLAGS`

Is there a way to explicitly exclude a given directory from includes in CFLAGS, so that it can be set from command line at build time? What I'm searching for is like the opposite of -I, an -Ino.
Scrooge McDuck
  • 372
  • 2
  • 14
0
votes
1 answer

g++: error: unrecognized command-line option '--cflags' g++: error: unrecognized command-line option '--libs`'

I got these errors trying to execute mingw32-make: g++: error: unrecognized command-line option '--cflags' g++: error: unrecognized command-line option '--libs'` The makefile is the following: all: g++ fitscli.cpp vipsoperations.cpp fits.cpp…
0
votes
1 answer

emsdk compilation. what flags do i needfor sucsess?

Here are my compiler logs I don't quite understand what to do $ emmake make CFLAGS="-fstack-protector-strong" LDFLAGS="-fstack-protector-strong" make: make CFLAGS=-fstack-protector-strong LDFLAGS=-fstack-protector-strong emcc…
Ryufuz
  • 11
  • 3