summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-02-27 03:59:33 +0000
committerEric Andersen <andersen@codepoet.org>2003-02-27 03:59:33 +0000
commit212f984443cdaacfb36661f7fedf73c9285d0d08 (patch)
tree2284cb9a06a9c5384dd45fc845755b7c9d933e03 /extra
parent8b1cd1869a7a15a31153e579a1dde0b257d2f358 (diff)
Patch from David Airlie to fix handling of ctor/dtor stuff when used in
combination with and w/o both the nostdinc and nostdlib options.
Diffstat (limited to 'extra')
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c
index 69f91472f..8cb8a8f3c 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -271,11 +271,17 @@ int main(int argc, char **argv)
if (strcmp(nostdinc,argv[i]) == 0) {
use_stdinc = 0;
} else if (strcmp(nostartfiles,argv[i]) == 0) {
+#ifdef __UCLIBC_CTOR_DTOR__
+ ctor_dtor = 0;
+#endif
use_start = 0;
} else if (strcmp(nodefaultlibs,argv[i]) == 0) {
use_stdlib = 0;
argv[i] = '\0';
} else if (strcmp(nostdlib,argv[i]) == 0) {
+#ifdef __UCLIBC_CTOR_DTOR__
+ ctor_dtor = 0;
+#endif
use_start = 0;
use_stdlib = 0;
}
@@ -413,17 +419,18 @@ int main(int argc, char **argv)
}
if (linking && source_count) {
- if (use_start) {
+
#ifdef __UCLIBC_CTOR_DTOR__
- if (ctor_dtor) {
- gcc_argv[i++] = crti_path[use_build_dir];
- if (use_pic) {
- gcc_argv[i++] = LIBGCC_DIR "crtbeginS.o" ;
- } else {
- gcc_argv[i++] = LIBGCC_DIR "crtbegin.o" ;
- }
+ if (ctor_dtor) {
+ gcc_argv[i++] = crti_path[use_build_dir];
+ if (use_pic) {
+ gcc_argv[i++] = LIBGCC_DIR "crtbeginS.o" ;
+ } else {
+ gcc_argv[i++] = LIBGCC_DIR "crtbegin.o" ;
}
+ }
#endif
+ if (use_start) {
gcc_argv[i++] = crt0_path[use_build_dir];
}
for ( l = 0 ; l < k ; l++ ) {
@@ -448,16 +455,14 @@ int main(int argc, char **argv)
//gcc_argv[i++] = "-Wl,--end-group";
}
#ifdef __UCLIBC_CTOR_DTOR__
- 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];
- }
- }
+ 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];
+ }
#endif
} else {
for ( l = 0 ; l < k ; l++ ) {