Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147703 - dietlibc 0.30-r2 & no main in 'stackgap'
Summary: dietlibc 0.30-r2 & no main in 'stackgap'
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Gentoo VPS Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-15 08:52 UTC by barthek
Modified: 2007-10-20 17:30 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 barthek 2006-09-15 08:52:27 UTC
I am having some issues with compiling stuff with dietlibc, namely missing main in stackgap. Example of this:

/home/staff/doli/www/q/httpd-2.0.59/srclib/apr/.libs/libapr-0.a(shm.o): In function `apr_shm_attach':
shm.c:(.text+0x584): undefined reference to `ftok'
/usr/diet/lib-i386/libc.a(stackgap.o): In function `stackgap':
(.text+0x6d): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/home/staff/doli/www/q/httpd-2.0.59'

Dietlibc folks say in the FAQ:
"
Q: I get an error message at link time, that "main" can not be found.
A: Disable WANT_STACKGAP in dietfeautres.h or try upgrading your binutils.
"

would it be possible to actually fix the darn thing please? :)
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-15 09:37:07 UTC
What are you trying to compile? Also, post emerge --info output.
Comment 2 barthek 2006-09-15 09:43:15 UTC
i'm trying to get apache working with dietlibc.
it seems i got to the final linking process.

configure options:

export CC='diet gcc'
export CFLAGS='-O -s -pipe'
 ./configure --prefix=/apache --disable-actions --disable-asis --disable-env \
--disable-include --disable-negotiation --disable-shared --enable-static --disable-so \
--with-expat=builtin

emerge info:
Portage 2.1.1 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-hardened-r1 i686)
=================================================================
System uname: 2.6.17-hardened-r1 i686 Pentium II (Deschutes)
Gentoo Base System version 1.12.5
Last Sync: Fri, 15 Sep 2006 03:50:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r3
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-s -pipe -march=pentium2 -O3 -funroll-loops -fstack-protector"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-s -pipe -march=pentium2 -O3 -funroll-loops -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distcc distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://gentoo.mirror.solnet.ch http://trumpetti.atm.tut.fi/gentoo/"
LINGUAS=""
MAKEOPTS="-j3"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/home/portagetmp"
PORTDIR="/usr/portage/"
SYNC="rsync://1g.compfort.com.pl/gentoo-portage"
USE="berkdb bzip2 caps chroot clearpasswd crypt dlloader elf elibc_glibc ftp glibc-omitfp hardened input_devices_keyboard input_devices_mouse kernel_linux mbox minimal ncurses nptl nptlonly pam pam_chroot pam_timestamp pic pwdb readline sendfile sftplogging symlink tcpd threads userland_GNU userlocales x86 xinetd xorg zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-09-15 10:14:42 UTC
Need to reopen the bug.
Comment 4 Benedikt Böhm (RETIRED) gentoo-dev 2006-09-15 11:03:39 UTC
to be honest, i'd prefer to completely disable all this pie/ssp/hardened crap in diet, it never worked, does not, and will probably never work... damn diet...

any reason why you don't use uclibc?
Comment 5 barthek 2006-09-26 07:59:59 UTC
any reason why one person uses firefox theme 'x' and the other 'y' ? :)

no particular reason, it's just that dietlibc has worked for me
for some time now and I consider it quite stable.

Never played with uclibc though. doesnt it need at totally new
toolchain?
Comment 6 Christian Heim (RETIRED) gentoo-dev 2006-09-26 08:08:05 UTC
(In reply to comment #5)
> Never played with uclibc though. doesnt it need at totally new
> toolchain?

Sadly, yeah. But if you feel yourself capable to provide a patch for the STACKGAP thing (thing is, its broken UPSTREAM) feel free to do so ;)
Comment 7 barthek 2006-09-26 08:28:56 UTC
hmm but who's right here?
dietlibc people say its binutils' fault.
you suggest that its dietlibc's.

so whats the deal? :)
Comment 8 Christian Heim (RETIRED) gentoo-dev 2006-09-26 08:55:13 UTC
(In reply to comment #7)
> hmm but who's right here?
> dietlibc people say its binutils' fault.
> you suggest that its dietlibc's.
> 
> so whats the deal? :)

Honestly, I've absolutly no clue whose fault it is. You could try it without the WANT_STACKGAP define (you'll either need to hack up a custom dietlibc or use a patch disabling it), and try it again. If it still isn't working its really binutils' fault.

If it ain't working, its still dietlibc's fault.
Comment 9 Christian Heim (RETIRED) gentoo-dev 2006-09-26 08:57:09 UTC
(In reply to comment #8)
> Honestly, I've absolutly no clue whose fault it is. You could try it without
> the WANT_STACKGAP define (you'll either need to hack up a custom dietlibc or
> use a patch disabling it), and try it again. If it still isn't working its
> really binutils' fault.
> 
> If it ain't working, its still dietlibc's fault.

That doesn't make much sense, does it ? :P

Working without WANT_STACKGAP -> dietlibc's fault
Not working without WANT_STACKGAP -> binutils' fault

Comment 10 Benedikt Böhm (RETIRED) gentoo-dev 2006-10-22 05:56:18 UTC
it seems that felix has recently added TLS (Thread Local Storage) support to dietlibc CVS, which is needed to use the stack protector with gcc 4.1.1, i.e. we can hopefully enable the SSP code again, instead of using the broken STACKGAP code

once 0.31 is released we will start a new ssp testing round...
Comment 11 Benedikt Böhm (RETIRED) gentoo-dev 2007-05-03 21:29:53 UTC
i added 0.31_pre20070503 to portage, which should support SSP natively with >=gcc-4.1, therefore obsoleting our stackgap/ssp patches

please test
Comment 12 barthek 2007-10-20 17:30:49 UTC
i have compiled dietlibc-0.31_pre20070612 successfully
with gcc 3.4.6 (Gentoo Hardened 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)

not sure whether it proves anything :)