Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: GCC 4 CFLAGS
Date: Sun, 24 Sep 2006 23:16:56
Message-Id: ef73h0$btf$1@sea.gmane.org
In Reply to: [gentoo-amd64] GCC 4 CFLAGS by Peter Humphrey
1 Peter Humphrey <prh@××××××××××.uk> posted
2 200609241306.23175.prh@××××××××××.uk, excerpted below, on Sun, 24 Sep
3 2006 13:06:23 +0000:
4
5 > I've started a new thread because the old one had drifted.
6 >
7 > While trying Duncan's CFLAGS I found I couldn't emerge imagemagick because
8 > it didn't recognise -combine or -ftree-pre.
9
10 Strange. imagemagick is working just fine here, with those CFLAGS. As
11 David notes, however, both those CFLAGS are new to gcc 4.1. Don't try to
12 use them with gcc 3.x as they will cause problems. Part of amd64's
13 portage bashrc does try to filter invalid flags, but it's far better not
14 to use them at all, which means not using these with gcc 3.x.
15
16 It's also possible, altho less likely, that the issue is an older
17 imagemagick, as I'm running ~arch here and have the latest updates as of
18 yesterday merged (the reason I know for sure it's working here).
19 Currently merged here:
20
21 imagemagick-6.2.9.5-r1
22
23 > So I removed those from /etc/make.conf and reran emerge imagemagick.
24 > Weirdness. Here are some extracts from the compilation log:
25
26 > [...]
27 > ImageMagick is configured as follows. Please verify that this configuration
28 > matches your expectations.
29 > [...]
30 > Options used to compile and link:
31 > PREFIX = /usr
32 > EXEC-PREFIX = /usr
33 > VERSION = 6.2.9
34 > CC = x86_64-pc-linux-gnu-gcc
35 > CFLAGS
36 > = -march=k8 -Os -pipe -frename-registers -fweb -freorder-blocks -freorder-blocks-and-partition -fu
37 > nit-at-a-time -fgcse-sm -fgcse-las -fgcse-after-reload -fmerge-all-constants -Wall -pthread
38 > CPPFLAGS = -I/usr/include
39 > PCFLAGS =
40 > DEFS = -DHAVE_CONFIG_H
41 > LDFLAGS = -L/usr/lib64 -L/usr/lib64 -lfreetype -lz -L/usr/lib
42 > LIBS
43 > = -lMagick -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lp
44 > thread -lm -lpthread
45 > CXX = x86_64-pc-linux-gnu-g++
46 > CXXFLAGS
47 > = -march=k8 -Os -pipe -frename-registers -fweb -freorder-blocks -funit-at-a-time -fgcse-sm -fgcse-
48 > las -fgcse-after-reload -fmerge-all-constants -pthread
49 > [...]
50 > /bin/install -c 'wand/Wand-config' '/var/tmp/portage/imagemagick-6.2.9.5-r1/image//usr/bin/Wand-config'
51 > cd PerlMagick && /usr/bin/perl Makefile.PL
52 > Checking if your kit is complete...
53 > Looks good
54 > Writing Makefile for Image::Magick
55 > ( cd PerlMagick && make CC='x86_64-pc-linux-gnu-gcc' && \
56 > make CC='x86_64-pc-linux-gnu-gcc' install && \
57 > make clean && rm -f Makefile.old )
58 > make[2]: Entering directory
59 > `/var/tmp/portage/imagemagick-6.2.9.5-r1/work/ImageMagick-6.2.9/PerlMagick'
60 > cp Magick.pm blib/lib/Image/Magick.pm
61 > AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick)
62 > /usr/bin/perl5.8.8 /usr/lib64/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib64/perl5/5.8.8/ExtUtils/typemap
63 > Mag
64 > ick.xs > Magick.xsc && mv Magick.xsc Magick.c
65 > x86_64-pc-linux-gnu-gcc -c -I../ -I.. -I/usr/include/freetype2 -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURC
66 > E -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSE
67 > T_BITS=64 -march=k8 -Os -pipe -frename-registers -fweb -freorder-blocks -freorder-blocks-and-partition -funit-at
68 > -a-time -fgcse-sm -fgcse-las -fgcse-after-reload -fmerge-all-constants -Wall -pthread -march=k8 -O2 -pipe -frena
69 > me-registers -fweb -freorder-blocks -freorder-blocks-and-partition -combine -funit-at-a-time -ftree-pre -fgcse-s
70 > m -fgcse-las -fgcse-after-reload -fmerge-all-constants -DVERSION=\"6.2.9\" -DXS_VERSION=\"6.2.9\" -fPIC "-I/us
71 > r/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" -DHAVE_CONFIG_H
72 > Magick.c
73 > x86_64-pc-linux-gnu-gcc: unrecognized option `-combine'
74 > cc1: error: unrecognized command line option "-ftree-pre"
75 > make[2]: *** [Magick.o] Error 1
76 > make[2]: Leaving directory
77 > `/var/tmp/portage/imagemagick-6.2.9.5-r1/work/ImageMagick-6.2.9/PerlMagick'
78 > make[1]: *** [install-exec-perl] Error 2
79 > make[1]: Leaving directory
80 > `/var/tmp/portage/imagemagick-6.2.9.5-r1/work/ImageMagick-6.2.9'
81 > make: *** [install-am] Error 2
82 >
83 > !!! ERROR: media-gfx/imagemagick-6.2.9.5-r1 failed.
84 > Call stack:
85 > ebuild.sh, line 1546: Called dyn_install
86 > ebuild.sh, line 1020: Called src_install
87 > imagemagick-6.2.9.5-r1.ebuild, line 90: Called die
88 >
89 > So I removed -rf /var/tmp/portage/imagemagick-6.2.9.5-r1 and got exactly
90 > the same result!
91 >
92 > Can anyone see what I'm doing wrong? Perhaps another C flag is pulling those
93 > two in.
94
95 Again, that's likely because you are using gcc 3.x, or it shouldn't be a
96 problem. However, that doesn't explain why those flags are still being
97 pulled in.
98
99 I'm not sure on that, but I *DO* know there has been some serious
100 re-working going on due to perlmagick -- the reason for the latest
101 updates. The imagemagick build has been severely quirked from upstream,
102 doing some really strange stuff that cause parts of it (including
103 perlmagick) it to try to build against the OLD libraries still on the
104 system from the old version, instead of the NEW libraries just built as
105 part of the new version. The Gentoo bugs mentioned in the changelog tell
106 the whole story, which I won't repeat here, but I STRONGLY suspect this
107 weirdness you are seeing is related to the extreme quirkiness, with the
108 build trying to trick itself into doing things in a way that works for
109 upstream, rather than fixing the problem (a simple library search order
110 inversion) properly.
111
112 Apparently, upstream has taken some of the Gentoo patches and further
113 versions won't be so quirked out and complex. Meanwhile however, Gentoo
114 is left with a hodgepodge of patched versions, some stable some ~arch,
115 some all quirked out, some partially patched, some (hopefully) fully
116 patched... it's a rather bad situation all around.
117
118 gcc 4.1.1 is now stable. I'd suggest you merge it if you haven't.
119 However, Gentoo does NOT switch to it on its own when you upgrade. You
120 then need to run gcc-config (or eselect compiler if you have it merged) to
121 properly switch to it (as Dave mentions). After you do that, the new
122 CFLAGS (if you choose to use them) should work far better, tho as mentioned
123 -combine has problems with a very few packages.
124
125 As I said, imagemagick in particular works just fine, here, with those
126 CFLAGS (and gcc-4.1.1 of course), tho due to the perlmagick mess, you /may/
127 have to remerge it a couple times in a row and/or merge the latest ~arch
128 version, in ordered to avoid the quirked out weirdness of some of the
129 older imagemagick versions. Again, read the bugs mentioned in the portage
130 tree imagemagick changelog and you'll very quickly understand how complex
131 the problem is, and why I keep calling it quirked out! =8^( There was
132 some /very/ strange stuff going on! Luckily, it seems to be getting
133 straightened out now.
134
135 --
136 Duncan - List replies preferred. No HTML msgs.
137 "Every nonfree program has a lord, a master --
138 and if you use the program, he is your master." Richard Stallman
139
140 --
141 gentoo-amd64@g.o mailing list