Lazarus 0.9.26-r2 ebuild can't build any project (including the default one) due to a linker error. Reproducible: Always Steps to Reproduce: 1.(Optional for those who upgrade lazarus) Unmerge fpc, lazarus and delete the ,lazarus directory in your home folder. 2.Emerge dev-lang/lazarus-0.9.26-r2 with ACCEPT_KEYWORDS="~amd64" 3.Start lazarus 4.Run(F9) the default(empty Form) project. Actual Results: unit1.o:(.debug_info+0xc2): undefined reference to `DBG2_FORMS_TFORM' project1.lpr(17,1) Error: Error while linking project1.lpr(17,1) Fatal: There were 1 errors compiling module, stopping Expected Results: Run the project. The project is an empty widow. emerge --info Portage 2.1.6.11 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.28-gentoo-r5 x86_64) ================================================================= System uname: Linux-2.6.28-gentoo-r5-x86_64-Mobile_AMD_Sempron-tm-_Processor_3500+-with-glibc2.2.5 Timestamp of tree: Sun, 10 May 2009 01:45:01 +0000 app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7-r1, 2.1.7 dev-lang/python: 2.4.4-r13, 2.5.4-r2 dev-python/pycrypto: 2.0.1-r6 dev-util/cmake: 2.6.2-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.19.1-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=k8 -msse3 -pipe -fomit-frame-pointer -finline-functions" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=k8 -msse3 -pipe -fomit-frame-pointer -finline-functions" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans" GENTOO_MIRRORS="http://gentoo.mirrors.tera-byte.com/ http://distfiles.gentoo.bg/ http://gentoo-euetib.upc.es/mirror/gentoo/ " LANG="C" LDFLAGS="-Wl,-O1" LINGUAS="en_GB" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.ro.gentoo.org/gentoo-portage" USE="3dnow X a52 aac acl acpi alsa amd64 berkdb bluetooth bzip2 cdr cli cracklib crypt cups dri dvd dvdr fortran gdbm gif gpm hal iconv ipv6 isdnlog jpeg jpeg2k mad midi mmx mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pcre perl png ppds pppd python readline reflection rtc session spl sse sse2 ssl sysfs tcpd tiff truetype unicode usb vorbis wmf x264 xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse wacom synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" USERLAND="GNU" VIDEO_CARDS="via fbdev vesa vga openchrome" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Just in case this may be interest someone: 1)Directory for building test projects is set to /home/boshu/lazarustemp/ 2)Right click on the list in the messages window and select "Copy all messages to clipboard". Do that again and lazarus will crash. 3)Before upgrading to lazarus-0.9.2.26-r2 everything was fine: [ebuild U ] sys-devel/binutils-2.19.1-r1 [2.18-r3] USE="nls -multislot -multitarget -test -vanilla" 0 kB [ebuild U ] dev-lang/fpc-2.2.4 [2.2.2] USE="doc source" 81,031 kB [ebuild U ] dev-lang/lazarus-0.9.26-r2 [0.9.26] 0 kB
(In reply to comment #1) > 2)Right click on the list in the messages window and select "Copy all messages > to clipboard". Do that again and lazarus will crash. Thanks, that looks like a big bug and it happens here too; I'll look into this. Unfortunately I cannot reproduce your first problem, at least on x86. Could you please attach your /etc/fpc.cfg, and if possible also your empty project's working directory (including object files)?
Created attachment 191049 [details] Requested fpc.cfg
The crash is a known bug upstream and happens with all clipboard copy operations. A fix was already available, which I've added to a new lazarus 0.9.26-r3 ebuild, and which will be in the tree shortly. Thanks for providing your fpc.cfg, but I don't see anything odd in it. Except for amd64 / x86 differences, your file is identical to mine, where the default project compiles and runs without problems. Were you able to get object files for a minimal (mostly empty) project displaying the bug?
Created attachment 191174 [details] New Project Archived This is a new (empty) project saved in a folder. I've closed Lazarus, opened Lazarus, opened this project, tried to run it(ending with the same bug) then archived the directory.
(In reply to comment #0) > Actual Results: > unit1.o:(.debug_info+0xc2): undefined reference to `DBG2_FORMS_TFORM' > project1.lpr(17,1) Error: Error while linking > project1.lpr(17,1) Fatal: There were 1 errors compiling module, stopping I got same results on amd64. But i discovered that compilation is successfull goes sa if linking option -gl is disabled in Project->Compiler parameters.
(In reply to comment #6) > (In reply to comment #0) > > Actual Results: > > unit1.o:(.debug_info+0xc2): undefined reference to `DBG2_FORMS_TFORM' > > project1.lpr(17,1) Error: Error while linking > > project1.lpr(17,1) Fatal: There were 1 errors compiling module, stopping > > I got same results on amd64. > But i discovered that compilation is successfull goes sa if linking option -gl > is disabled in Project->Compiler parameters. > I confirm that upon disabling "(In reply to comment #6) > (In reply to comment #0) > > Actual Results: > > unit1.o:(.debug_info+0xc2): undefined reference to `DBG2_FORMS_TFORM' > > project1.lpr(17,1) Error: Error while linking > > project1.lpr(17,1) Fatal: There were 1 errors compiling module, stopping > > I got same results on amd64. > But i discovered that compilation is successfull goes sa if linking option -gl > is disabled in Project->Compiler parameters. > I confirm that disabling "Display Line Numbers in Run-time Error Backtraces (-gl)" in the "Linking" tab, gives a different message when running(F9): "project 'project1' successfully built. :)" Still the project doesn't run. The caption of the lazarus window shows the "(debugging...)" text but the window of the project doesn't show. Closing lazarus, entering the directory of the saved project i see the new executable file. Running the file shows the empty form meaning that indeed the project has been successfully build :). Still this is an annoying work-around.
This looks like another example of strip --strip-unneeded causing problems with fpc. vapier: I'll attach forms.o as generated by lazarus. When passed to strip, the debug info is removed, but when other units (even those not yet compiled) are compiled, the result may contain references to that debug info, so it needs to be kept.
Created attachment 191461 [details] forms.o
--strip-unneeded is supposed to remove debug info. if lazarus actually needs it, then .o files shouldnt be stripped at all.
−−strip−unneeded Remove all symbols that are not needed for relocation processing. Normally, this means all debugging symbols can be removed, but it looks like fpc-generated object files are an exception. It would be reasonable to expect --strip-debug to nuke them, but is it really right that --strip-unneeded does so as well? Anyway, I'm not opposed to making the ebuild (for fpc as well as lazarus) exclude *.o from stripping. If you're sure binutils is doing the right thing, then fpc/lazarus simply need it, and I'll update the ebuilds to do so.
i'm pretty sure binutils is (finally) doing the right thing, but i'll double check with upstream
It's been a while and i don't expect this bug to be closed soon. I think it would be better if we would consider readding to the portage tree the last known working on amd64 version. The last one was: [ebuild U ] sys-devel/binutils-2.19.1-r1 [2.18-r3] USE="nls -multislot -multitarget -test -vanilla" 0 kB [ebuild U ] dev-lang/fpc-2.2.4 [2.2.2] USE="doc source" 81,031 kB [ebuild U ] dev-lang/lazarus-0.9.26-r2 [0.9.26] 0 kB The current version is unusable as nowadays you can't program anything without debugging and installing packages. What is your opinion?
vapier, did you get anything from upstream yet? Anyway, I decided to check to see how many packages actually install .o files on my system. $ grep -c '\.o ' /var/db/pkg/*/*/CONTENTS | grep -v :0 /var/db/pkg/dev-lang/fpc-2.2.4-r1/CONTENTS:598 /var/db/pkg/dev-lang/gpc-20070904/CONTENTS:5 /var/db/pkg/dev-lang/lazarus-0.9.26-r3/CONTENTS:490 /var/db/pkg/dev-lang/python-2.6.2-r1/CONTENTS:1 /var/db/pkg/dev-lang/sunstudioexpress-2009.03/CONTENTS:41 /var/db/pkg/sys-devel/gcc-2.95.3-r10/CONTENTS:4 /var/db/pkg/sys-devel/gcc-3.3.6-r1/CONTENTS:5 /var/db/pkg/sys-devel/gcc-3.4.6-r2/CONTENTS:5 /var/db/pkg/sys-devel/gcc-4.0.4/CONTENTS:5 /var/db/pkg/sys-devel/gcc-4.1.2/CONTENTS:6 /var/db/pkg/sys-devel/gcc-4.2.4-r1/CONTENTS:6 /var/db/pkg/sys-devel/gcc-4.3.3-r2/CONTENTS:20 /var/db/pkg/sys-devel/gcc-4.4.0/CONTENTS:18 /var/db/pkg/sys-devel/nwcc-0.7.6/CONTENTS:3 /var/db/pkg/sys-libs/glibc-2.10.1/CONTENTS:12 Are there other packages that install so many .o files? The stripping of .o files doesn't seem to affect anything nearly as greatly as fpc/lazarus, and it's caused many problems... I'm not saying it should be turned off, but if it could be made any safer, please.
RESTRICT=strip re-added for now.
can this be closed?