Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libtool is discarding `-static` flag

Tags:

libtool

I am building flex-2.5.39 which I configured using:

./configure --enable-static LDFLAGS=-static CC=/x86_64-linux-musl/bin/x86_64-linux-musl-gcc

But at the very end, libtool is not linking statically. It is, in fact, simply discarding the flag:

[ root@836843e09b55:/flex-2.5.39 ]$ make flex
/bin/bash ./libtool --tag=CC   --mode=link /x86_64-linux-musl/bin/x86_64-linux-musl-gcc  -g -O2  -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o lib/libcompat.la -lm 
libtool: link: /x86_64-linux-musl/bin/x86_64-linux-musl-gcc -g -O2 -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o  lib/.libs/libcompat.a -lm
[ root@836843e09b55:/flex-2.5.39 ]$

How can I make libtool accept the flag and pass it on?

like image 471
Janus Troelsen Avatar asked Mar 14 '15 21:03

Janus Troelsen


1 Answers

Using --static (extra minus), it works.

like image 74
Janus Troelsen Avatar answered Oct 22 '22 21:10

Janus Troelsen