Re: [CrystalSpace] #965: CS-2.0_beta3: Build system not fit for system wide installation on Linux
"CrystalSpace" <[email protected]> Fri, 13 Jul 2012 17:56:18 -0000
| Newsgroups | gmane.comp.graphics.crystalspace.tracker |
|---|---|
| Message-ID | <[email protected]> |
#965: CS-2.0_beta3: Build system not fit for system wide installation on Linux
--------------------------+-------------------------------------------------
Reporter: yamakuzure | Owner: admin
Type: defect | Status: new
Priority: major | Milestone: Version 2.0 pre1
Component: build system | Version: V2.0
Keywords: |
--------------------------+-------------------------------------------------
Comment(by yamakuzure):
To show why I came up with those patches, including the addition of the
'custom' mode, and the patching away of the emmitting of everything
unchecked into JamConfig, I have decided to retrace my steps:
Note: This is done using the native gentoo build system utilized by its
package manager "portage", because the usability with this was the goal to
achieve.
Step 1: configure:
{{{
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-
linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib
--libdir=/usr/lib64 --without-jackasyn --with-freetype2 --with-wx --with-
GTK --with-CEGUI --with-Cg
--with-CgGL --with-asound --with-x --with-java --with-bullet --with-lcms
--with-png --with-jpeg
--with-mng --without-perl --with-python --with-vorbis --without-speex
--with-3ds --with-ode --with-cal3d
(...snip...)
config.status: executing Makefile commands
./config.status: line 1408: 25322 Segmentation fault ( "$JAM"
-sDUMPTARGETS_FILE=$tmp/jcache dumptargets 1>&2 ) 2>&5
config.status: WARNING: failed to create makefile emulation layer
}}}
Step 2: Manually dump the targets using a high enough debug level:
{{{
# jam -d7 -sDUMPTARGETS_FILE=./dump.dmp dumptargets 1>./dump.log
2>./dump.err
Segmentation fault
# tail -n 2 dump.log
make -- `CFLAGS="-march=native -pipe -ftree-vectorize -ggdb -O2
-fgraphite-identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive
-pipe -march=native -pipe
-ftree-vectorize -ggdb -O2 -fgraphite-identity -floop-interchange -floop-
strip-mine -floop-block
-ftree-loop-distribution -fpermissive -Wall -Wno-unknown-pragmas
-fvisibility=hidden -mtune=generic
-DNVALGRIND -ffunction-sections -fdata-sections -O3 -fomit-frame-pointer
-ffast-math -g2"
/bin/sh ./bin/relaytool --out-dir
./out/linux/optimize/plugins/sndsys/renderer/openal --minimal-list
" ./out/linux/optimize/plugins/sndsys/renderer/openal/source.o
./out/linux/optimize/plugins/sndsys/renderer/openal/renderer.o
./out/linux/optimize/plugins/sndsys/renderer/openal/listener.o
./out/linux/optimize/plugins/sndsys/renderer/openal/plugin_impl.o"
--relay openal -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 -lopenal -lpthread -ldl -lm`
search `CFLAGS="-march=native -pipe -ftree-vectorize -ggdb -O2 -fgraphite-
identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive
-pipe -march=native -pipe
-ftree-vectorize -ggdb -O2 -fgraphite-identity -floop-interchange -floop-
strip-mine -floop-block
-ftree-loop-distribution -fpermissive -Wall -Wno-unknown-pragmas
-fvisibility=hidden -mtune=generic
-DNVALGRIND -ffunction-sections -fdata-sections -O3 -fomit-frame-pointer
-ffast-math -g2" /bin/sh
./bin/relaytool --out-dir
./out/linux/optimize/plugins/sndsys/renderer/openal --minimal-list
" ./out/linux/optimize/plugins/sndsys/renderer/openal/source.o
./out/linux/optimize/plugins/sndsys/renderer/openal/renderer.o
./out/linux/optimize/plugins/sndsys/renderer/openal/listener.o
./out/linux/optimize/plugins/sndsys/renderer/openal/plugin_impl.o"
--relay openal -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 -lopenal
-lpthread -ldl -lm`:
`CFLAGS="-march=native -pipe -ftree-vectorize -ggdb -O2 -fgraphite-
identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive
-pipe -march=native -pipe -ftree-ve
}}}
So jam segfaults when searching flags. Just take a look at those flags,
how many superfluous entries there
are. btw: The log is 5.4GB large.
So where do these flags come from? Jamconfig. Right. Let's check that:
{{{
# wc -l Jamconfig
231 Jamconfig
# grep FLAGS Jamconfig | wc -l
95
# grep FLAGS Jamconfig | sort -u | wc -l
92
}}}
And what does Jamconfig do to the CFLAGS, CXXFLAGS and LDFLAGS?
{{{
# grep "COMPILER.CFLAGS " Jamconfig
COMPILER.CFLAGS += -march=native -pipe -ftree-vectorize -ggdb -O2
-fgraphite-identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive ;
COMPILER.CFLAGS += -pipe ;
COMPILER.CFLAGS += -march=native -pipe -ftree-vectorize -ggdb -O2
-fgraphite-identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive ;
COMPILER.CFLAGS += -Wall ;
COMPILER.CFLAGS += -Wno-unknown-pragmas ;
COMPILER.CFLAGS += -fvisibility=hidden ;
COMPILER.CFLAGS += -mtune=generic ;
COMPILER.CFLAGS += $(EMBED_META.CFLAGS) ;
COMPILER.CFLAGS += -DNVALGRIND ;
COMPILER.CFLAGS += $(COMPILER.CFLAGS.MANDATORY) ;
}}}
So the global CFLAGS get added twice, first duplication riddle solved. The
same goes with the CXXFLAGS:
{{{
# grep "COMPILER.C++FLAGS " Jamconfig
COMPILER.C++FLAGS += -march=native -pipe -ftree-vectorize -ggdb -O2
-fgraphite-identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive ;
COMPILER.C++FLAGS += -march=native -pipe -ftree-vectorize -ggdb -O2
-fgraphite-identity -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fpermissive ;
COMPILER.C++FLAGS += -fno-exceptions ;
COMPILER.C++FLAGS += -fvisibility-inlines-hidden ;
COMPILER.C++FLAGS += -DNVALGRIND ;
COMPILER.C++FLAGS += $(COMPILER.C++FLAGS.MANDATORY) ;
}}}
...and the LDFLAGS:
{{{
# grep "COMPILER.LFLAGS " Jamconfig
COMPILER.LFLAGS += -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-
style=gnu ;
COMPILER.LFLAGS += -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-
style=gnu ;
COMPILER.LFLAGS += -lc ;
COMPILER.LFLAGS += -lm ;
COMPILER.LFLAGS += -ldl ;
COMPILER.LFLAGS += -lnsl ;
COMPILER.LFLAGS += -L/usr/local/lib ;
COMPILER.LFLAGS += $(EMBED_META.LFLAGS) ;
}}}
For the record: If I manually delete the duplications in Jamconfig,
everything is fine.
But there is another one. I want -O2, but it gets overwritten by -O3. And
further, your configure adds flags, that are already enabled. (like
-fomit-frame-pointers) And some other options are sabotaging the
optimization efford, like using -mtune=generic instead of -march=native.
Or better: Leave such options out. Package maintainers compiling for a
bianry distro will want generic options. Users compiling for their own
machine are better off compiling for their machine only.
---
These were the reasons for me to try to a) get rid of duplicate options,
and b) add a 'custom' mode where the user is solely resposible for.
Again: Sorry that I did not state that earlier.
--
Ticket URL: <http://www.crystalspace3d.org/trac/CS/ticket/965#comment:8>
CrystalSpace <http://www.crystalspace3d.org/>
Free open-source 3D SDK.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/