dev-dotnet/pnetlib-0.6.6 aborts emerging on my AMD64 system with gcc-3.4 with the error message 'stdin:6418: syntax error, unexpected $undefined, expecting "identifier" or "single-quoted string"' every time I try to emerge it. I also tried to remove all pnet* packages, but I still get the same error. Reproducible: Always Steps to Reproduce: 1. emerge =pnetlib-0.6.6 2. Watch the error Actual Results: /usr/bin/cscc -fplugin-cs-path=/usr/lib/cscc/plugins/cscc-cs -o ./mscorlib.dll -g -funsafe -nostdlib -O2 -DINSTALL_AS_DEFAULT -DNON_ECMA -DCONFIG_FRAMEWORK_1_2 -DCONFIG_REFLECTION -DCONFIG_RUNTIME_INFRA -DCONFIG_EXTENDED_NUMERICS -DCONFIG_DEBUG_LINES -DCONFIG_REMOTING -DCONFIG_SERIALIZATION -DCONFIG_REFLECTION_EMIT -DCONFIG_COM_INTEROP -DCONFIG_CODEDOM -DCONFIG_CRYPTO -DCONFIG_X509_CERTIFICATES -DCONFIG_PERMISSIONS -DCONFIG_POLICY_OBJECTS -DCONFIG_EXTENDED_DIAGNOSTICS -DCONFIG_WIN32_SPECIFICS -DCONFIG_ISOLATED_STORAGE -DCONFIG_COMPONENT_MODEL -DCONFIG_COMPONENT_MODEL_DESIGN -DCONFIG_EXTENDED_CONSOLE -DCONFIG_SSL -DCONFIG_SERIAL_PORTS -DDEBUG -DTRACE -fassembly-version=1.2.3400.0 -fassembly-key=neutral -Wno-empty-input -flatin1-charset -fresources=./../resources/en_US/runtime/runtime.resources ./Microsoft/Win32/IRegistryKeyProvider.cs ./Microsoft/Win32/FileKeyProvider.cs ./Microsoft/Win32/Registry.cs ./Microsoft/Win32/MemoryKeyProvider.cs ./Microsoft/Win32/RegistryKey.cs ... a few hundred cs files ... ./System/IO/IsolatedStorage/IsolatedStorageFileStream.cs stdin:6418: syntax error, unexpected $undefined, expecting "identifier" or "single-quoted string" : exited with signal 11 *** Target `all' for project `pnetlib runtime' failed *** *** Project `pnetlib runtime' build failed *** make[1]: *** [mscorlib.dll] Fehler 1 make[1]: Leaving directory `/var/tmp/portage/pnetlib-0.6.6/work/pnetlib-0.6.6/runtime' make: *** [all-recursive] Fehler 1 Expected Results: I actually excepected it to emerge cleanly Portage 2.0.50-r7 (default-amd64-2004.0, gcc-3.4.0, glibc-2.3.4.20040605-r0, 2.6.7-rc2-mm2) ================================================================= System uname: 2.6.7-rc2-mm2 x86_64 4 Gentoo Base System version 1.4.15 ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CFLAGS="-O3 -pipe" CHOST="x86_64-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.inode.at/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="X X509 Xaw3d aac aalib accounting acl acpi ada alsa amd64 apache2 ardour-ksi async athena audiofile avantgo avi berkdb bidi bluetooth bonobo cap caps cddb cdf cdr cgi cjk clisp cmucl crypt cscope cups curl dga dillo directfb divx4linux dnd dnsdb doc dv dvd dvdr emacs emacs-w3 encode erandom escreen ethereal evo expat f77 faad fam fastcgi fax fbcon fbdev ffmpeg fftw flac foomaticdb fs fusion gcl gd gdbm geoip gif gimpprint ginac glade glgd gmp gmtfull gmthigh gmtsuppl gmttria gnome gnomedb gpm gps gsl gstreamer gtk gtk2 gtkhtml guile hbci hdf hdf5 idea idl ieee1394 imagemagick imlib ipcs ipv6 irda irmc jack jpeg kde kerberos ladcca lcd lcms leim lesstif libdsk libg libgda libsamplerate libwww linguas_de lirc live lua mad maildir mailwrapper matroska mbox mcal md5sum mikmod mng monkey mono motif mozilla moznocompose moznoirc moznomail mpeg mpeg4 mule multilib nas ncurses nls nntp nptl nviz objc ocaml ofx oggvorbis openal opengl opie oskit-profiling pam pcmcia pcre pda pdflib perl php pic plotutils png pnp ppds pthreads python qhull qt quicktime radeon readline ruby samba scanner sdk sdl serial slang slp snmp sox speedo speex spell sqlite ssl stroke svg t1lib tcltk tetex theora threads tiff transcode transparent-proxy truetype type1 uml unicode usb v4l v4l2 wifi wmf wxwin wxwindows xml xml2 xosd xv xvid yaz zlib zvbi"
This looks like cscc is generating some invalid IL assembly code. Can you add <arg compiler="cscc" value="-fsave-asm"/> to runtime.build and rebuild . gzip -9 up the the resulting .iltmp file and send it to me (or attach it here). Should be a gcc-amd64-3.4 issue (over optimisation , missing volatile qualifier in cscc ?) .. Can you tell me what flags you used to emerge pnet (-O3 ?) . Anyway thanks for the heads up :)
For a start, could you perhaps just try using -O2 instead of -O3 for compiling pnet? Please give us some feedback, we need your help to fix this ;)
Sorry for the delay. > For a start, could you perhaps just try using -O2 instead of -O3 for compiling pnet? Ok, when recompiling pnet and pnetlib, -O2 doesn't work, but -O0 and -O1 work (gcc-3.4.0-r6).
ok, so modifying the ebuild to use replace-flags -O? -O2 for amd64 would be a work around for now, then. But could you please also do the things Gopal requested so that this optimization bug can be fixed within pnet itself? (For the case it's not a gcc-3.4 optimization bug :)
oh sorry, in my above comment I of course meant -O1 and not -O2 ;)
> But could you please also do the things Gopal requested so that this optimization bug can be fixed within pnet itself? I tried changing runtime.build in pnetlib, but cscc still aborted (see the ": exited with signal 11 " part). > (For the case it's not a gcc-3.4 optimization bug :) gcc-3.3 did work. BTW, you did add replace-flags to dev-dotnet/pnet (too) as its cscc which makes problems, did you?
> BTW, you did add replace-flags to dev-dotnet/pnet (too) as its cscc which makes problems, did you? Sorry, I should better read ebuilds...
I only added it to pnet (and not to pnetlib) because the failure of pnetlib is just a consequence of a faulty pnet, but I guess that's what you meant with your last comment ;)
> I tried changing runtime.build in pnetlib, but cscc still aborted (see the ": exited with signal 11 " part). It will dump a .iltmp file (probably named as System/AppDomainSetup.iltmp , it depends on the sorting order your machine uses - just do a "find -name *.iltmp") gzip -9 && Send me the file. Hopefully we'll have a work around for this rather than build pnet with optimisations turned off . Optimisations are good :).
Well, the ebuild doesn't turn it off completly, it just doesn't allow -O2 or -O3 and replaces them with -O1. Other flags like -mcpu -march etc. are unaffected by this anyway.
> It will dump a .iltmp file (probably named as System/AppDomainSetup.iltmp , it depends on the sorting order your machine uses - just do a "find -name *.iltmp") gzip -9 && Send me the file. I had applied the patch you posted (-fsave-asm is included in the cscc invocation) and got that: /usr/lib/cscc/plugins/cscc-cs: exited with signal 11 *** Target `all' for project `pnetlib runtime' failed *** *** Project `pnetlib runtime' build failed *** make: *** [mscorlib.dll] Error 1 schnecke2 runtime # find -name \*.iltmp schnecke2 runtime # # Yes, no *.iltmp files
Hmm.. so it does not give an .iltmp (then the earlier stdin:6418 error makes no sense). I think I'll need to sit down on an AMD64 myself and debug this . Gdb backtraces of cscc compiling pnetlib is very hard because of the sheer number of arguments . you could on the other hand try this if you have an unstripped cscc. gdb /usr/lib/cscc/plugins/cscc-cs (gdb) set args= -o ./mscorlib.dll -g -funsafe -nostdlib -O2 -DINSTALL_AS_DEFAULT -DNON_ECMA -DCONFIG_FRAMEWORK_1_2 -DCONFIG_REFLECTION -DCONFIG_RUNTIME_INFRA -DCONFIG_EXTENDED_NUMERICS -DCONFIG_DEBUG_LINES -DCONFIG_REMOTING -DCONFIG_SERIALIZATION -DCONFIG_REFLECTION_EMIT -DCONFIG_COM_INTEROP -DCONFIG_CODEDOM -DCONFIG_CRYPTO -DCONFIG_X509_CERTIFICATES -DCONFIG_PERMISSIONS -DCONFIG_POLICY_OBJECTS -DCONFIG_EXTENDED_DIAGNOSTICS -DCONFIG_WIN32_SPECIFICS -DCONFIG_ISOLATED_STORAGE -DCONFIG_COMPONENT_MODEL -DCONFIG_COMPONENT_MODEL_DESIGN -DCONFIG_EXTENDED_CONSOLE -DCONFIG_SSL -DCONFIG_SERIAL_PORTS -DDEBUG -DTRACE -fassembly-version=1.2.3400.0 -fassembly-key=neutral -Wno-empty-input -flatin1-charset -fresources=./../resources/en_US/runtime/runtime.resources /recurse:*.cs (gdb) run **segfault** (gdb) bt .... But I suppose I need access to AMD-64 to hunt this bug (and to boot, it's a GCC bug). HP Testdrive has an Opteron but it runs an old Redhat without gcc 3.4
Closing as Resolved/Fixed because the ebuild works around the problem and upstream knows about this.
gcc-3.4.1 was released recently, in case you already updated could you keep us up to date if it still fails with -O2/-O3? Since this is a gcc optimization bug chances are good it'll be resolved with a new release and we can remove the "replace-flags" again. Thanks.
[Sorry for the delay; I was a few hundred kilometers away from my gentoo box on holiday with a debian x86 laptop.] Nope. Still: stdin:6418: syntax error, unexpected $undefined, expecting "identifier" or "single-quoted string" /usr/bin/cscc: exited with signal 11
Just as a follow-up, this problem also persists on other architectures (like ppc64). The pnet ebuild is now using has_version =sys-devel/gcc-3.4* && replace-flags -O? -O1 until this is fixed upstream. Fortunatly, this isn't really a major downside but solves the problem :)
Another follow-up :) Now, we know what is causing this problem and a fix will likely be committed into the pnet cvs repository anytime soon. Thanks again to Gopal who helped me debugging this problem and eventually fixed it ;)