A bunch of defined(__GLIBC__) added. static-linking warning expanded

This commit is contained in:
Denis Vlasenko 2006-12-18 21:49:06 +00:00
parent f42ff90453
commit 83e5d6f772
13 changed files with 14 additions and 24 deletions

View File

@ -13,8 +13,6 @@
*/ */
#include "busybox.h" #include "busybox.h"
#include <unistd.h>
#include <string.h>
#include <assert.h> #include <assert.h>
/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
@ -22,7 +20,9 @@
#warning Static linking against glibc produces buggy executables #warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections). #warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is utterly unsuitable for static linking anyway. #warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.
#endif #endif
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE #if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE

View File

@ -1215,7 +1215,7 @@ int gzip_main(int argc, char **argv)
path = xasprintf("%s.gz", argv[i]); path = xasprintf("%s.gz", argv[i]);
/* Open output file */ /* Open output file */
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) && defined O_NOFOLLOW #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && defined(O_NOFOLLOW)
outFileNum = outFileNum =
open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW); open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW);
#else #else

View File

@ -24,13 +24,6 @@
* 7) lseek attempted when count==0 even if arg was +0 (from top) * 7) lseek attempted when count==0 even if arg was +0 (from top)
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "busybox.h" #include "busybox.h"
static const struct suffix_mult tail_suffixes[] = { static const struct suffix_mult tail_suffixes[] = {

View File

@ -159,7 +159,7 @@
#endif #endif
#if (__GLIBC__ < 2) #if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap); int vdprintf(int d, const char *format, va_list ap);
#endif #endif
// This is declared here rather than #including <libgen.h> in order to avoid // This is declared here rather than #including <libgen.h> in order to avoid

View File

@ -13,7 +13,7 @@
#if (__GLIBC__ < 2) #if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap) int vdprintf(int d, const char *format, va_list ap)
{ {
char buf[BUF_SIZE]; char buf[BUF_SIZE];

View File

@ -29,7 +29,7 @@
#include <net/if.h> #include <net/if.h>
#include <net/if_arp.h> #include <net/if_arp.h>
#include <netinet/in.h> #include <netinet/in.h>
#if __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1 #if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else

View File

@ -741,7 +741,7 @@ static const struct hwtype loop_hwtype = {
#include <net/if_arp.h> #include <net/if_arp.h>
#if (__GLIBC__ >=2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION) #if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else
#include <linux/if_ether.h> #include <linux/if_ether.h>

View File

@ -11,12 +11,11 @@
*/ */
#include "libbb.h" #include "libbb.h"
#include <string.h>
#include "rt_names.h" #include "rt_names.h"
#include "utils.h" #include "utils.h"
#if __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1 #if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else
#include <linux/if_ether.h> #include <linux/if_ether.h>

View File

@ -9,7 +9,7 @@
*/ */
#include <features.h> #include <features.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION #if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else

View File

@ -22,7 +22,7 @@
*/ */
#include <features.h> #include <features.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION) #if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else

View File

@ -1,7 +1,7 @@
/* vi: set sw=4 ts=4: */ /* vi: set sw=4 ts=4: */
#include <netinet/in.h> #include <netinet/in.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION #if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else

View File

@ -25,7 +25,7 @@
#include <net/if.h> #include <net/if.h>
#include <features.h> #include <features.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION #if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
#include <netpacket/packet.h> #include <netpacket/packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#else #else

View File

@ -12567,11 +12567,9 @@ letcmd(int argc, char **argv)
#undef rflag #undef rflag
#ifdef __GLIBC__ #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 1
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 1
typedef enum __rlimit_resource rlim_t; typedef enum __rlimit_resource rlim_t;
#endif #endif
#endif
/* /*