Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Hardened

Compile problems - possibly gcc issue?

 

 

Gentoo hardened RSS feed   Index | Next | Previous | View Threaded


lists at wildgooses

Jun 26, 2009, 11:18 AM

Post #1 of 6 (1371 views)
Permalink
Compile problems - possibly gcc issue?

Hi

I've hit a problem compiling sandbox on a uclibc+hardened machine.
Error is as follows:


...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.



Just trying to figure this out right now, but anyone got any pointers on
where to look please?

Ed W


zorry at ume

Jun 27, 2009, 11:24 AM

Post #2 of 6 (1305 views)
Permalink
Re: Compile problems - possibly gcc issue? [In reply to]

On Friday 26 June 2009 20.18.18 Ed W wrote:
> Hi
>
> I've hit a problem compiling sandbox on a uclibc+hardened machine.
> Error is as follows:
>
>
> ...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.
>
>
>
> Just trying to figure this out right now, but anyone got any pointers on
> where to look please?
>
> Ed W
Check the config.log for a start.

/Zorry


lists at wildgooses

Jun 28, 2009, 6:41 AM

Post #3 of 6 (1300 views)
Permalink
Re: Compile problems - possibly gcc issue? [In reply to]

Hmm, the relevant config.log snippet is shown below, but it's not 100%
obvious what creates the error - I guess it would be the

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

Which seems peculiarly split over two lines?

Anyone guess why this would be? Also the config.log shows me that there
are errors everywhere due to roughly the same problem. It's only this
one which was terminal

Debugging further, but grateful for any thoughts?

Ed W


------

configure:16344: checking whether the linker accepts
-Wl,--version-script,conftest.map
configure:16373: i386-gentoo-linux-uclibc-gcc -o conftest -march=k6-2
-Os -pipe -fomit-frame-pointer -D_REENTRANT -Wl,--vers
ion-script,conftest.map conftest.c >&5
conftest.c:107: error: syntax error before '-' token
conftest.c:107: error: missing terminating " character
configure:16380: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "sandbox"
| #define PACKAGE_TARNAME "sandbox"
| #define PACKAGE_VERSION "1.6"
| #define PACKAGE_STRING "sandbox 1.6"
| #define PACKAGE_BUGREPORT "sandbox [at] gentoo"
| #define PACKAGE "sandbox"
| #define VERSION "1.6"
| #define SANDBOX_CONFIGURE_OPTS "--prefix=/usr
--build=i386-gentoo-linux-uclibc --host=i386-gentoo-linux-uclibc
--mandir=/us
r/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib build
_alias=i386-gentoo-linux-uclibc host_alias=i386-gentoo-linux-uclibc
CFLAGS=-march=k6-2 -Os -pipe -fomit-frame-pointer LDFLAGS
=-Wl,-z,relro CPPFLAGS="
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_DIRENT_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_ELF_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_GRP_H 1
| #define HAVE_LIBGEN_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_PTHREAD_H 1
| #define HAVE_PWD_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_STDARG_H 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYSCALL_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_PTRDIFF_T 1
| #define HAVE_SIGHANDLER_T 1
| #define HAVE_SIG_T 1
| #define HAVE___SIGHANDLER_T 1
| #define HAVE_DECL_ENVIRON 1
| #define HAVE_UNISTD_H 1
| #define HAVE_CHOWN 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_WORKING_VFORK 1
| #define HAVE_WORKING_FORK 1
| #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
| #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
| #define RETSIGTYPE void
| #define HAVE_CREAT64 1
| #define HAVE_FOPEN64 1
| #define HAVE_FTRUNCATE 1
| #define HAVE_GETCWD 1
| #define HAVE_LCHOWN 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMCPY 1
| #define HAVE_MEMSET 1
| #define HAVE_MKDIR 1
| #define HAVE_OPEN64 1
| #define HAVE_PATHCONF 1
| #define HAVE_REALPATH 1
| #define HAVE_REMOVE 1
| #define HAVE_RMDIR 1
| #define HAVE_SETENV 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_STRNDUP 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRSPN 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOK_R 1
| #define HAVE_TRUNCATE64 1
| #define HAVE_UTIME 1
| #define HAVE_UTIMES 1
| #define HAVE_DLVSYM 0
| #define TRUNCATE_T off_t
| #define HAVE_RTLD_NEXT 1
| #define LIBC_PATH "/lib/libc.so.0"
| #define LIBC_VERSION "libc.so.0
| ld-uClibc.so.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:16403: result: no


