Révision | 5d5338562efa4c5e32c7fe1b64bc351f7e5e464d (tree) |
---|---|
l'heure | 2018-02-04 04:29:56 |
Auteur | Waldemar Brodkorb <wbx@ucli...> |
Commiter | Waldemar Brodkorb |
add libc version compatibility
@@ -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 */ |
@@ -8,7 +8,7 @@ | ||
8 | 8 | subdirs += libc/misc/internals |
9 | 9 | |
10 | 10 | 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 | |
12 | 12 | |
13 | 13 | MISC_INTERNALS_DIR := $(top_srcdir)libc/misc/internals |
14 | 14 | MISC_INTERNALS_OUT := $(top_builddir)libc/misc/internals |
@@ -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 | +} |
@@ -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__) |
@@ -39,8 +39,4 @@ extern int __cxa_atexit (void (*func) (void *), void *arg, void *d); | ||
39 | 39 | # define __uselocale(x) ((void)0) |
40 | 40 | #endif |
41 | 41 | |
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 | - | |
46 | 42 | #endif |