Patchwork glibc / uclibc / bionic switch vs. non-Linux, GNU-based systems

login
register
mail settings
Submitter Thomas Schwinge
Date Dec. 8, 2010, 3:24 p.m.
Message ID <1291821876-23891-1-git-send-email-thomas@schwinge.name>
Download mbox | patch
Permalink /patch/74737/
State Superseded, archived
Headers show

Comments

Thomas Schwinge - Dec. 8, 2010, 3:24 p.m.
Hallo!

This patch makes GNU/Hurd buildable again.  Previously, I had made this
Linux libc switch depend on Linux kernel only, but when Maxim added
support for bionic on 2010-05-27 in r159917, then it broke again, and I'm
now finally giving in...  Let the libc options be there at run-time; we
simply won't use them.

gcc/

	PR target/28102
	* config.gcc <GNU based systems> (extra_options): Include linux.opt
	unconditionally.

OK to commit?


This issue is very likely to also affect (in the same way of being
un-buildable at the moment) other GNU-based configurations (kFreeBSD,
OpenSolaris), as suspected by Joseph and me.


The underlying problem is still as stated in
<http://gcc.gnu.org/ml/gcc/2007-11/msg00289.html>.  Contrary to what I
stated in there, I have not yet continued to work on untangling this.


I had come up with this patch already some weeks ago, but didn't post it
at that time, as I'm currently not able to GCC's testsuite tom
completion.  The testsuite will reproducibly hang around the moment that
an expect process is doing its 65535's fork invocation.  This is a bug,
and I'm (slowly, due to ENOTIME...) working on fixing this.  (There is a
port leak in glibc in the Hurd's fork implementation, and after 65535
leaked ports in one process, the microkernel will deny any further.)
Now, Joseph has prompted me to submit the patch anyways, for he ran into
the same problem.  The patch allows the build to succeed (last tested
with the Git mirror's 1fb531df5602228c903ff640ab6ecac3b8107a1a
(2010-11-27) sources), and I'm confident that it's correct, even without
a complete testsuite run.


Grüße,
 Thomas

---
 gcc/config.gcc |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 646e676..fb76d17 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -558,12 +558,9 @@  case ${target} in
   esac
   # glibc / uclibc / bionic switch.
   # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
-  case $target in
-    *linux*)
-      extra_options="$extra_options linux.opt";;
-    *)
-      tm_defines="$tm_defines OPTION_GLIBC=1";;
-  esac
+  # But then, providing the options doesn't hurt either, and simplifies the
+  # underlying logic.
+  extra_options="$extra_options linux.opt"
   case $target in
     *-*-*android*)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"