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
3
votes
1 answer

CFLAGS and LDFLAGS vs CPATH and LIBRARY_PATH

in this thread https://unix.stackexchange.com/questions/149359/what-is-the-correct-syntax-to-add-cflags-and-ldflags-to-configure someone says that CFLAGS and LDFLAGS do not work with every configure script. Why? I would like to have more explanation…
user3182532
  • 1,097
  • 5
  • 22
  • 37
3
votes
2 answers

Set "OTHER_LDFLAGS" through command line with xcodebuild

I have successfully compiled the project through command line.But i want set library(.a) file through command line . It successfully build with below command /Users/Mahen/Documents/workspace/TestingApplication/Test/Test.xcodeproj -configuration…
mahen
  • 165
  • 3
  • 16
2
votes
1 answer

rpath in LDFLAGS for CMAKE

I am currently porting my automake into CMAKE. I am trying to find what's equivalent of: myprogram_LDFLAGS = \ -lcurl \ -ldl \ -lresolv \ -Wl,-rpath,'/approot/services/lib' What is the corresponding command in cmake to set my…
ssk
  • 9,045
  • 26
  • 96
  • 169
2
votes
1 answer

Why does LDFLAGS put my libraries before object files generating undefined references?

Here's what happens. $ LDFLAGS=-ltestu01 make exemplo cc -ltestu01 exemplo.c -o exemplo /home/melba/tmp/ccO2KkjG.o: In function `main': exemplo.c:(.text+0x6e): undefined reference to `unif01_CreateExternGenBits' exemplo.c:(.text+0x7e):…
user9654148
  • 125
  • 7
2
votes
1 answer

ld: warning: -no_pie ignored for arm64

I used "-no_pie" for LDFLAGS , but prompt: "ld: warning: -no_pie ignored for arm64". then I use otool to check the binary ,there is no PIE flag with V7 and V7S cpusubtype,but still in ARM64,is the ld don't support -no_pie for ARM64?
vane
  • 99
  • 6
2
votes
1 answer

CFLAGS CPPFLAGS and LDFLAGS invoke cc but don't pass the values to gcc

I wrote a simple printf C code and made a simple makefile. When I run make with CFLAGS, CPPFLAGS and LDFLAGS, the values of the variables goes into a cc execution, followed by a gcc execution without those values, like this: $ CFLAGS="-I."…
2
votes
1 answer

LDFLAGS in Qt pro file

I have a Qt project that I'm compiling with GCC and MinGW for Ubuntu and Windows. I got a requirement to harden it by adding the following LDFLAGS: Stack execution protection: LDFLAGS="-z noexecstack" Data relocation and protection (RELRO):…
quinz
  • 1,282
  • 4
  • 21
  • 33
2
votes
1 answer

Determining the target architecture in an Autoconf M4 script

I'm currently working with a system that requires building both i686 and x86_64 libraries, building and installing them on the same system - it is a legacy project that has a mix of newer ABI-agnostic code that is generally run in 64 bit because it…
matthock
  • 629
  • 1
  • 4
  • 15
2
votes
0 answers

Cross compilation of openssh for ARM

I am trying to cross-compile openssh for ARM. I have suceesfully installed zlib and openssl. I configured openssh package as following: ./configure --prefix=/usr/openssharm --host=arm -- oldincludedir=/usr/opensslarm/include…
user361537
  • 21
  • 3
2
votes
2 answers

LDFLAGS usage in autotools with libtool

Depending on the OS, I define a special LDFLAGS in my configure.ac: AC_CANONICAL_HOST if test "$host_os" = cygwin then LDFLAGS="$LDFLAGS -Wl,-no-undefined" export LDFLAGS fi AC_SUBST([LDFLAGS]) The package uses AC_PROG_LIBTOOL and when…
Irfy
  • 9,323
  • 1
  • 45
  • 67
1
vote
0 answers

Yocto QA issue: test-dev doesn't have GNU_HASH error has never gone

I have created my own recipe(test.bb), which is golang package, and build it with bitbake. However, on the do_package_qa flow it ran into error "test-dev doesn't have GNU_HASH (didn't pass LDFLAGS?). ... inherit go inherit…
Kyle
  • 11
  • 2
1
vote
0 answers

How to delete specific LD_FLAG in xcconfig through Podfile script?

I am trying to delete a certain "-framework SwiftProtobuf" in OTHER_LDFLAGS from the .xcconfig file in XCode because it is causing a conflict with another library: "Class _TtC13SwiftProtobuf17AnyMessageStorage is implemented in both…
1
vote
0 answers

ld: unrecognized option '-Wl,-O1'

Written a new recipe for libmoose module of perl and found the following error, Can anyone please help to fix it. | x86_64-poky-linux-ld: unrecognized option '-Wl,-O1' | x86_64-poky-linux-ld: use the --help option for usage information | Couldn't…
Mohammed Harris
  • 326
  • 6
  • 25
1
vote
1 answer

C++: Including an external library in Makefile

So, I have some trouble including the ncurses-library in a C++ program. It seems my Makefile isn't set correctly and the library-functions can't be found. I installed the library with "sudo apt-get install libncurses5-dev libncursesw5-dev" and I'm…
T. Pieper
  • 36
  • 4
1
vote
1 answer

How can I compile certain files and add flags in a Makefile only when a specific target is selected?

I am currently facing a problem when writing a Makefile for a C project. In particular, my project should have at least two Makefile targets (target_light and target_full), being target_light the default one. target_light should compile all my…
es483
  • 361
  • 2
  • 16