guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: luajit: Add -fPIC into CFLAGS.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: luajit: Add -fPIC into CFLAGS.
Date: Tue, 16 Dec 2014 22:08:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Tomas Cech <address@hidden> skribis:

> At Tue, 16 Dec 2014 18:08:10 +0100,
> Ludovic Courtès wrote:
>> 
>> Tomáš Čech <address@hidden> skribis:
>> 
>> > * gnu/packages/lua.scm (luajit): Add -fPIC into CFLAGS and pass it to make.
>> 
>> [...]
>> 
>> > --- 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 without 
>> > tests
>> >         #:phases (alist-delete 'configure %standard-phases)
>> > -       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs 
>> > "out")))))
>> > +       #:make-flags (list (string-append "CFLAGS=-fPIC " (or (getenv 
>> > "CFLAGS") ""))
>> > +                          (string-append "PREFIX=" (assoc-ref %outputs 
>> > "out")))))
>> 
>> 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=_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’s the exact error you were getting when
building EFL?

>> Normally I would expect the makefiles to already contain that flag if
>> it’s 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’s a pattern of being unable to build a shared library.
:-)

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]