This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: How to build stand-alone (statically linked) gcc?


> Is there a way to build gcc itself such that gcc doesn't need dynamic library for maximum portability?

We have a similar setup here, using Ubuntu 14.04 to build our cross toolchains. To get statically linked
binaries, we had to add

CFLAGS+=-static LDFLAGS+=-static LIBTOOLFLAGS2+=-all-static

when calling "make" for binutils

and 

CFLAGS+=-static LDFLAGS+=-static

when calling "make" for gcc.

Optionally, i.e. if you also want a static gdb, you may add

LDFLAGS+=-static

when calling "make" for gdb.

Hope this helps, it does work fine here.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]