From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1316 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: customizable -lgcc in makefile Date: Tue, 17 Jul 2012 13:45:28 -0400 Message-ID: <20120717174528.GQ544@brightrain.aerifal.cx> References: <20120717163728.GG14463@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1342547186 6309 80.91.229.3 (17 Jul 2012 17:46:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2012 17:46:26 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1317-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 17 19:46:23 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SrBqj-0002dU-Gp for gllmg-musl@plane.gmane.org; Tue, 17 Jul 2012 19:46:17 +0200 Original-Received: (qmail 15786 invoked by uid 550); 17 Jul 2012 17:46:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15773 invoked from network); 17 Jul 2012 17:46:15 -0000 Content-Disposition: inline In-Reply-To: <20120717163728.GG14463@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1316 Archived-At: On Tue, Jul 17, 2012 at 06:37:28PM +0200, Szabolcs Nagy wrote: > the following modification allows config.mak > to override the -lgcc linker flag > > this is needed when compiling musl with pcc > (then LIBCC=-Lpath/to/libpcc -lpcc) > > i wonder what clang needs there and if there is > any libgcc specific code in musl musl itself does not contain any references to libgcc/libpcc/etc. The references are generated by the compiler when it's too lazy to actually generate the code it needs for things like 64-bit division and instead just generates a function call to library code. > diff --git a/Makefile b/Makefile > index 0c13417..ad701c9 100644 > --- a/Makefile > +++ b/Makefile > @@ -23,6 +23,7 @@ GENH = include/bits/alltypes.h > IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h > > LDFLAGS = > +LIBCC = -lgcc > CPPFLAGS = > CFLAGS = -Os -pipe > CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc > @@ -91,7 +92,7 @@ include/bits/alltypes.h: include/bits/alltypes.h.sh > lib/libc.so: $(LOBJS) > $(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS) -nostdlib -shared \ > -Wl,-e,_start -Wl,-Bsymbolic-functions \ > - -Wl,-soname=libc.so -o $@ $(LOBJS) -lgcc > + -Wl,-soname=libc.so -o $@ $(LOBJS) $(LIBCC) Looks clean. I'll probably apply this soon unless any improvements are suggested. Rich