bugFreeciv - Bugs: bug #20095, Compilation fails during tolua-5.1

 
 
Show feedback again

bug #20095: Compilation fails during tolua-5.1

Submitted by:  David Lowe <doctorjlowe>
Submitted on:  Fri 24 Aug 2012 10:42:13 PM UTC  
 
Category: bootstrapSeverity: 5 - Blocker
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: 2.4.0-beta1Operating System: Mac OS
Planned Release: 2.4.0, 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 04 Oct 2012 01:55:49 PM UTC, SVN revision 21873:

Fixed compilation broken by having "-lm" as filename as dependency to
lua using components. Retired LUA_AS_DEPENDENCY completely by using
xxx_LIBADD and xxx_LDADD instead of xxx_DEPENDENCIES and xxx_LDFLAGS.

Reported by David Lowe

Patch by Rafa?\197?\130 Mu?\197?\188y?\197?\130o and myself

See gna bug #20095

(Browse SVN revision 21873)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 04 Oct 2012 01:55:43 PM UTC, SVN revision 21872:

Fixed compilation broken by having "-lm" as filename as dependency to
lua using components. Retired LUA_AS_DEPENDENCY completely by using
xxx_LIBADD and xxx_LDADD instead of xxx_DEPENDENCIES and xxx_LDFLAGS.

Reported by David Lowe

Patch by Rafa?\197?\130 Mu?\197?\188y?\197?\130o and myself

See gna bug #20095

(Browse SVN revision 21872)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 05 Sep 2012 11:42:28 PM UTC, comment #21:

- As LUA_AS_DEPENDENCY gets obsolete, remove it completely.

Even if TOLUA_AS_DEPENDENCY is not causing actual problems at the moment, it should probably get similar treatment in another ticket.

