supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Problems Compiling with glibc 2.12.1
@ 2010-11-09 15:29 Mike Buland
  2011-02-06 23:12 ` Lasse Kliemann
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Buland @ 2010-11-09 15:29 UTC (permalink / raw)
  To: supervision

Hello,

I just wanted to let everyone know  that I've come across a strange
problem compiling runit.  The issue seems to be with glibc version
2.12.1, earlier versions did not exhibit this.  I've also tried GCC
4.5.1, 4.5.0, and 4.4.5.  The binutils version I'm using is 2.20.1.

When compiling, the runit and runit-init programs link statically, and
the result does not appear to be a valid executable program.  The
system complains that there is no valid entry point.  Interestingly
enough, I can't get this to happen with any programs that aren't runit
and runit-init.  Also, the problem is not evident when linking against
dietlibc.  The executables I made with dietlibc are fine.

I don't think this is an issue for runit, actually, especially since
there is a workaround, but it is a concern for the glibc developers,
but who knows when they'll get around to fixing it.  I thought the
list in general could benefit from my somewhat limited research into
the problem.  I'm also in the process of figuring out if this is a new
bug for the glibc devs or not so I can report it to them.

Also, I'm running a 32bit x86 system, and I've tried it on a couple
different processors, with a few different compile options in place
while building glibc, always the same results.

Hope this helps anyone else having trouble compiling against newer
glibc versions.
--Mike Buland


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2010-11-09 15:29 Problems Compiling with glibc 2.12.1 Mike Buland
@ 2011-02-06 23:12 ` Lasse Kliemann
  2011-02-07  0:50   ` Laurent Bercot
  2011-06-13 13:01   ` Robin Bowes
  0 siblings, 2 replies; 9+ messages in thread
From: Lasse Kliemann @ 2011-02-06 23:12 UTC (permalink / raw)
  To: Mike Buland; +Cc: supervision

[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]

* Message by -Mike Buland- from Tue 2010-11-09:

> I just wanted to let everyone know  that I've come across a strange
> problem compiling runit.  The issue seems to be with glibc version
> 2.12.1, earlier versions did not exhibit this.  I've also tried GCC
> 4.5.1, 4.5.0, and 4.4.5.  The binutils version I'm using is 2.20.1.
> 
> When compiling, the runit and runit-init programs link statically, and
> the result does not appear to be a valid executable program.  The
> system complains that there is no valid entry point.  Interestingly
> enough, I can't get this to happen with any programs that aren't runit
> and runit-init.  Also, the problem is not evident when linking against
> dietlibc.  The executables I made with dietlibc are fine.
> 
> I don't think this is an issue for runit, actually, especially since
> there is a workaround, but it is a concern for the glibc developers,
> but who knows when they'll get around to fixing it.  I thought the
> list in general could benefit from my somewhat limited research into
> the problem.  I'm also in the process of figuring out if this is a new
> bug for the glibc devs or not so I can report it to them.
> 
> Also, I'm running a 32bit x86 system, and I've tried it on a couple
> different processors, with a few different compile options in place
> while building glibc, always the same results.

I get "unexpected reloc type in static binary" and a segfault:

  bash-4.0$ package/check 
  Checking commands in ./command...
  + cd compile
  + exec make check
  ./check-local chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset
  Checking chpst...
  Checking runit...
  unexpected reloc type in static binarySegmentation fault
  139
  runit failed.
  make: *** [check] Error 1

