Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 275725 - sys-apps/sandbox fails to configure with hardened sys-libs/uclibc
Summary: sys-apps/sandbox fails to configure with hardened sys-libs/uclibc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
: 303443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-28 18:48 UTC by Ed Wildgoose
Modified: 2010-08-17 02:40 UTC (History)
2 users (show)

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


Attachments
fix uclibc configure error (fix-uclibc.diff,277 bytes, patch)
2009-06-28 18:50 UTC, Ed Wildgoose
Details | Diff
sandbox-libc-ldso.patch (sandbox-libc-ldso.patch,509 bytes, patch)
2009-07-03 04:12 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Wildgoose 2009-06-28 18:48:35 UTC
Sandbox 1.6 (and also tried 1.9) fail to compile under uclibc with an error during configure

Tracing through the config.log the problem is due to a problem with the LIBC_VERSION test.

The configure result is:

#define LIBC_VERSION "libc.so.0
| ld-uClibc.so.0" 

The test causing this is:

LIBC_VERSION=$(
      $READELF -d libctest | \
      $EGREP NEEDED.*libc\\.so | \
      $AWK '{print $NF}' | sed -e 's:\[::' -e 's:\]::'
)


and readelf gives me:

0x00000001 (NEEDED)                     Shared library: [libc.so.0]
0x00000001 (NEEDED)                     Shared library: [ld-uClibc.so.0]

Which in turn leads to the multiple line output 

The problem would seem to be that second line starting ld-

I have attached a small patch which seems innocuous enough.  It simply adds an "egrep -v" to filter out things starting "ld-" - unless other greps don't have this option then it seems unlikely to cause problems with glibc systems or any existing setups

Could this please be tested and applied to all sandbox builds?

Not sure why more people aren't seeing this with uclibc though? Is there something broken on my setup causing this?  (The patch still seems safe in any case)

Reproducible: Always

Steps to Reproduce:
ebuild sandbox

(this is with a uclibc + hardened based system on x86
Actual Results:  
result is:

...snip...
checking CFLAGS for maximum warnings... no, unknown
checking whether C compiler accepts -fdata-sections... no
checking whether C compiler accepts -ffunction-sections... no
checking whether the linker accepts -Wl,--as-needed... no
checking whether the linker accepts -Wl,--gc-sections... no
checking whether the linker accepts -Wl,--version-script,conftest.map... no
checking whether the linker accepts -Wl,-M,conftest.map... no
configure: error: unable to find a linker flag for versioning

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-apps/sandbox-1.6-r2/work/build-default/config.log
*
* ERROR: sys-apps/sandbox-1.6-r2 failed.
Comment 1 Ed Wildgoose 2009-06-28 18:50:19 UTC
Created attachment 195981 [details, diff]
fix uclibc configure error
Comment 2 SpanKY gentoo-dev 2009-07-03 04:12:47 UTC
Created attachment 196471 [details, diff]
sandbox-libc-ldso.patch

try this one instead please
Comment 3 Ed Wildgoose 2009-07-03 10:43:09 UTC
(In reply to comment #2)
> Created an attachment (id=196471) [edit]
> sandbox-libc-ldso.patch
> 
> try this one instead please
> 

No, this line is not matching anything at all (checked at the command line)

+	$EGREP 'NEEDED.* \@<:@libc\.so' | \


I confess not to understand this bit of the regexp "\@<:@", so can't suggest a fix?

Thanks
Comment 4 SpanKY gentoo-dev 2009-07-03 18:36:07 UTC
testing it on the command line wont work.  it must be run through autoconf first.
Comment 5 Ed Wildgoose 2009-07-03 21:13:30 UTC
I should have been clear - it doesn't work as part of the ebuild - same error message as before.

I then tried to debug it by taking the regexp apart and the egrep wasn't matching any lines at all (but perhaps autoconf changes the egrep regexp?)

Cheers
Comment 6 SpanKY gentoo-dev 2009-07-05 22:15:00 UTC
you would have to run autoconf to get a new configure, then read configure and take the expression out of there

should be simple as there is only one place in configure with LIBC_VERSION=$(...

beyond that, i dont know what to say ... the proposed patch works for me on glibc, uclibc, and uclibc+hardened.
Comment 7 SpanKY gentoo-dev 2009-08-25 12:37:24 UTC
ive added my fix to sandbox-2.1.  re-open if it doesnt work for you.

http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commitdiff;h=a796eae054d499b7b49607dd4604ef24dd7622c8
Comment 8 SpanKY gentoo-dev 2010-08-17 02:40:11 UTC
*** Bug 303443 has been marked as a duplicate of this bug. ***