Questions tagged [ldflags]

LDFLAGS is a variable used in Makefiles. Specifically its value is added to linker command lines when the linker is invoked by an implicit rule.

LDFLAGS is a variable used in Makefiles. Specifically its value is added to linker command lines when the linker is invoked by an implicit rule.

64 questions
0
votes
1 answer

Set an environment variable before "go build"

Starting go1.10 only a safelist of compiler/linker options is allowed. Any options outside these need to be included in an environment variable e.g. ubuntu#echo $CGO_LDFLAGS_ALLOW -Wl,-Bdynamic,--wrap=memcpy More…
0
votes
2 answers

Difference between LDFLAGS and ldflags-y

The kbuild document says that: ldflags-y... [applies] only to the kbuild makefile in which they are assigned....[is used] for all ld invocations happening during a recursive build. while LDFLAGS... [is used] for all invocations of the linker. I…
Ta Thanh Dinh
  • 638
  • 1
  • 5
  • 12
0
votes
1 answer

where's to find all the ldflags shortcuts or its documentation?

I am always confused when a build system tells me that it found undefined reference to something. It is pretty clear that undefined reference error is related to the final linking, and therefore it is releated to the LDFLAGS variable in the build…
user7969519
0
votes
1 answer

undefined reference to error only for certain functions

I have a library and a C interface built for it. My program compiles just fine with versionString() but not with loadConfig(). How is that possible? walker.h : #ifndef WFE_C_H #define WFE_C_H #ifdef __cplusplus extern "C" { #endif const char*…
thylong
  • 3
  • 2
0
votes
1 answer

Set Xcode flags in order to embed python in my C++ project

I'm trying to embed python in my C++ project. I need to do it in order to use some functions that implement the Kolmogorov-Smirnov Test that are not available in C++. For now I'm just trying to see if Xcode is able to link and compile a simple…
jackscorrow
  • 682
  • 1
  • 9
  • 27
0
votes
1 answer

How to tell what gcc/autotools options from CFLAGS also go in LDFLAGS?

I have some -f compiler options in CFLAGS like -fsanitize=address and someone suggested to me a while ago that I also put those options in LDFLAGS so I did. It hasn't caused any problems. My question is how can I tell what compiler options from…
newguy
  • 617
  • 6
  • 15
0
votes
1 answer

Use arm-none-eabi-gcc to invoke arm-none-eabi-ld?

I built up a tool chain with gcc-6.2 with all the latest components. CC = arm-none-eabi-gcc AS = arm-none-eabi-as LD = arm-none-eabi-ld My Makefile flags are: CFLAGS = -std=c11 -Wall -Werror -Wfatal-errors -Wstrict-prototypes -Wundef…
rsun
  • 63
  • 1
  • 7
0
votes
1 answer

Remove a compiler / linker flag from autotools configure

There is a project (Antlr3 for C) that can be built with ./configure && make && make install. One of the flags that are used in the compilation command is -Wl,-soname -Wl,libantlr3c.so. The whole command is: libtool: link: gcc -shared …
jleeothon
  • 2,907
  • 4
  • 19
  • 35
0
votes
1 answer

GNU linker flags evaluation on Windows

I'm following this tutorial to add an automatic build versioning system on Kinetis KDS(Eclipse CDT, Windows 10). The example evaluates expressions using Linux shell commands like this -Xlinker --defsym -Xlinker __BUILD_NUMBER=$$(cat…
Alex
  • 119
  • 12
0
votes
1 answer

What is the meaning of ldFlags('-c') in build.gradle?

Please help me understand what does ldFlags('-c') in build.gradle in Android Studio mean? Refer example: https://github.com/googlesamples/android-ndk/blob/a498a7809cb7c9ec576b95e797edc4e64777ea00/MoreTeapots/nativeactivity/build.gradle
RRR
  • 339
  • 1
  • 6
  • 15
0
votes
1 answer

Can you statically link a specific library using visual-c++ on the command line?

To be more specific, I'm using visual-c++ in a MingW environment. I've got a makefile that is defining LDFLAGS as such: LDFLAGS="-MACHINE:X64 -OPT:REF,ICF -FORCE libtcmalloc_minimal.lib -INCLUDE:__tcmalloc" If I build my program this way, I'm…
SRG3006
  • 447
  • 8
  • 21
0
votes
0 answers

C create Makefile: how to set CFLAGS and LDFLAGS

I have simple modbus master project written in C99 C. Now I am compiling my application using (it works good): $ gcc -std=c99 -O2 -Wall -I/usr/include/modbus test.c -o test -L/usr/lib/modbus -L/usr/include/curl -lmodbus -lm -lcurl I would like to…
martin
  • 1,707
  • 6
  • 34
  • 62
0
votes
2 answers

Is it possible to set the compiling and linking flags in Makefile.am instead of configure.ac?

Is it possibleto set such flags in Makefile.am instead? That will solve the problem I asked at https://stackoverflow.com/questions/22617744/how-to-disable-the-runtime-checking-of-dynamic-libraries-if-they-are-not-used.
innoSPG
  • 4,588
  • 1
  • 29
  • 42
0
votes
1 answer

make command with math library

I need to just run the make command for makefile. But when I run this make command I get the error that "undefined reference to `log'" because I know this fact that it doesn't include math Library and we have to include at runtime. I know that if I…
0
votes
1 answer

Add LDFLAGS to newlib Makefiles

I'm trying to implement the _sbrk() function in the syscalls.c file. For this I need to link newlib with my projects object file. In newlibs root folder I did a simple ./configure --target=arm-elf which created me a bunch of Makefiles. But now I…
crizztus
  • 307
  • 3
  • 10