cflags

What does .rodata and -fPIC mean when compiling OpenSSL?

蹲街弑〆低调 提交于 2019-12-19 19:56:27
问题 I am trying to compile openssl but encountering an error. The CFLAGS in use are: -O2 -fPIC -fno-strict-overflow Can someone explain to me please what is .rodata and what the following sentence means? /usr/bin/ld: libcrypto.a(wp_block.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC libcrypto.a(wp_block.o): error adding symbols: Bad value I am unsure what is libcrypto.a but apparently it is part of openssl. How could this possibly

CFLAGS vs CPPFLAGS

删除回忆录丶 提交于 2019-12-17 08:03:39
问题 I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor. But I still don't understand the difference. I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing I care about? Under what circumstances do I need to give the compiler an extra include path? In general, if the preprocessor finds and includes needed header

CFLAGS vs CPPFLAGS

随声附和 提交于 2019-12-17 08:03:15
问题 I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor. But I still don't understand the difference. I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing I care about? Under what circumstances do I need to give the compiler an extra include path? In general, if the preprocessor finds and includes needed header

Changing *FLAGS in configure.ac vs. caching with subprojects

耗尽温柔 提交于 2019-12-10 18:08:04
问题 Say I wish to add a specific flag to CFLAGS within my configure script, that should propagate to all subprojects' configure scripts: CFLAGS+=" -Dfoobar" export CFLAGS AC_CONFIG_SUBDIRS([sub]) This works when configure is invoked trivially. As soon as one of the following happens: CFLAGS is exported in the environment when configure is invoked CFLAGS is set on configure command-line caching is used ( configure -C ) This approach no longer works. In the first two cases, the exported CFLAGS is

How to set variable according to gradle flavors

扶醉桌前 提交于 2019-12-03 08:37:41
问题 I want to pass a variable test that I set differently per flavor as a define to the NDK. But for some reason he always passes the value of the last flavor. Here is the build.gradle: apply plugin: 'com.android.library' def test android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultPublishConfig "flavorARelease" publishNonDefault true defaultConfig { minSdkVersion 15 targetSdkVersion 17 ndk { moduleName "test" ldLibs "log" } } productFlavors { flavorA { test = 1 } flavorB { test = 2

How to set variable according to gradle flavors

前提是你 提交于 2019-12-03 01:33:29
I want to pass a variable test that I set differently per flavor as a define to the NDK. But for some reason he always passes the value of the last flavor. Here is the build.gradle: apply plugin: 'com.android.library' def test android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultPublishConfig "flavorARelease" publishNonDefault true defaultConfig { minSdkVersion 15 targetSdkVersion 17 ndk { moduleName "test" ldLibs "log" } } productFlavors { flavorA { test = 1 } flavorB { test = 2 } } buildTypes { debug { ndk { if (cFlags == null) { cFlags = "" } cFlags = cFlags + " -DLOGGING=1

What does .rodata and -fPIC mean when compiling OpenSSL?

匆匆过客 提交于 2019-12-01 18:14:12
I am trying to compile openssl but encountering an error. The CFLAGS in use are: -O2 -fPIC -fno-strict-overflow Can someone explain to me please what is .rodata and what the following sentence means? /usr/bin/ld: libcrypto.a(wp_block.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC libcrypto.a(wp_block.o): error adding symbols: Bad value I am unsure what is libcrypto.a but apparently it is part of openssl. How could this possibly be fixed? /usr/bin/ld: libcrypto.a(wp_block.o): relocation R_X86_64_32S against `.rodata' can not be

CFLAGS vs CPPFLAGS

杀马特。学长 韩版系。学妹 提交于 2019-11-27 10:05:54
I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor. But I still don't understand the difference. I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing I care about? Under what circumstances do I need to give the compiler an extra include path? In general, if the preprocessor finds and includes needed header files, why does it ever need to be told about extra include directories? What use is CFLAGS at all? (In

Set CFLAGS and CXXFLAGS options using CMake

懵懂的女人 提交于 2019-11-27 02:57:23
I just want to debug some code running on Linux and I need a debug build ( -O0 -ggdb ). So I added these things to my CMakeLists.txt : set(CMAKE_BUILD_TYPE DEBUG) set(CMAKE_C_FLAGS "-O0 -ggdb") set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") set(CMAKE_C_FLAGS_RELEASE "-O0 -ggdb") set(CMAKE_CXX_FLAGS "-O0 -ggdb") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb") set(CMAKE_CXX_FLAGS_RELEASE "-O0 -ggdb") When I tried to compile I turned verbose on using make VERBOSE=1 And I observed the output, like this ... /usr/bin/c++ -D_BSD_SOURCE **-O0 -ggdb** -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar

Set CFLAGS and CXXFLAGS options using CMake

橙三吉。 提交于 2019-11-26 12:36:20
问题 I just want to debug some code running on Linux and I need a debug build ( -O0 -ggdb ). So I added these things to my CMakeLists.txt : set(CMAKE_BUILD_TYPE DEBUG) set(CMAKE_C_FLAGS \"-O0 -ggdb\") set(CMAKE_C_FLAGS_DEBUG \"-O0 -ggdb\") set(CMAKE_C_FLAGS_RELEASE \"-O0 -ggdb\") set(CMAKE_CXX_FLAGS \"-O0 -ggdb\") set(CMAKE_CXX_FLAGS_DEBUG \"-O0 -ggdb\") set(CMAKE_CXX_FLAGS_RELEASE \"-O0 -ggdb\") When I tried to compile I turned verbose on using make VERBOSE=1 And I observed the output, like this