Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22591 - gnucash should filter some CFLAGS
Summary: gnucash should filter some CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-10 22:52 UTC by Nick Fish
Modified: 2003-06-11 18:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Fish 2003-06-10 22:52:08 UTC
> 	I suggest adding:
> 
> filter-flags "-fno-inline -finline-functions"
> 
> to the gnucash-1.8.4 ebuild.  Otherwise, people with these CFLAGS activated 
> will receive:
> 
> gcc -I../../../src/gnc-module -I../../../src/test-core -I../../../src/engine 
> -I../../../src/engine/test-core -I/usr/include/glib-1.2 
> -I/usr/lib/glib/include -march=pentium4 -O3 -pipe -fforce-addr 
> -foptimize-sibling-calls -fno-inline -finline-functions -finline-limit=1000 
> -o .libs/test-commodities test-commodities.o  
> ../../../src/gnc-module/.libs/libgncmodule.so -L/usr/lib 
> ../../../src/test-core/.libs/libgncmod-test.a ../.libs/libgncmod-engine.so 
> ../.libs/libgw-engine.so ../.libs/libgw-kvp.so 
> ../test-core/.libs/libgncmod-test-engine.a 
> /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgncmod-
engine.so 
> /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/gnc-
module/.libs/libgncmodule.so 
> /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/core-
utils/.libs/libcore-utils.so 
> /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgw-
engine.so 
> /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgw-
kvp.so 
> /usr/lib/libgwrap-wct.so /usr/lib/libgwrap-glib.so /usr/lib/libguile.so 
> /usr/lib/libguile-ltdl.so /usr/lib/libqthreads.so -lpthread -lcrypt 
> /usr/lib/libglib.so /usr/lib/libltdl.so -ldl /usr/lib/libpopt.so -lm 
> -Wl,--rpath -Wl,/usr/lib/gnucash
> ../.libs/libgncmod-engine.so: undefined reference to `gen_event_trans'
> ../.libs/libgncmod-engine.so: undefined reference to `check_open'
> ../.libs/libgncmod-engine.so: undefined reference to `mark_account'
> ../.libs/libgncmod-engine.so: undefined reference to `gen_event'
> ../.libs/libgncmod-engine.so: undefined reference to `account_event'
> ../.libs/libgncmod-engine.so: undefined reference to `mark_split'
> ../.libs/libgncmod-engine.so: undefined reference to `mark_trans'
> collect2: ld returned 1 exit status
> make[4]: *** [test-commodities] Error 1
> make[4]: Leaving directory 
> `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/test'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory 
> `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory 
> `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory 
> `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4'
> make: *** [all-recursive-am] Error 2
> 
> !!! ERROR: app-office/gnucash-1.8.4 failed.
> !!! Function src_compile, Line 70, Exitcode 2
> !!! make failed
> 
> which is a bit of a mystery to figure out what is wrong. ^ ^
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2003-06-11 01:24:12 UTC
can you attach the output of "emerge info"?

-march=pentium4 is not exactly very safe flags as /etc/make.conf would tell you. i'm actually more in favour of you not using -march=pentium4.

actually, you know that -O3 implies -finline-functions anyway, and i've been compiling with -march=pentium2 -O3 and it is fine. and also, is it just me or does -fno-inline contradict -finline-functions ?
Comment 2 Nick Fish 2003-06-11 17:27:09 UTC
I'll bump my pentium4 down to pentium3.  Can you point me to some reading about why pentium4 generates invalid instructions?

Yes, you are right about -03 turning on -finline-functions.  I will remove this from my CFLAGS.  heh, and you're right that the inline-functions and no-inline seeming to contradict; but they actually serve different purposes.  "-fno-inline" means "ignore any 'inline' keywords in the code", not "don't inline any instructions."

(with '-fno-inline' CFLAG)
#emerge info
]1;]2;Started emerge on: Jun 11, 2003 20:14:00]1;]2; *** emerge --buildpkg info]1;]2; *** terminating.]1;]2;rxvtPortage 2.0.48-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 3.06GHz
GENTOO_MIRRORS="http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 apm arts avi crypt cups encode gif gpm jpeg gnome libg++ libwww mikmod mmx mpeg ncurses pdflib png qt quicktime sdl spell svga truetype xml2 xmms xv zlib gdbm slang readline java guile X pam ssl python esd imlib oggvorbis gtk motif opengl 3dfx -3dnow acl alsa apache2 -berkdb bonobo cdr dga directfb doc dvd ethereal fbcon flash gd gphoto2 gps gtkhtml imap jikes -kde lirc maildir matrox mozilla moznoirc moznomail moznocompose mysql nls odbc -oss perl ruby samba sse tcltk -tcpd tiff usb xinerama xml"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000"
CXXFLAGS="-march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000 -fno-default-inline"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox buildpkg ccache fixpackages userpriv usersandbox digest"
#ebuild /usr/portage/app-office/gnucash/gnucash-1.8.4.ebuild compile
>>> Unpacking source...
>>> Unpacking gnucash-1.8.4.tar.gz to /var/tmp/portage/gnucash-1.8.4/work
>>> Unpacking gnucash-docs-1.8.1.tar.gz to /var/tmp/portage/gnucash-1.8.4/work
>>> Source unpacked.
 [32;01m*[0m Working directory: /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4...
 [32;01m*[0m Applying libtool-relink.patch...
 [32;01m*[0m Applying libtool-tmp.patch...
 [32;01m*[0m Applying libtool-sed.patch...
 [32;01m*[0m Applying libtool-portage.patch...
creating cache ./config.cache
checking for non-GNU ld... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for gcc... gcc
checking whether the C compiler (gcc -march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000 ) works... yes
checking whether the C compiler (gcc -march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000 ) is a cross-compiler... no
checking whether we are using GNU C... yes
<snip>
make[4]: Entering directory `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/test'
gcc -DHAVE_CONFIG_H -I. -I. -I../../..    -I../../../src/gnc-module -I../../../src/test-core -I../../../src/engine -I../../../src/engine/test-core  -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000    -c test-commodities.c
/bin/sh ../../../libtool --mode=link gcc -I../../../src/gnc-module -I../../../src/test-core -I../../../src/engine -I../../../src/engine/test-core  -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000     -o test-commodities  test-commodities.o ../../../src/gnc-module/libgncmodule.la ../../../src/test-core/libgncmod-test.la ../libgncmod-engine.la ../libgw-engine.la ../libgw-kvp.la ../test-core/libgncmod-test-engine.la -L/usr/lib -lglib -lltdl -lpopt -lm  -lm
mkdir .libs
gcc -I../../../src/gnc-module -I../../../src/test-core -I../../../src/engine -I../../../src/engine/test-core -I/usr/include/glib-1.2 -I/usr/lib/glib/include -march=pentium3 -O3 -pipe -fforce-addr -foptimize-sibling-calls -fno-inline -finline-limit=1000 -o .libs/test-commodities test-commodities.o  ../../../src/gnc-module/.libs/libgncmodule.so -L/usr/lib ../../../src/test-core/.libs/libgncmod-test.a ../.libs/libgncmod-engine.so ../.libs/libgw-engine.so ../.libs/libgw-kvp.so ../test-core/.libs/libgncmod-test-engine.a /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgncmod-engine.so /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/gnc-module/.libs/libgncmodule.so /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/core-utils/.libs/libcore-utils.so /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgw-engine.so /var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/.libs/libgw-kvp.so /usr/lib/libgwrap-wct.so /usr/lib/libgwrap-glib.so /usr/lib/libguile.so /usr/lib/libguile-ltdl.so /usr/lib/libqthreads.so -lpthread -lcrypt /usr/lib/libglib.so /usr/lib/libltdl.so -ldl /usr/lib/libpopt.so -lm -Wl,--rpath -Wl,/usr/lib/gnucash
../.libs/libgncmod-engine.so: undefined reference to `gen_event_trans'
../.libs/libgncmod-engine.so: undefined reference to `check_open'
../.libs/libgncmod-engine.so: undefined reference to `mark_account'
../.libs/libgncmod-engine.so: undefined reference to `gen_event'
../.libs/libgncmod-engine.so: undefined reference to `account_event'
../.libs/libgncmod-engine.so: undefined reference to `mark_split'
../.libs/libgncmod-engine.so: undefined reference to `mark_trans'
collect2: ld returned 1 exit status
make[4]: *** [test-commodities] Error 1
make[4]: Leaving directory `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine/test'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src/engine'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gnucash-1.8.4/work/gnucash-1.8.4'
make: *** [all-recursive-am] Error 2

!!! ERROR: app-office/gnucash-1.8.4 failed.
!!! Function src_compile, Line 70, Exitcode 2
!!! make failed

>>> md5 src_uri ;-) gnucash-1.8.4.tar.gz
>>> md5 src_uri ;-) gnucash-docs-1.8.1.tar.gz

(with -fno-inline function removed from make.conf's CFLAGS, gnucash compiles and runs fine)

The gnucash maintainers actually solved this problem for me.  If I remember correctly, they told me my CFLAGS interfered with their use of GLIB_INLINE (or some other such macro or whatever) within the code.
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2003-06-11 18:15:06 UTC
thanks for pointing that out about the -fno-inline and -finline-functions :)

and also thanks for bringing it up with the gnucash devs. we usually try the solve compile problems locally before we annoy the gnucash devs, thats why i was just trying to take steps to confirm the problem. i can't remember any of the bug numbers off the top of my head, but a quick search on bugzilla of "pentium4" should give you some nasty bugs.

i've added a filter-flags -fno-inline now.