Eric Andersen | aad1a88 | 2001-03-16 22:47:14 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
Denis Vlasenko | 724d196 | 2007-10-10 14:41:07 +0000 | [diff] [blame] | 3 | * Stub for linking busybox binary against libbusybox. |
Eric Andersen | aad1a88 | 2001-03-16 22:47:14 +0000 | [diff] [blame] | 4 | * |
Denis Vlasenko | 724d196 | 2007-10-10 14:41:07 +0000 | [diff] [blame] | 5 | * Copyright (C) 2007 Denis Vlasenko |
Eric Andersen | aad1a88 | 2001-03-16 22:47:14 +0000 | [diff] [blame] | 6 | * |
Denis Vlasenko | 724d196 | 2007-10-10 14:41:07 +0000 | [diff] [blame] | 7 | * Licensed under GPLv2, see file License in this tarball for details. |
Eric Andersen | aad1a88 | 2001-03-16 22:47:14 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
Manuel Novoa III | 31b98dd | 2004-02-01 10:03:05 +0000 | [diff] [blame] | 10 | #include <assert.h> |
Denis Vlasenko | c7ba8b9 | 2007-02-03 17:27:14 +0000 | [diff] [blame] | 11 | #include "busybox.h" |
| 12 | |
Denis Vlasenko | 07159f0 | 2006-11-09 00:00:12 +0000 | [diff] [blame] | 13 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ |
| 14 | #if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__) |
Denis Vlasenko | df51892 | 2006-10-20 13:42:57 +0000 | [diff] [blame] | 15 | #warning Static linking against glibc produces buggy executables |
Denis Vlasenko | 067e3f0 | 2006-11-10 23:25:53 +0000 | [diff] [blame] | 16 | #warning (glibc does not cope well with ld --gc-sections). |
Denis Vlasenko | afea46b | 2006-10-29 19:37:13 +0000 | [diff] [blame] | 17 | #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 |
Denis Vlasenko | 83e5d6f | 2006-12-18 21:49:06 +0000 | [diff] [blame] | 18 | #warning Note that glibc is unsuitable for static linking anyway. |
| 19 | #warning If you still want to do it, remove -Wl,--gc-sections |
Denis Vlasenko | 15c3885 | 2007-11-05 19:31:01 +0000 | [diff] [blame] | 20 | #warning from scripts/trylink and remove this warning. |
Denis Vlasenko | 4500c58 | 2007-05-18 07:37:06 +0000 | [diff] [blame] | 21 | #error Aborting compilation. |
Denis Vlasenko | df51892 | 2006-10-20 13:42:57 +0000 | [diff] [blame] | 22 | #endif |
| 23 | |
Denis Vlasenko | 724d196 | 2007-10-10 14:41:07 +0000 | [diff] [blame] | 24 | #if ENABLE_BUILD_LIBBUSYBOX |
Denis Vlasenko | 32b633a | 2007-04-09 03:05:48 +0000 | [diff] [blame] | 25 | int main(int argc, char **argv) |
| 26 | { |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 27 | return lbb_main(argc, argv); |
Denis Vlasenko | 32b633a | 2007-04-09 03:05:48 +0000 | [diff] [blame] | 28 | } |
Denis Vlasenko | 724d196 | 2007-10-10 14:41:07 +0000 | [diff] [blame] | 29 | #endif |