View previous topic :: View next topic |
Author |
Message |
brkdncr Tux's lil' helper
Joined: 02 Aug 2003 Posts: 92
|
Posted: Tue Dec 02, 2003 5:52 am Post subject: |
|
|
I ran that find command again, it found some stuff this time. Remerged without the -fstack-protector, updated gcc, remerged with -fstack-protector, remerged offending programs.
works great! |
|
Back to top |
|
|
Niek Apprentice
Joined: 14 May 2002 Posts: 236 Location: Houten, The Netherlands
|
Posted: Tue Dec 02, 2003 10:36 am Post subject: |
|
|
On my system, the __guard check didn't do anything (I waited for about 1 hour). A "ps auwx" covered the problem: readelf was not responding while checking the file "/usr/X11R6/bin/a.out".
Code: | root 24990 62.5 0.1 1720 692 pts/1 S 11:30 1:31 readelf -s /usr/X11R6/bin/a.out |
After doing: Code: | $ pidof readelf | xargs kill | the __guard check resumed. _________________ Bezoek ook eens de Nederlandstalige Gentoo IRC channel op irc.freenode.net - #gentoo-nl |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Tue Dec 02, 2003 11:45 am Post subject: |
|
|
Ok, i have recompiled gcc with fstack-protector and tried to recompile necessary apps, trouble so are still coming up on find command.
qt
kde
aspell
KDE has long list of stuff, kde-base, kde-games etc. when viewing kde emerge it downloads but does not recompile:
root@hamlet michael # emerge kde
Calculating dependencies ...done!
>>> emerge (1 of 1) kde-base/kde-3.1.4 to /
>>> Unpacking source...
>>> Source unpacked.
>>> Install kde-3.1.4 into /var/tmp/portage/kde-3.1.4/image/ category kde-baseman:
prepallstrip:
strip:
>>> Completed installing into /var/tmp/portage/kde-3.1.4/image/
>>> Merging kde-base/kde-3.1.4 to /
>>> Regenerating /etc/ld.so.cache...
* Caching service dependencies... [ ok ]>>> kde-base/kde-3.1.4 merged.
>>> clean: No packages selected for removal.
>>> Regenerating /etc/ld.so.cache...
* Caching service dependencies... [ ok ]>>> Auto-cleaning packages ...
>>> No outdated packages were found on your system.
* GNU info directory index is up-to-date.
How can i force this packages to recompile with new USE flags and so allow gcc update?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
darksaidin Apprentice
Joined: 04 Oct 2003 Posts: 150
|
Posted: Sat Dec 06, 2003 1:52 pm Post subject: |
|
|
I don't receive any output from the find... command. It runs for a few minutes and then returns to the prompt.
edit: I checked the ebuild file. First it checks if glibc is "infected" - which it is in my case. If it is, it also does this check:
Code: | SCANPATH="$(for i in $(cat /etc/ld.so.conf | grep -v '/usr/lib/gcc-lib' | grep -v '^\#'); do echo -n $i; echo -n ' '; done) $(echo ${PATH} | sed 's,:, ,g')"
if [ "$(find ${SCANPATH} -type f -perm -1 -maxdepth 9 -exec readelf -s {} \; 2>&1 | grep "__guard\@GCC" 2>&1 1>/dev/null; echo $?)" == "0" ]
then
eerror "found binaries that are dynamically linked to the libgcc with __guard@@GCC"
[...] |
It scans the files in scanpath for __guard flags and if there are none found (== "0") it gives the message that it found some ? This isn't right, is it ?
(Just a guess -- I'm quite new to linux and don't even know what kind of language this is but judging from my c knowledge I'd say this is not working as intended. Or is it ?) |
|
Back to top |
|
|
ghardey n00b
Joined: 11 Jun 2003 Posts: 15
|
Posted: Sat Dec 13, 2003 10:30 pm Post subject: emerge gcc still getting error after glibc re-emerged |
|
|
I'm currently on gcc 3.2.3-r2 trying to emerge to gcc 3.2.3-r3. I received the message that glibc contains the guard and stack_smash functions. I've removed the stack_smash from make.conf and even put in -fno-stack-protector to explicitly inidicate no stack protector. I've also wiped the ccache directory. Then I recomiled glibc 2.3.2-r3 successfully. When I attempted to emerge to gcc 3.2.3-r3 I got the same message.
I'm hoping it's something obvious that you more experienced people can point out to me. Am I at least headed in the right direction? I even tried re-emerging my current version of gcc without stack-protector as was suggested in a previous post, but that emerge failed.
emerge error message and emerge info below:
Code: | * Applying protector.dif... [ ok ]
* Applying gcc-323-propolice-version.patch... [ ok ]
* this sys-libs/glibc has __guard object and __stack_smash_handler functions
* scanning the system for binaries with __guard - this may take 5-10 minutes
* please do not press crtl-C or crtl-Z during this period - it will continue
* found binaries that are dynamically linked to the libgcc with __guard@@GCC
* you need to compile these binaries without CFLAGS -fstack-protector/hcc -r
* also you have to make sure that using ccache needs the cache to be flushed
* wipe out /var/tmp/ccache or /root/.ccache, this will remove possible saved
* -fstack-protector arguments that still may reside in such a compiler cache
* when such binaries are found, gcc cannot remove libgcc propolice functions
* leading to gcc -static -fstack-protector breaking, see gentoo bug id 25299
* you can run 'qpkg -f' from the gentoolkit package and reemerge the program
* to do a full scan on your system, enter this following command in a shell: |
Code: | bash-2.05b# emerge info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.20-gentoo-r5)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.4.3.8p1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon -O3 -pipe -fomit-frame-pointer -fno-stack-protector"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /opt/tomcat/conf /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=athlon -O3 -pipe -fomit-frame-pointer -fno-stack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/share2/portage/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="oss apm foomaticdb libg++ mad mikmod nls gdbm berkdb slang nas guile sdl gpm tcpd esd imlib gtk motif aavm 3dfx 3dnow alsa apache2 arts avi crypt cups doc encode gif gtk2 -gnome imap innodb java jpeg junit -kde -ldap libwww mbox mozilla mpeg mysql ncurses odbc oggvorbis opengl pam pda pdflib perl png python qt quicktime readline ruby samba slp spell ssl svga tcltk tiff truetype usb voodoo3 wmf X xface xml xml2 xmms xv zlib x86 cdr -gphoto2 scanner"
|
Any help appreciated,
ghardey |
|
Back to top |
|
|
ozonator Guru
Joined: 11 Jun 2003 Posts: 591 Location: Ontario, Canada
|
Posted: Sat Dec 13, 2003 10:55 pm Post subject: Re: emerge gcc still getting error after glibc re-emerged |
|
|
ghardey wrote: | I'm currently on gcc 3.2.3-r2 trying to emerge to gcc 3.2.3-r3. I received the message that glibc contains the guard and stack_smash functions. I've removed the stack_smash from make.conf and even put in -fno-stack-protector to explicitly inidicate no stack protector. I've also wiped the ccache directory. Then I recomiled glibc 2.3.2-r3 successfully. When I attempted to emerge to gcc 3.2.3-r3 I got the same message. |
Was your current version of gcc (3.2.3-r2) emerged with -fstack-protector? If so, I think you have to re-emerge your current version of gcc without -fstack-protector before you can emerge the new gcc. This worked for me, after puzzling for a little while about what the block was. I think you may have to re-emerge glibc again with the fresh version of the old (-r2) gcc, too; it's been a couple of weeks since I did it, and don't remember for sure whether I did that, but in any case, it won't hurt.
So, to be clear, what I'm suggesting is: re-emerge gcc-3.2.3-r2 and then glibc (in both cases, your existing versions) without -fstack-protector, then try emerging the new gcc (3.2.3-r3). After all that's done, you can put -fstack-protector back in your $CFLAGS, and re-emerge anything you want to be protected by it.
If that doesn't work, did running the lengthy find command suggested by the gcc-3.2.3-r3 ebuild produce any output? That might offer some clues. |
|
Back to top |
|
|
ghardey n00b
Joined: 11 Jun 2003 Posts: 15
|
Posted: Sun Dec 14, 2003 6:48 pm Post subject: trying to emerge current gcc without stack-protector fails |
|
|
As recommended in previous a post I have tried to emerge gcc-3.2.3-r2 without stack-protector flag with the intent of recompiling glibc afterward. The gcc emerge doesn't complete. I've included the last portion of the log which includes the error. I don't possess the technical sophistication to understand what is causing the error so I'm not able to more forward. My emerge info was posted a couple posts back.
Is there a way to replace my gcc-3.2.3-r2 which was compiled with the stack-protector flag with a precompiled binary version? Or if I'm going to go to gcc-3.2.3-r3 anyway should I look for that in a binary package?
Code: | /bin/sh /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/move-if-change tmp-genrtl.h genrtl.h
./gengenrtl > tmp-genrtl.c
/bin/sh /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/move-if-change tmp-genrtl.c genrtl.c
echo timestamp > s-genrtl
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/genflags.c -o genflags.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/rtl.c -o rtl.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/read-rtl.c -o read-rtl.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/bitmap.c -o bitmap.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/ggc-none.c -o ggc-none.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/gensupport.c -o gensupport.o
ltf="/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/cp/cp-tree.def /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/java/java-tree.def /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/objc/objc-tree.def"; for f in $ltf; do \
echo "#include \"$f\""; \
done | sed 's|/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/||' > tmp-gencheck.h
/bin/sh /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/move-if-change tmp-gencheck.h gencheck.h
echo timestamp > s-gencheck
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include \
/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/gencheck.c -o gencheck.o
gcc -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o gencheck \
gencheck.o ../libiberty/libiberty.a
./gencheck > tmp-check.h
/bin/sh /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/move-if-change tmp-check.h tree-check.h
echo timestamp > s-check
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/print-rtl.c -o print-rtl.o
gcc -c -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/. -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/config -I/share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/../include /share2/portage/tmp/portage/gcc-3.2.3-r2/work/gcc-3.2.3/gcc/errors.c -o errors.o
gcc -DIN_GCC -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genflags \
genflags.o rtl.o read-rtl.o bitmap.o ggc-none.o gensupport.o print-rtl.o errors.o ../libiberty/libiberty.a
read-rtl.o(.text+0x31): In function `fatal_with_file_and_line':
: undefined reference to `fprintf_unlocked'
read-rtl.o(.text+0xcb): In function `fatal_with_file_and_line':
: undefined reference to `fprintf_unlocked'
read-rtl.o(.text+0x317): In function `read_escape':
: undefined reference to `fprintf_unlocked'
read-rtl.o(.text+0xf25): In function `read_rtx':
: undefined reference to `fprintf_unlocked'
read-rtl.o(.text+0xf49): In function `read_rtx':
: undefined reference to `fprintf_unlocked'
bitmap.o(.text+0x83a): more undefined references to `fprintf_unlocked' follow
collect2: ld returned 1 exit status
make[2]: *** [genflags] Error 1
make[2]: Leaving directory `/share2/portage/tmp/portage/gcc-3.2.3-r2/work/build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/share2/portage/tmp/portage/gcc-3.2.3-r2/work/build/gcc'
make: *** [bootstrap-lean] Error 2
!!! ERROR: sys-devel/gcc-3.2.3-r2 failed.
!!! Function src_compile, Line 371, Exitcode 2
!!! (no error message) |
Any assistance appreciated,
ghardey |
|
Back to top |
|
|
ozonator Guru
Joined: 11 Jun 2003 Posts: 591 Location: Ontario, Canada
|
Posted: Sun Dec 14, 2003 9:28 pm Post subject: Re: trying to emerge current gcc without stack-protector fai |
|
|
ghardey wrote: | As recommended in previous a post I have tried to emerge gcc-3.2.3-r2 without stack-protector flag with the intent of recompiling glibc afterward. The gcc emerge doesn't complete. I've included the last portion of the log which includes the error. I don't possess the technical sophistication to understand what is causing the error so I'm not able to more forward. My emerge info was posted a couple posts back.
Is there a way to replace my gcc-3.2.3-r2 which was compiled with the stack-protector flag with a precompiled binary version? Or if I'm going to go to gcc-3.2.3-r3 anyway should I look for that in a binary package? |
Right, sorry about that; I missed that you mentioned you had tried re-compiling before.
One hunch: if 'emerge -pv gcc' shows that 'nls' is enabled among your USE flags, try emerging with -nls, i.e.,
Code: | USE="-nls" emerge /usr/portage/sys-devel/gcc/gcc-3.2.3-r2.ebuild |
I remember running into mysterious compilation errors before, which I fixed by putting '-nls' in $USE (nls is enabled in the global make.defaults). I'm not a gcc expert, but the errors you got seem somehow text-related, hence this nls hunch.
Otherwise, I don't know anything about any available binary gcc packages. Maybe try emerging gcc-3.2.2?
Best of luck. |
|
Back to top |
|
|
TheCoop Veteran
Joined: 15 Jun 2002 Posts: 1814 Location: Where you least expect it
|
Posted: Sun Dec 14, 2003 10:44 pm Post subject: |
|
|
gcc-3.3.2-r4 has been released, which apparently loosens the -fstack-protector detect thingy a bit, so its probably worth trying that one as well _________________ 95% of all computer errors occur between chair and keyboard (TM)
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
Change the world - move a rock |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|