This is with Glibc 2.13. Somewhat older Glibc versions work 
alright, for instance 2.11.2. As a workaround (or fix), I changed 
src/conf-ld to call "gcc" and not "gcc -s".

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-02-06 23:12 ` Lasse Kliemann
@ 2011-02-07  0:50   ` Laurent Bercot
  2011-02-07  2:09     ` Charlie Brady
  2011-02-08  0:16     ` Lasse Kliemann
  2011-06-13 13:01   ` Robin Bowes
  1 sibling, 2 replies; 9+ messages in thread
From: Laurent Bercot @ 2011-02-07  0:50 UTC (permalink / raw)
  To: supervision

> This is with Glibc 2.13. Somewhat older Glibc versions work 
> alright, for instance 2.11.2. As a workaround (or fix), I changed 
> src/conf-ld to call "gcc" and not "gcc -s".

 Static linking is broken in recent glibcs. The GNU people have lost
their minds for quite a long time now.

 The runit package should not try and forcefully link executables
statically, even important executables like runit and runit-init.
Other init systems provide a dynamically-linked "init" binary and
they work (at a price, of course: the demented requirements of the
Upstart "init" binary, for instance, make booting impossible if you
don't have libdbus on your root filesystem). The decision of linking
statically or dynamically should ultimately be left to the user.

 Of course, the runit documentation could mention that it's a good
idea to statically link vital binaries (such as the Process One binary),
and that on Linux systems, glibc does not allow it. The documentation
could then point Linux users to sane libcs like dietlibc or uClibc -
to use the latter, I've been very happy with the uClibc toolchains
provided by Aboriginal Linux at landley.net/aboriginal/.

-- 
 Laurent


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-02-07  0:50   ` Laurent Bercot
@ 2011-02-07  2:09     ` Charlie Brady
  2011-02-07  7:56       ` Laurent Bercot
  2011-02-08  0:16     ` Lasse Kliemann
  1 sibling, 1 reply; 9+ messages in thread
From: Charlie Brady @ 2011-02-07  2:09 UTC (permalink / raw)
  To: Laurent Bercot; +Cc: supervision


On Mon, 7 Feb 2011, Laurent Bercot wrote:

> to use the latter, I've been very happy with the uClibc toolchains
> provided by Aboriginal Linux at landley.net/aboriginal/.

I get 404 for http://landley.net/aboriginal/ (and for 
http://www.landley.net/aboriginal/).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-02-07  2:09     ` Charlie Brady
@ 2011-02-07  7:56       ` Laurent Bercot
  0 siblings, 0 replies; 9+ messages in thread
From: Laurent Bercot @ 2011-02-07  7:56 UTC (permalink / raw)
  To: supervision

> I get 404 for http://landley.net/aboriginal/ (and for 
> http://www.landley.net/aboriginal/).

 Rob's site is acting up again. (It's not the first time.) I'll send him
an e-mail.
 In the meantime, you can check what the site is about in Google's cache,
even though I'm just using the precompiled binary toolchains in
downloads/binaries/ and those aren't available.

-- 
 Laurent


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-02-07  0:50   ` Laurent Bercot
  2011-02-07  2:09     ` Charlie Brady
@ 2011-02-08  0:16     ` Lasse Kliemann
  1 sibling, 0 replies; 9+ messages in thread
From: Lasse Kliemann @ 2011-02-08  0:16 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

* Message by -Laurent Bercot- from Mon 2011-02-07:
> > This is with Glibc 2.13. Somewhat older Glibc versions work 
> > alright, for instance 2.11.2. As a workaround (or fix), I changed 
> > src/conf-ld to call "gcc" and not "gcc -s".
> 
>  Static linking is broken in recent glibcs.

Just found out that static linking works when using latest 
binutils (2.21), at least for runit.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-02-06 23:12 ` Lasse Kliemann
  2011-02-07  0:50   ` Laurent Bercot
@ 2011-06-13 13:01   ` Robin Bowes
  2011-06-13 13:38     ` Laurent Bercot
  1 sibling, 1 reply; 9+ messages in thread
From: Robin Bowes @ 2011-06-13 13:01 UTC (permalink / raw)
  To: supervision

On 02/06/2011 11:12 PM, Lasse Kliemann wrote:
> This is with Glibc 2.13. Somewhat older Glibc versions work
> alright, for instance 2.11.2. As a workaround (or fix), I changed
> src/conf-ld to call "gcc" and not "gcc -s".

I'm seeing the same problem in NexentaStor (based on OpenSolaris).

Partial output from package/install:
...
./load runit unix.a byte.a -static
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [runit] Error 1

Contents of compile/sysdeps:

