• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision5d5338562efa4c5e32c7fe1b64bc351f7e5e464d (tree)
l'heure2018-02-04 04:29:56
AuteurWaldemar Brodkorb <wbx@ucli...>
CommiterWaldemar Brodkorb

Message de Log

add libc version compatibility

Change Summary

Modification

--- /dev/null
+++ b/include/gnu/libc-version.h
@@ -0,0 +1,33 @@
1+/* Interface to GNU libc specific functions for version information.
2+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
3+
4+ The GNU C Library is free software; you can redistribute it and/or
5+ modify it under the terms of the GNU Lesser General Public
6+ License as published by the Free Software Foundation; either
7+ version 2.1 of the License, or (at your option) any later version.
8+
9+ The GNU C Library is distributed in the hope that it will be useful,
10+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ Lesser General Public License for more details.
13+
14+ You should have received a copy of the GNU Lesser General Public
15+ License along with the GNU C Library; if not, see
16+ <http://www.gnu.org/licenses/>. */
17+
18+#ifndef _GNU_LIBC_VERSION_H
19+#define _GNU_LIBC_VERSION_H 1
20+
21+#include <features.h>
22+
23+__BEGIN_DECLS
24+
25+/* Return string describing release status of currently running GNU libc. */
26+extern const char *gnu_get_libc_release (void) __THROW;
27+
28+/* Return string describing version of currently running GNU libc. */
29+extern const char *gnu_get_libc_version (void) __THROW;
30+
31+__END_DECLS
32+
33+#endif /* gnu/libc-version.h */
--- a/libc/misc/internals/Makefile.in
+++ b/libc/misc/internals/Makefile.in
@@ -8,7 +8,7 @@
88 subdirs += libc/misc/internals
99
1010 CSRC-y := tempname.c errno.c h_errno.c __errno_location.c __h_errno_location.c \
11- parse_config.c
11+ parse_config.c version.c
1212
1313 MISC_INTERNALS_DIR := $(top_srcdir)libc/misc/internals
1414 MISC_INTERNALS_OUT := $(top_builddir)libc/misc/internals
--- /dev/null
+++ b/libc/misc/internals/version.c
@@ -0,0 +1,65 @@
1+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
2+
3+ The GNU C Library is free software; you can redistribute it and/or
4+ modify it under the terms of the GNU Lesser General Public
5+ License as published by the Free Software Foundation; either
6+ version 2.1 of the License, or (at your option) any later version.
7+
8+ The GNU C Library is distributed in the hope that it will be useful,
9+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+ Lesser General Public License for more details.
12+
13+ You should have received a copy of the GNU Lesser General Public
14+ License along with the GNU C Library; if not, see
15+ <http://www.gnu.org/licenses/>. */
16+
17+#include "version.h"
18+#include <gnu/libc-version.h>
19+
20+static const char __libc_release[] = RELEASE;
21+static const char __libc_version[] = VERSION;
22+
23+static const char banner[] =
24+"uClibc-ng "RELEASE" release version "VERSION".\n\
25+Copyright (C) 2018 Waldemar Brodkorb <wbx@uclibc-ng.org>\n\
26+This is free software; see the source for copying conditions.\n\
27+There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
28+PARTICULAR PURPOSE.\n\
29+Compiled by GNU CC version "__VERSION__".\n";
30+
31+#include <unistd.h>
32+
33+extern void __libc_print_version (void) attribute_hidden;
34+void
35+__libc_print_version (void)
36+{
37+ write (STDOUT_FILENO, banner, sizeof banner - 1);
38+}
39+
40+extern const char *__gnu_get_libc_release (void);
41+const char *
42+__gnu_get_libc_release (void)
43+{
44+ return __libc_release;
45+}
46+weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
47+
48+extern const char *__gnu_get_libc_version (void);
49+const char *
50+__gnu_get_libc_version (void)
51+{
52+ return __libc_version;
53+}
54+weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
55+
56+/* This function is the entry point for the shared object.
57+ Running the library as a program will get here. */
58+
59+extern void __libc_main (void) __attribute__ ((noreturn));
60+void
61+__libc_main (void)
62+{
63+ __libc_print_version ();
64+ _exit (0);
65+}
--- /dev/null
+++ b/libc/misc/internals/version.h
@@ -0,0 +1,4 @@
1+/* This file just defines the current version number of libc. */
2+
3+#define RELEASE "release"
4+#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__)
--- a/libpthread/nptl/sysdeps/pthread/uClibc-glue.h
+++ b/libpthread/nptl/sysdeps/pthread/uClibc-glue.h
@@ -39,8 +39,4 @@ extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
3939 # define __uselocale(x) ((void)0)
4040 #endif
4141
42-/* Use a funky version in a probably vein attempt at preventing gdb
43- * from dlopen()'ing glibc's libthread_db library... */
44-#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__)
45-
4642 #endif