Linker flags are arguments passed to a linker to specify options, for instance to link the code with a certain library, etc
Questions tagged [linker-flags]
125 questions
7
votes
1 answer
gcc: error: unrecognized option --wrap
[Update] Sorry for top posting, but it might help to know this first, as it probably changes the problem.
The --wrap is an option to the linker ld, not to gcc.
But my Eclipse project is using gcc for the link stage.
How can I use wrap functions, as…

Mawg says reinstate Monica
- 38,334
- 103
- 306
- 551
6
votes
1 answer
How to ignore -Objc flag for specific library
In my project I have a high number of static libraries. I currently use the -ObjC linker flag which will include all members of static libraries that implement any objective-c class.
I have 1 particularly large static library where I specifically…
user712850
4
votes
1 answer
QMake - How and where to add linker flag?
I tried to add the following in the .pro file of our project:
win32 {
...
QMAKE_LFLAGS_WINDOWS += -Wl,--large-address-aware
}
I get an error LINK : warning LNK4044: Nicht erkannte Option /Wl,--large-address-aware; wird ignoriert.…

goulashsoup
- 2,639
- 2
- 34
- 60
4
votes
2 answers
CMake AMRCC + custom linker
I'm trying to use cmake in a project which is compiled using armcc, but use a custom proprietary linker (not armlink).
I've changed the variables in the toolchain.cmake file as following:
unset (CMAKE_LINKER CACHE)
set (CMAKE_LINKER "my_linker"…

Valmir
- 401
- 1
- 5
- 14
4
votes
1 answer
Adding Linker Flag to configure.ac
I want to add --export-dynamic flag to my project's configure.ac file.
I am trying to compile my project files that must use this flag after pkg-config --cflags --libs gtk+-3.0.
The following are contents of my configure.ac file.
AC_INIT(myapp,…

Gurjot Bhatti
- 977
- 1
- 10
- 24
3
votes
1 answer
Difference between "-fno-pie" and "-no-pie"
I don't find any useful information on the differences between "-fno-pie" and "-no-pie". Are they gcc flags or ld flags? Are they both necessary or not?
I found a piece of makefile that uses these lines:
CC = @gcc -fno-pie -no-pie
LD = @gcc -fno-pie…

Francesco
- 523
- 4
- 25
3
votes
1 answer
Why does gcc link with '-z now' by default, although lazy binding is the default for ld?
man ld has the following to say about -z lazy:
...tell the dynamic linker to defer function call resolution to the point when the function is called ... Lazy binding is the default.
On the other hand, gcc --verbose main.c passes -z now -z relro to…

bking
- 275
- 2
- 11
3
votes
2 answers
How can i get LD to put always put the entry point at the location of -Ttext?
I'm writing my own operating system (static addresses) and I struggle to get the linker to always put my _start function at my desired location within the processes. I specify the location with -Ttext 0x10000 in my build file (Lets just say 0x10000…

Espen Nilsen
- 121
- 1
- 7
3
votes
1 answer
Loading a shared library failed with undefined symbol: __gcov_merge_add error
I am trying to integrate gcov for an existing build environment.
Adding -fprofile-arcs and -ftest-coverage to CXXFlags got me through building and generating .gcno static files with out any issues. But once I start to deploy this package I am…

pavan kumar
- 41
- 3
3
votes
0 answers
Xcode + Swift : How to Prevent a framework from compiling
I have a situation where I need a framework added under "Link Binaries with Libraries" but it creates some issue for me, specifically on iOS 9 simulator.
It MUST be noted that this framework work without importing it programatically. In
other words…

java_doctor_101
- 3,287
- 4
- 46
- 78
3
votes
0 answers
Checking output file size in linker script
I am experimenting with GNU LD linker scripts and I have defined two memory blocks, using the MEMORY command, like this:
MEMORY
{
code [(rx)] : ORIGIN = 0x00010000, LENGTH = 0x00020000 /* 128 kB */
heap [(rwx)] : ORIGIN = 0x40000000, LENGTH…

Nikopol
- 1,091
- 1
- 13
- 24
3
votes
1 answer
Duplicate symbols between Facebook SDK and AWS v2
I am getting crazy of these errors. It's been hours I am fighting it with no luck. How can I solve this thing?
I have -all_load linker flag. Tried changing to -force_load and got "ld: file not found: -fobjc-arc".
Please help.
duplicate symbol…

user-123
- 874
- 1
- 13
- 34
3
votes
0 answers
How to compile universal libraries on Mac OS X with separate compile or link option for i386 and x86_64 binary part?
I'm compiling a program that use luajit library(in static link way) for Mac OSX with Xcode 5.02.
The runtime memory mechanism of luajit makes it required to add the link option "-pagezero_size 10000 -image_base 100000000" on x86_64 build for Mac OSX…

SONIC3D
- 489
- 4
- 6
3
votes
2 answers
How to allow -z multidefs with g++47
How can I tell the linker of g++ to allow multiple definitions of symbols (choose the first appearance)?
-z multidefs Allows multiple symbol definitions. By default, multiple symbol definitions occurring between relocatable objects (.o files)
…

quimnuss
- 1,503
- 2
- 17
- 37
2
votes
0 answers
How do I properly link the Google Protocol Buffers library with my application at compilation?
I am following the tutorial listed here on Protobuf's website. I copied the sample addressbook.proto and compiled it using the line
protoc --cpp_out=. addressbook.proto
Which produced addressbook.pb.cc and addressbook.pb.h. Here is my program,…

Hunter
- 21
- 1