(file #16480, file #16481)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 29 Aug 2012 01:48:13 PM UTC, comment #20:

New bug raised as bug #20109

Daniel Markstedt <dmarks>
Project Administrator
Wed 29 Aug 2012 01:42:54 PM UTC, comment #19:

Thanks Rafał, this last patch works well with S2_4.

Daniel Markstedt <dmarks>
Project Administrator
Wed 29 Aug 2012 02:29:50 AM UTC, comment #18:

On an interesting note, each of these patches seems to make those three lua *_AS_DEPENDENCY vars redundant for their respective trees.

I wonder though: is there any reason (other than not compiling the file twice) for not simply listing client/helpdata.c among freeciv_manual_SOURCES ?

Rafał Mużyło <galtgendo>
Tue 28 Aug 2012 11:27:23 PM UTC, comment #17:

> Although I can't imagine too-old-readline is the issue


Without checking the code, is it properly inside #ifdef HAVE_READLINE (or similar)? While too old readline doesn't sound realistic reason, compiling without readline support could be.

But yes, this belongs to new ticket.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 28 Aug 2012 11:21:31 PM UTC, comment #16:

> stdinhand.c:6877: error: ‘rl_completion_suppress_append’ undeclared (first use in this function)

Huh. Can you raise a new ticket for this?
(In it, can you say what version of readline you have? Although I can't imagine too-old-readline is the issue; this feature was added in readline 4.3, released in 2002.)

Jacob Nevins <jtn>
Project Administrator
Tue 28 Aug 2012 07:47:10 PM UTC, comment #15:

The last part of my last comment was a bit silly.

I should have said "the new problem is due to the change from patch #3436 and regards readline".

Rafał Mużyło <galtgendo>
Tue 28 Aug 2012 01:59:20 PM UTC, comment #14:

Well, on S2_4 the patch looks differently, mainly due to tree moves and freciv-web.

This one is same revision, for S2_4.

Your new error regards readline.

(file #16448)

Rafał Mużyło <galtgendo>
Tue 28 Aug 2012 01:15:15 PM UTC, comment #13:

Both Marko's and Rafał's patches avoid the error (trunk).

Only Marko's patch apply cleanly to S2_4, and I confirmed that it avoids the error, and that it is possible to launch the server/client and play a turn.

On trunk, however, compilation fails further down so I couldn't do any playtesting. This is probably unrelated, however. The error in this case is:

CC stdinhand.lo
stdinhand.c: In function ‘is_enum_option_value’:
stdinhand.c:6877: error: ‘rl_completion_suppress_append’ undeclared (first use in this function)
stdinhand.c:6877: error: (Each undeclared identifier is reported only once
stdinhand.c:6877: error: for each function it appears in.)
make[3]: *** [stdinhand.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Daniel Markstedt <dmarks>
Project Administrator
Mon 27 Aug 2012 10:32:45 PM UTC, comment #12:

OK, it's better to write the patch on your own.

This is against trunk r21843.

freeciv-server, freeciv-manual, freeciv-modpack and gtk2/gtk3 clients seems to build correctly with it.

Please test.

(file #16445)

Rafał Mużyło <galtgendo>
Mon 27 Aug 2012 04:02:44 PM UTC, comment #11:

...also passing '-lm' to libtolua_la_LIBADD (if it's actually needed there and not for liblua itself) should make it easier to propagate it down the tree.

Rafał Mużyło <galtgendo>
Mon 27 Aug 2012 03:59:03 PM UTC, comment #10:

What about what I've wrote in comment #7 ?
After all, the reason dependencies were not computed correctly before was exactly that those libs were passed via _LDFLAGS instead of _LDADD.

Rafał Mużyło <galtgendo>
Mon 27 Aug 2012 03:36:24 PM UTC, comment #9:

Fix to not to pollute LUA_AS_DEPENDENCY with "-lm". Note that all places that link against liblua are affected - tolua just happens to be first one.

_LDFLAGS -> _LDADD change was just a test, and I don't think it's even right thing to do (we are not building library of which libm is part).

Original duplicate -lm removal patch is probably wrong too - if libtolua requires libm itself and not just because of liblua, one should not rely on liblua flags to provide it.

(file #16443)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 27 Aug 2012 02:59:23 PM UTC, comment #8:

> Also, both LUA_AS_DEPENDENCY and LUA_LIBS carry '-lm'.


Oh, that explains it. LUA_AS_DEPENDENCY expects filenames, not linker options. This actually makes one to wonder why it's not erroring in other environments.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 27 Aug 2012 02:57:34 PM UTC, comment #7:

Looking at tolua-5.1/src/bin/Makefile.am again, unless I'm missing something, after changing _LDFLAGS to _LDADD it would seem tolua_DEPENDENCIES are redundant - see if removing it helps.

Rafał Mużyło <galtgendo>
Mon 27 Aug 2012 02:36:31 PM UTC, comment #6:

Perhaps a silly question, but does OS X have a separate libm ?
(IIRC, that's a valid question for i.e. OpenBSD (or was that just about were some of math functions are ?))

Also, both LUA_AS_DEPENDENCY and LUA_LIBS carry '-lm'.

As for the other part, changing _LDFLAGS to _LDADD is actually a more generic bug fix (though perhaps some of those should be moved to libtolua_la_LIBAD in tolua-5.1/src/lib)

(also, it seems that 'massive' log from comment #4 got truncated)

Rafał Mużyło <galtgendo>
Mon 27 Aug 2012 01:50:49 PM UTC, comment #5:

Too massive for Gna, so now here cropped in half.

(file #16440)

Daniel Markstedt <dmarks>
Project Administrator
Mon 27 Aug 2012 01:41:55 PM UTC, comment #4:

Strangely enough, still bailing out with the same message. (And yes, I ran make clean and autogen.sh inbetween...)

Here are a couple of massive logs, if this helps you at all.

(file #16439)

Daniel Markstedt <dmarks>
Project Administrator
Mon 27 Aug 2012 08:01:29 AM UTC, comment #3:

How about also moving them to _LDADD from _LDFLAGS?

(file #16436, file #16437)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 27 Aug 2012 02:31:07 AM UTC, comment #2:

I'm having the same problem as David, OS X 10.6.

The patch didn't help in my case, S2_4 and trunk.

Daniel Markstedt <dmarks>
Project Administrator
Sun 26 Aug 2012 10:44:51 PM UTC, comment #1:

Does dropping of duplicate -lm help as in attached patch?

(file #16431, file #16432)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 24 Aug 2012 10:42:13 PM UTC, original submission:

...
Making all in tolua-5.1
Making all in src
Making all in lib
CC tolua_event.lo
/bin/sh ../../../../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/tolua-5.1/include -I../../../../dependencies/lua-5.1/src -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c -o tolua_event.lo tolua_event.c
CC tolua_is.lo
/bin/sh ../../../../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/tolua-5.1/include -I../../../../dependencies/lua-5.1/src -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c -o tolua_is.lo tolua_is.c
CC tolua_map.lo
/bin/sh ../../../../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/tolua-5.1/include -I../../../../dependencies/lua-5.1/src -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c -o tolua_map.lo tolua_map.c
CC tolua_push.lo
/bin/sh ../../../../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/tolua-5.1/include -I../../../../dependencies/lua-5.1/src -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c -o tolua_push.lo tolua_push.c
CC tolua_to.lo
/bin/sh ../../../../libtool --preserve-dup-deps --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/tolua-5.1/include -I../../../../dependencies/lua-5.1/src -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c -o tolua_to.lo tolua_to.c
CCLD libtolua.la
Making all in bin
CC tolua.o
gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/lua-5.1/src -I../../../../dependencies/tolua-5.1/include -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c tolua.c
CC toluabind.o
gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../dependencies/lua-5.1/src -I../../../../dependencies/tolua-5.1/include -I/sw/include -DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\"" -DFC_CONF_PATH="\"/sw/etc/freeciv\"" -DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.4:/sw/share/freeciv\"" -DDEFAULT_SAVES_PATH="\"\"" -DDEFAULT_SCENARIO_PATH="\".:data/scenarios:~/.freeciv/2.4/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenarios\"" -Wall -Wpointer-arith -Wcast-align -g -O2 -I/sw/include -pthread -fsigned-char -c toluabind.c
make[5]: *** No rule to make target `-lm', needed by `tolua'. Stop.
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

------------------------------------------------------------

Details: OSX 10.7.4, XCode 4.4.1

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Just for good measure, i turned off parallel builds but it made no difference. Apparently the deal breaker is the "No rule to make target `-lm', needed by `tolua'."

David Lowe <doctorjlowe>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16480:  LuaDeps-2.patch added by cazfi (5kB - text/x-diff)
file #16481:  LuaDeps-S2_4-2.patch added by cazfi (4kB - text/x-diff)
file #16448:  lua-deps-2.4.patch added by galtgendo (4kB - text/x-patch - same patch, for S2_4)
file #16445:  lua-deps.patch added by galtgendo (5kB - text/x-patch - patch to the build system - lua)
file #16443:  LuaAsDepFix.patch added by cazfi (556B - text/x-diff)
file #16440:  daniel-make.txt added by dmarks (456kB - text/plain)
file #16439:  daniel-configure.txt added by dmarks (22kB - text/plain)
file #16436:  ToluaLDADD.patch added by cazfi (927B - text/x-diff)
file #16437:  ToluaLDADD-S2_4.patch added by cazfi (474B - text/x-diff)
file #16431:  DuplMRmTolua.patch added by cazfi (822B - text/x-diff)
file #16432:  DuplMRmTolua-S2_4.patch added by cazfi (411B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by galtgendo (Updated the item)
  • -unavailable- added by dmarks (Posted a comment)
  • -unavailable- added by cazfi (Updated the item)
  • -unavailable- added by doctorjlowe (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 04 Oct 2012 01:56:07 PM UTCcazfiStatusReady For Test=>Fixed
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Wed 05 Sep 2012 11:42:28 PM UTCcazfiAttached File-=>Added LuaDeps-2.patch, #16480
      Attached File-=>Added LuaDeps-S2_4-2.patch, #16481
      StatusIn Progress=>Ready For Test
    Tue 28 Aug 2012 01:59:20 PM UTCgaltgendoAttached File-=>Added lua-deps-2.4.patch, #16448
    Mon 27 Aug 2012 10:32:45 PM UTCgaltgendoAttached File-=>Added lua-deps.patch, #16445
    Mon 27 Aug 2012 03:36:24 PM UTCcazfiAttached File-=>Added LuaAsDepFix.patch, #16443
    Mon 27 Aug 2012 02:59:23 PM UTCcazfiStatusReady For Test=>In Progress
    Mon 27 Aug 2012 01:50:49 PM UTCdmarksAttached File-=>Added daniel-make.txt, #16440
    Mon 27 Aug 2012 01:41:55 PM UTCdmarksAttached File-=>Added daniel-configure.txt, #16439
    Mon 27 Aug 2012 08:01:29 AM UTCcazfiAttached File-=>Added ToluaLDADD.patch, #16436
      Attached File-=>Added ToluaLDADD-S2_4.patch, #16437
    Sun 26 Aug 2012 10:44:51 PM UTCcazfiAttached File-=>Added DuplMRmTolua.patch, #16431
      Attached File-=>Added DuplMRmTolua-S2_4.patch, #16432
      StatusNone=>Ready For Test
      Planned Release=>2.4.0, 2.5.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup