Crystal Space
Welcome, Guest. Please login or register.
July 23, 2014, 06:48:27 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8220 Members
Latest Member: Igymatta
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Project Development
| |-+  Development Discussion
| | |-+  [SOLVED] CS-1.9 live SVN fails to build target xwin.so, InferFlagTuples failure!
« previous next »
Pages: [1] Print
Author Topic: [SOLVED] CS-1.9 live SVN fails to build target xwin.so, InferFlagTuples failure!  (Read 3545 times)
Yamakuzure
Newbie
*
Posts: 8


View Profile Email
« on: January 26, 2011, 12:47:27 pm »

Hi everybody,

I am currently writing ebuilds (Gentoo Linux) for the live version of CrystalSpace (aka 1.9 from SVN), CEL and CrystalCore as the current stable version of CS does not work on my dev laptop. (I have described the problem here in the forums, but no solution could be found.)

Everything is working so far. After patching plugins/cscript/csjava/Jamfile even Java-Support compiles fine.

But when Jam reaches the target "xwin.so", it fails, or better the linker fails, because "-l/usr/local/lib" can not be found. I have found out how it comes to this stage, but I am no Jam-expert and simply can't fix this on my own.

When I build the target with -d9, the log shows the following: (Only a small snippet from a 743M log! I have commented the log output as I understand it. And I had to remove some lines and replace the long argument line with <FLAGS LIKE ABOVE> or the message would be too long for the forums.)
Code:
>>>>|>>>>|>> LFlags xwin  : `CFLAGS="-march=core2 -O2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -O2 -pipe -mtune=core2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -I/usr/local/include -DNVALGRIND -O3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -lc -lm -ldl -lnsl -L/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`  : noexternal
expand 'target'
list > xwin <
>>>>|>>>>|>>>> local target  = xwin
list > xwin <
set target = xwin
expand 'flags'
expand 'InferFlagTuples'
expand '$(2)'
list > `<FLAGS LIKE ABOVE>` <


Now these are normal flags that show up on most targets


>>>>|>>>>|>>>> InferFlagTuples `<FLAGS LIKE ABOVE>`


This function from mk/jam/flags.jam is called on all CFLAGS and LFLAGS. And normally everything is well.

expand 'tuples'
>>>>|>>>>|>>>>|> local tuples  =
set tuples =
expand 'accum'
>>>>|>>>>|>>>>|> local accum  =
set accum =
expand 'flag'
>>>>|>>>>|>>>>|> local flag  =
set flag =
expand '$(1)'
list > `<FLAGS LIKE ABOVE>`
<list > `<FLAGS LIKE ABOVE>`
<set flag = `<FLAGS LIKE ABOVE>`
expand 'Match'
expand 'Match'
expand '^([-/`][A-Za-z0-9])'
expand '$(flag)'
expand 'flag'
get flag = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> Match ^([-/`][A-Za-z0-9])  : `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> if `C (1)
expand '$(accum)'
expand 'accum'
get accum =
expanded to
>>>>|>>>>|>>>>|> if (0)
expand 'accum'
expand '$(flag)'
expand 'flag'
get flag = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> set accum  += `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
set accum = `<FLAGS LIKE ABOVE>`
expand '$(accum)'
expand 'accum'
list > accum <
get accum = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`


The Match works, appearantly, because accum is set to the argument. (It is no tuple)


>>>>|>>>>|>>>>|> if `<FLAGS LIKE ABOVE>` (1)
expand 'tuples'
list > tuples <
expand '$(accum:J= )'
expand 'accum^AJ= '
list > accum^AJ=  <


Now it gets weird. While "get" shows the flags from above, "list" is already lowercase:


get accum = `CFLAGS="-march=core2 -O2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -O2 -pipe -mtune=core2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -I/usr/local/include -DNVALGRIND -O3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -lc -lm -ldl -lnsl -L/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
list > `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0` <
newstr: allocating 1124 bytes
expanded to `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
>>>>|>>>>|>>>>|> set tuples  += `<LOWERCASE FLAGS>`
list > `<LOWERCASE FLAGS>` <
set tuples = `<LOWERCASE FLAGS>`


Now this is the result from the line
tuples += $(accum:J=" ") ;
and I do not understand why everything is lowercase now. But the next log entry after the function returned confirms, that everything is transformed to lowercase:


>>>>|>>>>|>>>> local flags  = `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
This, of course, can not work. All those options are case-sensitive. The options are, the log shows it, built correctly. And then they get transformed to lowercase. Why? And how can this be fixed?

Thanks in advance, and don't hesitate if you want to know anything else. I am using ftjam-2.5.3_rc2 with bison-2.4.2

Yama

P.S.: The mentioned patch:
Code:
--- plugins/cscript/csjava/Jamfile.old  2011-01-25 11:03:51.000000000 +0100
+++ plugins/cscript/csjava/Jamfile      2011-01-25 11:04:12.000000000 +0100
@@ -70,7 +70,7 @@
   Swig $(common) :
     [ DoSourceGrist cspace.i ] :
     java :
-    -c++ -java -package org.crystalspace3d :
+    -c++ -package org.crystalspace3d :
     [ ConcatDirs $(TOP) include ]
     [ ConcatDirs $(BUILDTOP) include ] :
     [ ConcatDirs $(TOP) include bindings ] :
"-java" is already added automatically by the target, and adding a second "-java" to the options makes swig fail. (see Gentoo Bug 335921, Comments 13 and 14 for details.)
« Last Edit: January 27, 2011, 02:56:35 pm by Yamakuzure » Logged
Yamakuzure
Newbie
*
Posts: 8


View Profile Email
« Reply #1 on: January 27, 2011, 02:56:01 pm »

Okay, I fixed it. When I browsed through the Jam documentation, stating that the only datatype Jam knows are lists of strings, it came to my mind that concatenating a list that has only one item might fail.

The patch to fix the issue with modern ftjam:
Code:
--- mk/jam/flags.jam.old        2011-01-27 14:44:02.000000000 +0100
+++ mk/jam/flags.jam    2011-01-27 14:42:53.000000000 +0100
@@ -292,7 +292,11 @@
   }
   if $(accum)
   {
-    tuples += $(accum:J=" ") ;
+    if $(tuples) {
+      tuples += $(accum:J=" ") ;
+    } else {
+      tuples = $(accum) ;
+    }
   }
   return $(tuples) ;
 }
Why the :J operator used on a single value list turns that value into lowercase is riddles to me. But at least the issue is solved now.
Logged
Yamakuzure
Newbie
*
Posts: 8


View Profile Email
« Reply #2 on: January 27, 2011, 04:32:04 pm »

Just a quick note:

The install dependencies for install_staticplugins has a typo: The library target is called install_lib not install_libs.
Code:
--- ./mk/jam/static.jam.old     2011-01-27 14:55:51.000000000 +0100
+++ ./mk/jam/static.jam 2011-01-27 16:28:00.000000000 +0100
@@ -417,7 +417,7 @@
   Depends install_staticplugins : $(STATICPLUGINS.DEPENDENCIES) ;
   Depends install_staticplugins :
     [ DoInstall $(STATICPLUGINS.DEPENDENCIES) : $(libdir) ] ;
-  Depends install_staticplugins : install_libs ;
+  Depends install_staticplugins : install_lib ;
     
   INSTALLEDLIBS_OPTIONAL += $(name) ;
Smiley
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.165 seconds with 17 queries.