From ddf02f5f8e4e5ad849af3b268fd318c40051fea5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 12 Dec 2002 21:58:41 +0000 Subject: When -shared is specified, meaning they wish to create a shared library, we need to disable adding start files (i.e. crt0) since it isn't supposed to be creating an executable, just a shared lib. -Erik --- extra/gcc-uClibc/gcc-uClibc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'extra/gcc-uClibc') diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c index 765521eae..d5eb08b99 100644 --- a/extra/gcc-uClibc/gcc-uClibc.c +++ b/extra/gcc-uClibc/gcc-uClibc.c @@ -289,6 +289,7 @@ int main(int argc, char **argv) use_static_linking = 1; } if (strcmp("-shared",argv[i]) == 0) { + use_start = 0; use_pic = 1; } break; @@ -444,13 +445,15 @@ int main(int argc, char **argv) //gcc_argv[i++] = "-Wl,--end-group"; } #ifdef __UCLIBC_CTOR_DTOR__ - if (ctor_dtor) { - if (use_pic) { - gcc_argv[i++] = LIBGCC_DIR "crtendS.o" ; - } else { - gcc_argv[i++] = LIBGCC_DIR "crtend.o" ; + if (use_start) { + if (ctor_dtor) { + if (use_pic) { + gcc_argv[i++] = LIBGCC_DIR "crtendS.o" ; + } else { + gcc_argv[i++] = LIBGCC_DIR "crtend.o" ; + } + gcc_argv[i++] = crtn_path[use_build_dir]; } - gcc_argv[i++] = crtn_path[use_build_dir]; } #endif } else { -- cgit v1.2.3