sunos-5.11-nexentaos_134f-:i386-:i86pc-:genuineintel-000206c2-bfebfbff-:i86pc-
#!/bin/sh
# WARNING: This file was auto-generated. Do not edit!
exec gcc -O2 -Wall -c ${1+"$@"}
#!/bin/sh
# WARNING: This file was auto-generated. Do not edit!
main="$1"; shift
exec gcc -s -o "$main" "$main".o ${1+"$@"}
-lxnet
/* sysdep: +dirent */
/* sysdep: +waitpid */
/* sysdep: +sigaction */
/* sysdep: +sigprocmask */
/* sysdep: +sysselect */
/* sysdep: -ulong64 */
/* sysdep: +poll */
/* sysdep: +mkfifo */
/* sysdep: -flock */
/* sysdep: -shortsetgroups */
/* sysdep: -std reboot */
/* sysdep: +utmpx */

Changing src/conf-ld to "gcc" instead of "gcc -s" has no effect, ie. it 
still fails at the same point.

Anyone got any ideas how I can get runit built on NexentaStor/OpenSolaris ?

R.

-- 
"Feed that ego and you starve the soul" - Colonel J.D. Wilkes
http://www.theshackshakers.com/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-06-13 13:01   ` Robin Bowes
@ 2011-06-13 13:38     ` Laurent Bercot
  2011-06-13 17:19       ` Robin Bowes
  0 siblings, 1 reply; 9+ messages in thread
From: Laurent Bercot @ 2011-06-13 13:38 UTC (permalink / raw)
  To: supervision

> ./load runit unix.a byte.a -static

 My nose is tingling.


> Anyone got any ideas how I can get runit built on NexentaStor/OpenSolaris ?

 What if you remove the -static from the Makefile ?
 The runit and runit-init binaries are always linked statically, in order
to avoid runtime libc dependencies; but maybe your gcc doesn't understand
-static when it's there on the command line, or your system simply does
not provide a static version of the libc. (Which would suck, but hey,
it's Solaris-based.)

-- 
 Laurent


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems Compiling with glibc 2.12.1
  2011-06-13 13:38     ` Laurent Bercot
@ 2011-06-13 17:19       ` Robin Bowes
  0 siblings, 0 replies; 9+ messages in thread
From: Robin Bowes @ 2011-06-13 17:19 UTC (permalink / raw)
  To: supervision

On 06/13/2011 02:38 PM, Laurent Bercot wrote:
>> ./load runit unix.a byte.a -static
>
>   My nose is tingling.
>
>
>> Anyone got any ideas how I can get runit built on NexentaStor/OpenSolaris ?
>
>   What if you remove the -static from the Makefile ?
>   The runit and runit-init binaries are always linked statically, in order
> to avoid runtime libc dependencies; but maybe your gcc doesn't understand
> -static when it's there on the command line, or your system simply does
> not provide a static version of the libc. (Which would suck, but hey,
> it's Solaris-based.)

Removing -static from the Makefile worked. I even added back the "-s" in 
src/conf-ld.

I just did this before running package/install:

perl -pi -e 's/-static//' src/Makefile

which removes -static from the following two lines

runit: load runit.o unix.a byte.a
         ./load runit unix.a byte.a -static

runit-init: load runit-init.o unix.a byte.a
         ./load runit-init unix.a byte.a -static

So, looks like gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2nexenta7) doesn't like the 
-static switch.

R.
-- 
"Feed that ego and you starve the soul" - Colonel J.D. Wilkes
http://www.theshackshakers.com/


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-06-13 17:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 15:29 Problems Compiling with glibc 2.12.1 Mike Buland
2011-02-06 23:12 ` Lasse Kliemann
2011-02-07  0:50   ` Laurent Bercot
2011-02-07  2:09     ` Charlie Brady
2011-02-07  7:56       ` Laurent Bercot
2011-02-08  0:16     ` Lasse Kliemann
2011-06-13 13:01   ` Robin Bowes
2011-06-13 13:38     ` Laurent Bercot
2011-06-13 17:19       ` Robin Bowes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).