From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: luajit: Add -fPIC into CFLAGS. Date: Tue, 16 Dec 2014 22:08:01 +0100 Message-ID: <87zjanpaku.fsf@gnu.org> References: <1418683961-28525-1-git-send-email-sleep_walker@suse.cz> <87sigf7cat.fsf@gnu.org> <87zjanwg1p.wl%sleep_walker@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zLq-0005f7-1O for guix-devel@gnu.org; Tue, 16 Dec 2014 16:08:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0zLk-0001Jo-B4 for guix-devel@gnu.org; Tue, 16 Dec 2014 16:08:13 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:50208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zLk-0001Jh-3h for guix-devel@gnu.org; Tue, 16 Dec 2014 16:08:08 -0500 In-Reply-To: <87zjanwg1p.wl%sleep_walker@suse.cz> (Tomas Cech's message of "Tue, 16 Dec 2014 20:28:02 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Tomas Cech Cc: guix-devel@gnu.org Tomas Cech skribis: > At Tue, 16 Dec 2014 18:08:10 +0100, > Ludovic Court=C3=A8s wrote: >>=20 >> Tom=C3=A1=C5=A1 =C4=8Cech skribis: >>=20 >> > * gnu/packages/lua.scm (luajit): Add -fPIC into CFLAGS and pass it to = make. >>=20 >> [...] >>=20 >> > --- a/gnu/packages/lua.scm >> > +++ b/gnu/packages/lua.scm >> > @@ -92,7 +92,8 @@ for configuration, scripting, and rapid prototyping.= ") >> > (arguments >> > '(#:tests? #f ;luajit is distributed withou= t tests >> > #:phases (alist-delete 'configure %standard-phases) >> > - #:make-flags (list (string-append "PREFIX=3D" (assoc-ref %outp= uts "out"))))) >> > + #:make-flags (list (string-append "CFLAGS=3D-fPIC " (or (geten= v "CFLAGS") "")) >> > + (string-append "PREFIX=3D" (assoc-ref %outp= uts "out"))))) >>=20 >> Could you add a comment explaining why this is needed? > > OK, I'll do. But I don't know details and linking during build of EFL > failed when this was missing. Is this level of explanation sufficient? Interestingly luajit contains both a .so and a .a; src/Makefile has the rule to build .o files: --8<---------------cut here---------------start------------->8--- %.o: %.c $(E) "CC $@" $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=3D_dyn.o) $< $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< --8<---------------cut here---------------end--------------->8--- Where $(TARGET_DYNCC) does use -fPIC. So it all looks normal. What=E2=80=99s the exact error you were getting wh= en building EFL? >> Normally I would expect the makefiles to already contain that flag if >> it=E2=80=99s needed. > > Btw. it was already added to lua variable in the same file so I'm at > least consistent within file ;) Right, commit c361d075d3 provided a similar fix for Lua itself. It looks like there=E2=80=99s a pattern of being unable to build a shared libr= ary. :-) Thanks, Ludo=E2=80=99.