Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 345805 - Configure for packages with "static" useflag fails (using uClibc-0.9.30.1-r1 and gcc-4.4.5)
Summary: Configure for packages with "static" useflag fails (using uClibc-0.9.30.1-r1 ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 21:55 UTC by Sebastian Doering
Modified: 2010-12-17 16:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
example config.log from sys-devel/patch (config.log,6.19 KB, text/plain)
2010-11-16 21:58 UTC, Sebastian Doering
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Doering 2010-11-16 21:55:57 UTC
Examples of packages that fail with the same error:

sys-apps/sed
sys-apps/busybox
sys-devel/flex
sys-devel/patch

...and more.

Error happens very early in configure stage and always looks like this (from configure.log):

configure:2198: checking for C compiler default output file name
configure:2220: i686-pc-linux-uclibc-gcc -O2 -pipe -march=pentium-m -mtune=pentium-m -fomit-frame-pointer -msse -msse2 -mmmx  -Wl,-O1 -Wl,--as-needed -static-libgcc -static conftest.c  >&5
configure:2224: $? = 0
configure:2262: result: a.out
configure:2281: checking whether the C compiler works
configure:2291: ./a.out
configure:2295: $? = 139

According to exit code list this is a "Segmentation violation".

I selected "Critical" as severity, since compiling even a basic gentoo system with this setup seems impossible.


Reproducible: Always

Steps to Reproduce:
1. use uclibc stage tarball
2. set 'static' useflag
3. try to emerge one of the mentioned packages

Actual Results:  
!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-devel/patch-2.6.1/work/patch-2.6.1/config.log
 * ERROR: sys-devel/patch-2.6.1 failed:
 *   econf failed
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 2651:  Called econf
 *     ebuild.sh, line  552:  Called die
 * The specific snippet of code:
 *   			die "econf failed"
 * 
 * If you need support, post the output of 'emerge --info =sys-devel/patch-2.6.1',
 * the complete build log and the output of 'emerge -pqv =sys-devel/patch-2.6.1'.
 * The complete build log is located at '/var/tmp/portage/sys-devel/patch-2.6.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/patch-2.6.1/temp/environment'.
 * S: '/var/tmp/portage/sys-devel/patch-2.6.1/work/patch-2.6.1'

>>> Failed to emerge sys-devel/patch-2.6.1, Log file:

>>>  '/var/tmp/portage/sys-devel/patch-2.6.1/temp/build.log'

 * Messages for package sys-devel/patch-2.6.1:

 * ERROR: sys-devel/patch-2.6.1 failed:
 *   econf failed
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 2651:  Called econf
 *     ebuild.sh, line  552:  Called die
 * The specific snippet of code:
 *   			die "econf failed"
 * 
 * If you need support, post the output of 'emerge --info =sys-devel/patch-2.6.1',
 * the complete build log and the output of 'emerge -pqv =sys-devel/patch-2.6.1'.
 * The complete build log is located at '/var/tmp/portage/sys-devel/patch-2.6.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/patch-2.6.1/temp/environment'.
 * S: '/var/tmp/portage/sys-devel/patch-2.6.1/work/patch-2.6.1'



I am compiling through chroot from an Arch Linux hostsystem.

Packages that don't call 'configure' (like bzip2) compile fine.

I recompiled gcc/uclibc/etc many times trying different things, nothing seemed to solve the problem at hand.

I am no expert, so I realize I may have overlooked something obvious.
Comment 1 Sebastian Doering 2010-11-16 21:58:24 UTC
Created attachment 254551 [details]
example config.log from sys-devel/patch
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-16 22:15:09 UTC
configure:2281: checking whether the C compiler works
configure:2291: ./a.out
configure:2295: $? = 139
configure:2302: error: in `/var/tmp/portage/sys-devel/patch-2.6.1/work/patch-2.6.1':
configure:2306: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

Is that filesystem mounted rw? Is executing files on that filesystem enabled (i.e. noexec is not a mount option)?
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-16 22:16:05 UTC
(In reply to comment #2)

Actually, forget about this one:

> Is that filesystem mounted rw?

And focus on this one:

> Is executing files on that filesystem enabled
> (i.e. noexec is not a mount option)?
Comment 4 Sebastian Doering 2010-11-16 22:22:12 UTC
(In reply to comment #3)
> (In reply to comment #2)
> 
> Actually, forget about this one:
> 
> > Is that filesystem mounted rw?
> 
Yes it is. Obviously.

> And focus on this one:
> 
> > Is executing files on that filesystem enabled
> > (i.e. noexec is not a mount option)?
> 

I appreciate your replies, but these seem to be - no offense intended - redundant questions. How would I even be able to execute emerge or configure or anything else for that matter if the filesystem were 'noexec'.
Comment 5 Sebastian Doering 2010-11-16 23:00:46 UTC
> And focus on this one:
> 
> > Is executing files on that filesystem enabled
> > (i.e. noexec is not a mount option)?
> 

Additional information about the filesystem: xfs formated loop device:
"/dev/loop0 on /media/gentoo type xfs (rw,nosuid,nodev)"

But I really don't think there is any problem with the filesystem, since I already have compiled and installed some packages without problems.

I am currently in the process of rerunning the bootstrap.sh script, to make sure that the toolchain is sane.
Comment 6 Sebastian Doering 2010-11-17 11:18:43 UTC
On a hunch I changed the CHOST to "CHOST="i586-pc-linux-uclibc". With this CHOST the aforementioned packages compile fine. Switching back to i686 I see the same error again.

=> gcc bug?!
Comment 7 Sebastian Doering 2010-11-17 12:00:38 UTC
Testing some other combinations of variables revealed that 

CHOST="i686-pc-linux-uclibc"
CBUILD="i586-pc-linux-uclibc

also works.

Could that indicate a problem with my toolchain (I ran bootstrap.sh and compiled gcc/binutils/uclibc many times with the i686 CHOST, so it should be ok)? Seems weird to me.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-12-17 16:15:03 UTC
(In reply to comment #6)
> On a hunch I changed the CHOST to "CHOST="i586-pc-linux-uclibc". With this
> CHOST the aforementioned packages compile fine. Switching back to i686 I see
> the same error again.
> 
> => gcc bug?!

Rather misunderstanding of the cross-compilation idea. As I guess, switching to i586- makes configure not match any compiler with that prefix and fallback to simple 'gcc' which uses your host's default compiler.

Thus, as I see it, the problem is that your host system is unable to execute uclibc-based programs. In other words, you should try cross-compiling. I think you can find some information on the topic in the Embedded Handbook [1].

Feel free to reopen the bug if you really think it's an issue with Gentoo.

[1] http://www.gentoo.org/proj/en/base/embedded/handbook/