lists at wildgooses

Jun 28, 2009, 7:28 AM

Post #4 of 6 (1302 views)
Permalink
Re: Compile problems - possibly gcc issue? [In reply to]

Ed W wrote:
> Hmm, the relevant config.log snippet is shown below, but it's not 100%
> obvious what creates the error - I guess it would be the
>
> | #define LIBC_VERSION "libc.so.0
> | ld-uClibc.so.0"
>
> Which seems peculiarly split over two lines?

Hmm, seems like a uclibc issue

The test is:

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


readelf gives me:

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


Hmm, will need to see what it needs this for so see what's the correct
answer

Ed W


mansourmoufid at gmail

Jun 28, 2009, 12:41 PM

Post #5 of 6 (1307 views)
Permalink
Re: Compile problems - possibly gcc issue? [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jun 28, 2009 at 10:28 AM, Ed W<lists [at] wildgooses> wrote:
> Ed W wrote:
>>
>> Hmm, the relevant config.log snippet is shown below, but it's not 100%
>> obvious what creates the error - I guess it would be the
>>
>> | #define LIBC_VERSION "libc.so.0
>> | ld-uClibc.so.0"
>>
>> Which seems peculiarly split over two lines?
> The test is:
>
> LIBC_VERSION=$(
> $READELF -d libctest | \
> $EGREP NEEDED.*libc\\.so | \
> $AWK '{print $NF}' | sed -e 's:\[::' -e 's:\]::'
> )
>
>
> readelf gives me:
>
> 0x00000001 (NEEDED) Shared library: [libc.so.0]
> 0x00000001 (NEEDED) Shared library: [ld-uClibc.so.0]

Hello,

I'm not familiar with this thread, but it seems that, for whatever reason,
awk and sed are returning more than one line, i.e. $ echo ${LIBC_VERSION}
would give "libc.so.0\nld-uClibc.so.0" (where \n is an actual newline).
If this is the case, perhaps the following would give the expected result:

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

- --
Mansour Moufid
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x95BBC25F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpHxvYACgkQ83JwsZW7wl/lEgCgje7sNB9MQkXfE1ZBlRFYV5Oq
Zu4AoJs5y3XbF99nY681dSRARbt8XT9A
=iv2c
-----END PGP SIGNATURE-----


lists at wildgooses

Jun 28, 2009, 4:56 PM

Post #6 of 6 (1291 views)
Permalink
Re: Compile problems - possibly gcc issue? [In reply to]

Mansour Moufid wrote:
>
> I'm not familiar with this thread, but it seems that, for whatever reason,
> awk and sed are returning more than one line, i.e. $ echo ${LIBC_VERSION}
> would give "libc.so.0\nld-uClibc.so.0" (where \n is an actual newline).
> If this is the case, perhaps the following would give the expected result:
>
> LIBC_VERSION=$(
> $READELF -d libctest | \
> $EGREP NEEDED.*libc\\.so | \
> $AWK '{print $NF}' | sed -e 's:\[::' -e 's:\]::' | \
> $HEAD -1
> )
>
> - --
> Mansour Moufid
>

Thanks for the reply


I posted a bug and also the same question to the embedded list since it
seems like a uclibc issue

I had the same first thought as you, but the ordering should not be
arbitrary. One line says "ld-something" and the other looks more like
the libc library. So I used "grep -v" to exclude the ld- lib. This
seems order invariant and unlikely to break anything already out there
(unless there are systems which don't have grep -v ??)

Still not sure if my system should be showing this extra lib or it's a
sign of some subtle breakage elsewhere, but the patch seems sane anyway

Cheers

Ed W

Gentoo hardened RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.